aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/faces.el23
2 files changed, 22 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index e338a6d2ebf..12488b0cd52 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12012-03-04 Chong Yidong <cyd@gnu.org>
2
3 * faces.el (face-spec-reset-face): For the default face, reset the
4 attributes to default values (Bug#10748).
5
12012-03-04 Lars Magne Ingebrigtsen <larsi@gnus.org> 62012-03-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
2 7
3 * mail/emacsbug.el (report-emacs-bug-hook): Fix up thinko in 8 * mail/emacsbug.el (report-emacs-bug-hook): Fix up thinko in
diff --git a/lisp/faces.el b/lisp/faces.el
index cd7f92bfad4..0011e0357a1 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -1513,12 +1513,23 @@ If SPEC is nil, return nil."
1513 1513
1514(defun face-spec-reset-face (face &optional frame) 1514(defun face-spec-reset-face (face &optional frame)
1515 "Reset all attributes of FACE on FRAME to unspecified." 1515 "Reset all attributes of FACE on FRAME to unspecified."
1516 (unless (eq face 'default) 1516 (apply 'set-face-attribute face frame
1517 (let (reset-args) 1517 (if (eq face 'default)
1518 (dolist (attr-and-name face-attribute-name-alist) 1518 ;; For the default face, avoid making any attribute
1519 (push 'unspecified reset-args) 1519 ;; unspecifed. Instead, set attributes to default values
1520 (push (car attr-and-name) reset-args)) 1520 ;; (see also realize_default_face in xfaces.c).
1521 (apply 'set-face-attribute face frame reset-args)))) 1521 (append
1522 '(:underline nil :overline nil :strike-through nil
1523 :box nil :inverse-video nil :stipple nil :inherit nil)
1524 (unless (display-graphic-p frame)
1525 '(:family "default" :foundry "default" :width normal
1526 :height 1 :weight normal :slant normal
1527 :foreground "unspecified-fg"
1528 :background "unspecified-bg")))
1529 ;; For all other faces, unspecify all attributes.
1530 (apply 'append
1531 (mapcar (lambda (x) (list (car x) 'unspecified))
1532 face-attribute-name-alist)))))
1522 1533
1523(defun face-spec-set (face spec &optional for-defface) 1534(defun face-spec-set (face spec &optional for-defface)
1524 "Set FACE's face spec, which controls its appearance, to SPEC. 1535 "Set FACE's face spec, which controls its appearance, to SPEC.