summaryrefslogtreecommitdiff
path: root/lisp/disp-table.el
diff options
context:
space:
mode:
authorKim F. Storm <storm@cua.dk>2008-02-27 22:53:11 +0000
committerKim F. Storm <storm@cua.dk>2008-02-27 22:53:11 +0000
commit20e70daf7f4a7d1cf8a03fb668d64496d87791e0 (patch)
treedd16f412a7e15bc510eef32540dc922b2eb7f947 /lisp/disp-table.el
parenta6fa701eb167558fad7cfcc12951222665f92635 (diff)
downloademacs-20e70daf7f4a7d1cf8a03fb668d64496d87791e0.tar.gz
(make-glyph-code): Encode as cons if face id > 63.
(glyph-char, glyph-face): Handle cons encoding.
Diffstat (limited to 'lisp/disp-table.el')
-rw-r--r--lisp/disp-table.el18
1 files changed, 13 insertions, 5 deletions
diff --git a/lisp/disp-table.el b/lisp/disp-table.el
index a71ef02e8cb..9124353884b 100644
--- a/lisp/disp-table.el
+++ b/lisp/disp-table.el
@@ -190,19 +190,27 @@ X frame."
"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))
+ (if (not face)
+ char
+ (let ((fid (face-id face)))
+ (cond
+ ((not fid) (error "unknown face"))
+ ((< fid 64) ; we have 32 - 3(LSB) - 1(SIGN) - 22(CHAR) = 6 bits for face id
+ (logior char (lsh fid 22)))
+ (t (cons char fid))))))
;;;###autoload
(defun glyph-char (glyph)
"Return the character of glyph code GLYPH."
- (logand glyph #x3fffff))
+ (if (consp glyph)
+ (car glyph)
+ (logand glyph #x3fffff)))
;;;###autoload
(defun glyph-face (glyph)
"Return the face of glyph code GLYPH, or nil if glyph has default face."
- (let ((face-id (lsh glyph -22)))
+
+ (let ((face-id (if (consp glyph) (cdr glyph) (lsh glyph -22))))
(and (> face-id 0)
(car (delq nil (mapcar (lambda (face)
(and (eq (get face 'face) face-id)