aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuanma Barranquero2008-03-01 15:40:44 +0000
committerJuanma Barranquero2008-03-01 15:40:44 +0000
commite0c8ae101a411f2de94cd03ff8d27c5809e7bdff (patch)
treea42449f1ff5edc75f83ce2f3b876ad91775ca284
parent7ee480ce4f5df93c16313a50e11f0afe04477d01 (diff)
downloademacs-e0c8ae101a411f2de94cd03ff8d27c5809e7bdff.tar.gz
emacs-e0c8ae101a411f2de94cd03ff8d27c5809e7bdff.zip
(make-glyph-code): Don't test the result of `face-id',
which already signals an error for invalid faces. (glyph-face): Simplify.
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/disp-table.el17
2 files changed, 11 insertions, 10 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 4c805de52f5..8f446aead30 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,9 @@
12008-03-01 Juanma Barranquero <lekktu@gmail.com> 12008-03-01 Juanma Barranquero <lekktu@gmail.com>
2 2
3 * disp-table.el (make-glyph-code): Don't test the result of
4 `face-id', which already signals an error for invalid faces.
5 (glyph-face): Simplify.
6
3 * desktop.el (desktop-read): Set `desktop-dirname' to nil before 7 * desktop.el (desktop-read): Set `desktop-dirname' to nil before
4 running `desktop-not-loaded-hook' to allow modifying it. 8 running `desktop-not-loaded-hook' to allow modifying it.
5 Don't show warning message if `desktop-dirname' was modified. 9 Don't show warning message if `desktop-dirname' was modified.
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."
193 (if (not face) 193 (if (not face)
194 char 194 char
195 (let ((fid (face-id face))) 195 (let ((fid (face-id face)))
196 (cond 196 (if (< fid 64) ; we have 32 - 3(LSB) - 1(SIGN) - 22(CHAR) = 6 bits for face id
197 ((not fid) (error "unknown face")) 197 (logior char (lsh fid 22))
198 ((< fid 64) ; we have 32 - 3(LSB) - 1(SIGN) - 22(CHAR) = 6 bits for face id 198 (cons char fid)))))
199 (logior char (lsh fid 22)))
200 (t (cons char fid))))))
201 199
202;;;###autoload 200;;;###autoload
203(defun glyph-char (glyph) 201(defun glyph-char (glyph)
@@ -209,13 +207,12 @@ X frame."
209;;;###autoload 207;;;###autoload
210(defun glyph-face (glyph) 208(defun glyph-face (glyph)
211 "Return the face of glyph code GLYPH, or nil if glyph has default face." 209 "Return the face of glyph code GLYPH, or nil if glyph has default face."
212
213 (let ((face-id (if (consp glyph) (cdr glyph) (lsh glyph -22)))) 210 (let ((face-id (if (consp glyph) (cdr glyph) (lsh glyph -22))))
214 (and (> face-id 0) 211 (and (> face-id 0)
215 (car (delq nil (mapcar (lambda (face) 212 (catch 'face
216 (and (eq (get face 'face) face-id) 213 (dolist (face (face-list))
217 face)) 214 (when (eq (face-id face) face-id)
218 (face-list))))))) 215 (throw 'face face)))))))
219 216
220;;;###autoload 217;;;###autoload
221(defun standard-display-european (arg) 218(defun standard-display-european (arg)