X-Git-Url: https://git.hcoop.net/bpt/emacs.git/blobdiff_plain/bf120ed1b9f1fa5a2422465e7ca825080b7b0c65..4b03e20a6f086c901d7e183a905ee9097a6de0b6:/lisp/disp-table.el diff --git a/lisp/disp-table.el b/lisp/disp-table.el index c6b55f6a3e..5e28e2163e 100644 --- a/lisp/disp-table.el +++ b/lisp/disp-table.el @@ -125,7 +125,7 @@ Valid symbols are `truncation', `wrap', `escape', `control', (or standard-display-table (setq standard-display-table (make-display-table))) (while (<= l h) - (if (and (>= l ?\s) (char-valid-p l)) + (if (and (>= l ?\s) (characterp l)) (aset standard-display-table l nil)) (setq l (1+ l)))) @@ -189,25 +189,30 @@ X frame." (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)) + ;; face id greater that 512 are silently ignored. + (if (not face) + char + (let ((fid (face-id face))) + (if (< fid 64) ; we have 32 - 3(LSB) - 1(SIGN) - 22(CHAR) = 6 bits for face id + (logior char (lsh fid 22)) + (cons char fid))))) ;;;###autoload (defun glyph-char (glyph) "Return the character of glyph code GLYPH." - (logand glyph #x7ffff)) + (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 -19))) + (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) - face)) - (face-list))))))) + (catch 'face + (dolist (face (face-list)) + (when (eq (face-id face) face-id) + (throw 'face face))))))) ;;;###autoload (defun standard-display-european (arg)