]> code.delx.au - gnu-emacs/blobdiff - lisp/faces.el
Load byte-run and format a little earlier.
[gnu-emacs] / lisp / faces.el
index 58b984ce876057fe3288b9670c321d88cc50b086..e4a10a115e1d848f9cd661310f0deabaa32ae68a 100644 (file)
@@ -149,7 +149,8 @@ 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 (or (query-fontset font)
+      (setq font (or (and (not (eq window-system 'w32))
+                         (resolve-fontset-name font))
                     (x-resolve-font-name font 'default frame))))
   (internal-set-face-1 face 'font font 3 frame)
   ;; Record that this face's font was set explicitly, not automatically,
@@ -164,9 +165,8 @@ 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 (or (and (fontset-name-p font)
-                         (or (query-fontset font)
-                             (instantiate-fontset font)))
+      (setq font (or (and (not (eq window-system 'w32))
+                         (resolve-fontset-name font))
                     (x-resolve-font-name font 'default frame))))
   (internal-set-face-1 face 'font font 3 frame))
 
@@ -1345,6 +1345,19 @@ If FRAME is nil, the current FRAME is used."
          ;; Put the geometry parameters at the end.
          ;; Copy default-frame-alist so that they go after it.
          (setq parameters (append parameters default-frame-alist parsed)))))
+
+  (if default-enable-multibyte-characters
+      ;; If an ASCII font is specified in PARAMETERS, we try to create
+      ;; a fontset from it, and use it for the new frame.
+      (condition-case nil
+         (let ((font (cdr (assq 'font parameters))))
+           (if (and font
+                    (not (query-fontset font)))
+               (setq parameters
+                     (cons (cons 'font (create-fontset-from-ascii-font font))
+                           parameters))))
+       (error nil)))
+
   (let (frame)
     (if (null global-face-data)
        (progn
@@ -1432,6 +1445,10 @@ Set this to the symbol dark if your background color is dark, light if
 your background is light, or nil (default) if you want Emacs to
 examine the brightness for you."
   :group 'faces
+  :set #'(lambda (var value)
+          (set var value)
+          (mapcar 'frame-set-background-mode (frame-list)))
+  :initialize 'custom-initialize-changed
   :type '(choice (choice-item dark) 
                 (choice-item light)
                 (choice-item :tag "default" nil)))
@@ -1470,6 +1487,7 @@ examine the brightness for you."
 ;; This applies only to faces with global color specifications
 ;; that are not simple constants.
 (defun frame-update-face-colors (frame)
+  (frame-set-background-mode frame)
   (let ((faces global-face-data))
     (while faces
       (condition-case nil