changeset 10584:f79a6ab2d0bd

(facep): New function. (internal-check-face): Don't make a loop, since signal can't return.
author Richard M. Stallman <rms@gnu.org>
date Sat, 28 Jan 1995 08:27:31 +0000
parents 6736693cb8c8
children eb798bab393d
files lisp/faces.el
diffstat 1 files changed, 17 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/faces.el	Sat Jan 28 04:15:03 1995 +0000
+++ b/lisp/faces.el	Sat Jan 28 08:27:31 1995 +0000
@@ -49,9 +49,15 @@
 (defsubst internal-facep (x)
   (and (vectorp x) (= (length x) 8) (eq (aref x 0) 'face)))
 
+(defun facep (x)
+  "Return t if X is a face name or an internal face vector."
+  (and (or (internal-facep x)
+	   (and (symbolp x) (assq x global-face-data)))
+       t))
+      
 (defmacro internal-check-face (face)
-  (` (while (not (internal-facep (, face)))
-       (setq (, face) (signal 'wrong-type-argument (list 'internal-facep (, face)))))))
+  (` (or (internal-facep (, face))
+	 (signal 'wrong-type-argument (list 'internal-facep (, face))))))
 
 ;;; Accessors.
 (defun face-name (face)
@@ -547,10 +553,15 @@
       (let ((fonts (x-list-fonts pattern face frame)))
 	(or fonts
 	    (if face
-		(error "No fonts matching pattern are the same size as `%s'"
-		       (if (null (face-font face))
-			   (cdr (assq 'font (frame-parameters frame)))
-			 face))
+		(if (string-match "\\*" pattern)
+		    (if (null (face-font face))
+			(error "No matching fonts are the same height as the frame default font")
+		      (error "No matching fonts are the same height as face `%s'" face))
+		  (if (null (face-font face))
+		      (error "Height of font `%s' doesn't match the frame default font"
+			     pattern)
+		    (error "Height of font `%s' doesn't match face `%s'"
+			   pattern face)))
 	      (error "No fonts match `%s'" pattern)))
 	(car fonts))
     (cdr (assq 'font (frame-parameters (selected-frame))))))