]> code.delx.au - gnu-emacs/blobdiff - lisp/faces.el
(mark): Doc fix.
[gnu-emacs] / lisp / faces.el
index ee6033214602067f8db087631f383eec0fb34aa4..b19159020c0f3744cd7ad9eec7f080b1d1f185b6 100644 (file)
@@ -85,8 +85,8 @@ Otherwise report on the defaults for face FACE (for new frames)."
 If the optional FRAME argument is provided, change only
 in that frame; otherwise change each frame."
   (interactive (internal-face-interactive "font"))
-  (internal-set-face-1 face 'font (x-resolve-font-name font face frame)
-                      3 frame))
+  (if (stringp font) (setq font (x-resolve-font-name font face frame)))
+  (internal-set-face-1 face 'font font 3 frame))
 
 (defsubst set-face-foreground (face color &optional frame)
   "Change the foreground color of face FACE to COLOR (a string).
@@ -416,15 +416,23 @@ set its foreground and background to the default background and foreground."
 (defun x-resolve-font-name (pattern &optional face frame)
   "Return a font name matching PATTERN.
 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,"
-  (let ((fonts (x-list-fonts pattern face frame)))
-    (or fonts
-       (if face
-           (error "no fonts match `%S'." pattern)
-         (error "no fonts matching pattern are the same size as `%s'."
-                pattern face)))
-    (car fonts)))
+also the same size as FACE on FRAME."
+  (or (symbolp face)
+      (setq face (face-name face)))
+  (and (eq frame t)
+       (setq frame nil))
+  (if pattern
+      (let ((fonts (x-list-fonts pattern face frame)))
+       (or fonts
+           (if face
+               (error "No fonts matching pattern are the same size as `%s'"
+                      face)
+             (error "No fonts match `%s'" pattern)))
+       (car fonts))
+    (cdr (assq 'font (frame-parameters (selected-frame))))))
 
 (defun x-frob-font-weight (font which)
   (if (or (string-match x-font-regexp font)
@@ -739,7 +747,9 @@ If NOERROR is non-nil, return nil on failure."
       (set-frame-face-alist frame faces)
 
       (if (cdr (or (assq 'reverse parameters)
-                  (assq 'reverse default-frame-alist)))
+                  (assq 'reverse default-frame-alist)
+                  (cons nil
+                        (x-get-resource "reverseVideo" "Reversevideo"))))
          (let ((params (frame-parameters frame)))
            (modify-frame-parameters
             frame