[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Usage of standard-display-table in MSDOS

From: Kenichi Handa
Subject: Re: Usage of standard-display-table in MSDOS
Date: Sat, 28 Aug 2010 13:18:02 +0900

In article <address@hidden>, Eli Zaretskii <address@hidden> writes:

> > >     "Display characters in the range L to H literally."
> > 
> > > The "literally" part is no longer true, is it?
> > 
> > What's the meaning of "literally" when a display table
> > element is [#xA0]?

> It means that a literal byte 0xA0 is sent to the terminal.

>From which document, can we get that interpretation?  The
docstring of buffer-display-table says:

Each element should be a vector of
characters or nil.  The value nil means display the character in the
default fashion; otherwise, the characters from the vector are delivered
to the screen instead of the original character.

It only says about "character".  Although it doesn't say how
to deliver a character to a terminal, the natural way is to
encode that character by the terminal coding system, or
display that character by the corresponding glyph of a font.

> > Before Emacs 23, the character #xA0 represents the byte
> > 0xA0.  But now it is a character representing a Unicode
> > character U+00A0, and #x3FFFA0 is the character representing
> > the byte 0xA0.
> > 
> > And, to "display characters literally", we have been encoded
> > characters by the terminal coding system.  Before Emacs 23,
> > the encoded result of #xA0 is always the byte 0xA0, but now
> > it depends on the terminal coding system.

> Which means, AFAIU, that "literally" is no longer possible.  At least
> in the case of a multibyte buffer.

> What about a unibyte buffer, though?  How do we display the characters
> there?

This is the way to display the character #xA0 (in
multibyte-buffer) and the chararacter representing the byte
#xA0 (in both multibyte-buffer and unibyte-buffer) by
sending the byte #xA0 to the terminal .

;; For NBSP (U+00A0)
(aset standard-display-table #xA0
      (vector (unibyte-char-to-multibyte #xA0)))
;; For byte #xA0.
(aset standard-display-table (unibyte-char-to-multibyte #xA0)
      (vector (unibyte-char-to-multibyte #xA0)))
(set-terminal-coding-sytem 'no-conversion)
(set-safe-terminal-coding-system-internal 'no-conversion)

The last two lines are currently necessary because of a bug
in term.c.  I'm going to fix it.

Kenichi Handa

reply via email to

[Prev in Thread] Current Thread [Next in Thread]