summaryrefslogtreecommitdiff
path: root/lisp/faces.el
diff options
context:
space:
mode:
authorChong Yidong <cyd@gnu.org>2012-01-31 16:38:58 +0800
committerChong Yidong <cyd@gnu.org>2012-01-31 16:38:58 +0800
commitfce3fdeb947e51656675129592c8514be32b46bf (patch)
tree513a00667048d111fd309b587cebcdd5749fa376 /lisp/faces.el
parenta037c17168419db7f5054a3ba080b94b9298c1a9 (diff)
downloademacs-fce3fdeb947e51656675129592c8514be32b46bf.tar.gz
Fix menu-set-font interaction with Custom themes.
In particular, prevent it from setting non-font-related attributes like the foreground and background color. This requires a bugfix to face-spec-reset-face to make "resetting" the default face work. * lisp/faces.el (face-spec-reset-face): Don't apply unspecified attribute values to the default face. * lisp/frame.el (set-frame-font): New arg ALL-FRAMES. * lisp/menu-bar.el (menu-set-font): Use set-frame-font.
Diffstat (limited to 'lisp/faces.el')
-rw-r--r--lisp/faces.el11
1 files changed, 6 insertions, 5 deletions
diff --git a/lisp/faces.el b/lisp/faces.el
index 5d406ad7c0b..cd7f92bfad4 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -1513,11 +1513,12 @@ If SPEC is nil, return nil."
(defun face-spec-reset-face (face &optional frame)
"Reset all attributes of FACE on FRAME to unspecified."
- (let (reset-args)
- (dolist (attr-and-name face-attribute-name-alist)
- (push 'unspecified reset-args)
- (push (car attr-and-name) reset-args))
- (apply 'set-face-attribute face frame reset-args)))
+ (unless (eq face 'default)
+ (let (reset-args)
+ (dolist (attr-and-name face-attribute-name-alist)
+ (push 'unspecified reset-args)
+ (push (car attr-and-name) reset-args))
+ (apply 'set-face-attribute face frame reset-args))))
(defun face-spec-set (face spec &optional for-defface)
"Set FACE's face spec, which controls its appearance, to SPEC.