summaryrefslogtreecommitdiff
path: root/lisp/disp-table.el
diff options
context:
space:
mode:
authorJuanma Barranquero <lekktu@gmail.com>2008-03-01 15:40:44 +0000
committerJuanma Barranquero <lekktu@gmail.com>2008-03-01 15:40:44 +0000
commite0c8ae101a411f2de94cd03ff8d27c5809e7bdff (patch)
treea42449f1ff5edc75f83ce2f3b876ad91775ca284 /lisp/disp-table.el
parent7ee480ce4f5df93c16313a50e11f0afe04477d01 (diff)
downloademacs-e0c8ae101a411f2de94cd03ff8d27c5809e7bdff.tar.gz
(make-glyph-code): Don't test the result of `face-id',
which already signals an error for invalid faces. (glyph-face): Simplify.
Diffstat (limited to 'lisp/disp-table.el')
-rw-r--r--lisp/disp-table.el17
1 files changed, 7 insertions, 10 deletions
diff --git a/lisp/disp-table.el b/lisp/disp-table.el
index 9124353884b..5e28e2163e7 100644
--- a/lisp/disp-table.el
+++ b/lisp/disp-table.el
@@ -193,11 +193,9 @@ X frame."
(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 @@ X frame."
;;;###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)