unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: Problem with glyphs with face-id over 128 in unicode-2 emacs
       [not found] <87tzjytzww.fsf@gmail.com>
@ 2008-02-27 22:58 ` Kim F. Storm
  2008-02-28 16:41   ` Richard Stallman
  0 siblings, 1 reply; 2+ messages in thread
From: Kim F. Storm @ 2008-02-27 22:58 UTC (permalink / raw)
  To: Eduardo Ochs; +Cc: bug-gnu-emacs, emacs-devel


As promised a long time ago, I have installed changes (and cleaned up
related code) to fix the problem with encoding face ids in integer
glyph codes.


Eduardo Ochs <eduardoochs@gmail.com> writes:

> Suppose that we have more than 128 faces defined, and that we want to
> make, say, all "\^O"s be displayed as "*"s with the face
> `face-with-id-138'; we would try to do this:
>
>   (aset standard-display-table ?\^O
> 	(vector (make-glyph-code ?* 'face-with-id-138)))
>
> where, of course, face-with-id-138 is a face for which:
>
>   (face-id 'face-with-id-138)
>      ==> 138.
>
> Then we will notice that the "\^O"s get displayed using the face with
> face-id=10 instead (by the way: here (face-id 'highlight) is 10)...
>
> Here's what is happening: `make-glyph-code' has this definition (in
> "disp-table.el" in emacs-unicode-2, i.e., in CVS Emacs after the merge
> or the unicode-2 branch):
>
>   (defun make-glyph-code (char &optional face)
>     "Return a glyph code representing char CHAR with face FACE."
>     ;; Due to limitations on Emacs integer values, faces with
>     ;; face id greater that 512 are silently ignored.
>     (if (and face (<= (face-id face) #x1ff))
>         (logior char (lsh (face-id face) 22))
>       char))
>
> That magic number, 22, used to be 19 in pre-unicode-2 Emacs.
>
> The problem is that (lsh 128 22) is 0, and so (lsh 138 22) drops the
> bit corresponding to the 128 in the shift, and its result is the same
> as of (lsh 10 22).


-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk





^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Problem with glyphs with face-id over 128 in unicode-2 emacs
  2008-02-27 22:58 ` Problem with glyphs with face-id over 128 in unicode-2 emacs Kim F. Storm
@ 2008-02-28 16:41   ` Richard Stallman
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Stallman @ 2008-02-28 16:41 UTC (permalink / raw)
  To: Kim F. Storm; +Cc: bug-gnu-emacs, eduardoochs, emacs-devel

Thanks for improving this.




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-02-28 16:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <87tzjytzww.fsf@gmail.com>
2008-02-27 22:58 ` Problem with glyphs with face-id over 128 in unicode-2 emacs Kim F. Storm
2008-02-28 16:41   ` Richard Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).