unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Integer & glyph (trunk and emacs_unicode)
@ 2007-11-15 21:15 Vinicius Jose Latorre
  2007-11-15 21:12 ` Stefan Monnier
  2007-11-16 18:33 ` Richard Stallman
  0 siblings, 2 replies; 8+ messages in thread
From: Vinicius Jose Latorre @ 2007-11-15 21:15 UTC (permalink / raw)
  To: GNU Emacs (devel)

It seems that glyphs have some problems as it's implemented
by make-glyph-code, glyph-char and glyph-face in disp-table.el file.

The integers in Emacs Lisp have a minimum range from -2**28 to
2**28 - 1, that is, 29 bits.  In my system (AMD Athlon 64 -
GNU/Linux Debian using Emacs 23.0.50.1 - CVS trunk) integers
in Emacs Lisp have 29 bits.

The make-glyph-code in Emacs 23.0.50.1 (CVS trunk) is:

 (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 4091 are silently ignored.
   (if (and face (<= (face-id face) #xfff))
       (logior char (lsh (face-id face) 19))
     char))

So, it assumes 12 bits for face id and 19 bits for char code,
the result is an integer of 31 bits.

Shouldn't it be used #x3ff (10 bits for face id) instead of #xfff?

BTW, the same thing happens in Emacs unicode branch.

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

end of thread, other threads:[~2007-11-17 23:31 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-15 21:15 Integer & glyph (trunk and emacs_unicode) Vinicius Jose Latorre
2007-11-15 21:12 ` Stefan Monnier
2007-11-16  3:39   ` Drew Adams
2007-11-16 13:25     ` Vinicius Jose Latorre
2007-11-17  4:53       ` Richard Stallman
2007-11-17 16:17         ` Kim F. Storm
2007-11-17 23:31           ` Richard Stallman
2007-11-16 18:33 ` 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).