changeset 10170:5fc240a3e4a0

(face-initialize): Test for framep not t or nil. (set-face-font): Pass `default' as face to x-resolve-font-name. (x-resolve-font-name): Better error message when FACE doesn't specify the font.
author Richard M. Stallman <rms@gnu.org>
date Thu, 15 Dec 1994 13:49:51 +0000
parents 04425b872c5b
children 3c022e99daab
files lisp/faces.el
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/faces.el	Thu Dec 15 12:36:03 1994 +0000
+++ b/lisp/faces.el	Thu Dec 15 13:49:51 1994 +0000
@@ -109,7 +109,7 @@
 If the optional FRAME argument is provided, change only
 in that frame; otherwise change each frame."
   (interactive (internal-face-interactive "font"))
-  (if (stringp font) (setq font (x-resolve-font-name font face frame)))
+  (if (stringp font) (setq font (x-resolve-font-name font 'default frame)))
   (internal-set-face-1 face 'font font 3 frame))
 
 (defun set-face-foreground (face color &optional frame)
@@ -520,8 +520,8 @@
 All wildcards in PATTERN become substantiated.
 If PATTERN is nil, return the name of the frame's base font, which never
 contains wildcards.
-Given optional arguments FACE and FRAME, try to return a font which is
-also the same size as FACE on FRAME."
+Given optional arguments FACE and FRAME, return a font which is
+also the same size as FACE on FRAME, or fail."
   (or (symbolp face)
       (setq face (face-name face)))
   (and (eq frame t)
@@ -532,7 +532,9 @@
 	(or fonts
 	    (if face
 		(error "No fonts matching pattern are the same size as `%s'"
-		       face)
+		       (if (null (face-font face))
+			   (cdr (assq 'font (frame-parameters frame)))
+			 face))
 	      (error "No fonts match `%s'" pattern)))
 	(car fonts))
     (cdr (assq 'font (frame-parameters (selected-frame))))))
@@ -867,7 +869,7 @@
 
   (let ((frames (frame-list)))
     (while frames
-      (if (framep (car frames))
+      (if (not (memq (framep (car frames)) '(t nil)))
 	  (let ((frame (car frames))
 		(rest global-face-data))
 	    (while rest