From: storm@cua.dk (Kim F. Storm)
To: Eduardo Ochs <eduardoochs@gmail.com>
Cc: bug-gnu-emacs@gnu.org, emacs-devel@gnu.org
Subject: Re: Problem with glyphs with face-id over 128 in unicode-2 emacs
Date: Wed, 27 Feb 2008 23:58:20 +0100 [thread overview]
Message-ID: <87d4qif1mb.fsf@kfs-lx.rd.rdm> (raw)
In-Reply-To: <87tzjytzww.fsf@gmail.com> (Eduardo Ochs's message of "Sun\, 24 Feb 2008 07\:24\:47 -0300")
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
next prev parent reply other threads:[~2008-02-27 22:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-24 10:24 Problem with glyphs with face-id over 128 in unicode-2 emacs Eduardo Ochs
2008-02-25 14:40 ` Kim F. Storm
2008-02-27 22:58 ` Kim F. Storm [this message]
2008-02-28 16:41 ` Richard Stallman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87d4qif1mb.fsf@kfs-lx.rd.rdm \
--to=storm@cua.dk \
--cc=bug-gnu-emacs@gnu.org \
--cc=eduardoochs@gmail.com \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.