[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: make-glyph-code incompatibility
From: |
Kim F. Storm |
Subject: |
Re: make-glyph-code incompatibility |
Date: |
Tue, 04 Mar 2008 01:08:22 +0100 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) |
Stefan Monnier <address@hidden> writes:
> The new make-glyph-code is a good change, but it introduces
> an incompatibility. It seems that it makes previously working code
> fail silently. Can we make it fail with an informative message?
The new encoding still merges a face id and char code into
an integer if the face id is < 64. So an integer value may
still carry a face id in the upper bits.
Of course, I could make it always use a cons cell for non-default face.
Then we could check (and warn) if an integer value is >= 1^22, but
even if we do that, it can fail:
For example, how do you differentiate
1 << 19 + ?a (emacs 22 glyph code for 'a' in mode-line face)
and the unicode character with the same numeric value in emacs 23 ?
Also, issuing warnings during redisplay is a mess!
We introduced make-glyph-code in 22.1 in preparation for the unicode
merge in 23.1 - to give people time to adjust their code.
Perhaps emacs 23 NEWS file should repeat the description of make-glyph-code
from NEWS.22 - this time saying it is the only way to do it:
Maybe write something like (incompatible lisp changes):
** The functions `make-glyph-code', `glyph-char', and `glyph-face'
must be used to create and decode glyph codes in display tables.
The old method of creating a display table element by combining a face
number and a character code into a numeric glyph code is no longer
supported; using it may cause arbitrary characters and faces to be
displayed.
--
Kim F. Storm <address@hidden> http://www.cua.dk
Re: make-glyph-code incompatibility, Stefan Monnier, 2008/03/04