changeset 81148:afd58ab52ea7

(face-id): If the argument is a face alias, return the ID of the target face.
author Juanma Barranquero <lekktu@gmail.com>
date Tue, 05 Jun 2007 10:12:37 +0000
parents 5dc66a0c09c9
children 22520110f809
files lisp/faces.el
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/faces.el	Tue Jun 05 10:06:19 2007 +0000
+++ b/lisp/faces.el	Tue Jun 05 10:12:37 2007 +0000
@@ -222,11 +222,12 @@
 
 (defun face-id (face &optional frame)
   "Return the internal ID of face with name FACE.
+If FACE is a face-alias, return the ID of the target face.
 The optional argument FRAME is ignored, since the internal face ID
 of a face name is the same for all frames."
   (check-face face)
-  (get face 'face))
-
+  (or (get face 'face)
+      (face-id (get face 'face-alias))))
 
 (defun face-equal (face1 face2 &optional frame)
   "Non-nil if faces FACE1 and FACE2 are equal.