# HG changeset patch # User Juanma Barranquero # Date 1204385953 0 # Node ID ec29b9d50b84d52d911efe3785c6726d13d0fc3b # Parent c172e57f2c6e8078e9d7dc0950e342aa766990da (make-glyph-code): Don't test the result of `face-id', which already signals an error for invalid faces. (glyph-face): Simplify. diff -r c172e57f2c6e -r ec29b9d50b84 lisp/disp-table.el --- a/lisp/disp-table.el Sat Mar 01 14:59:17 2008 +0000 +++ b/lisp/disp-table.el Sat Mar 01 15:39:13 2008 +0000 @@ -193,11 +193,9 @@ (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)))))) + (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) @@ -209,13 +207,12 @@ ;;;###autoload (defun glyph-face (glyph) "Return the face of glyph code GLYPH, or nil if glyph has default face." - (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)