summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/lisp-mode.el
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>2005-06-24 01:59:52 +0000
committerMiles Bader <miles@gnu.org>2005-06-24 01:59:52 +0000
commit3f0607e49476578a260289a51a84639b1885c161 (patch)
tree076023228279f15587ea24a5a7f9adb499ee969c /lisp/emacs-lisp/lisp-mode.el
parent82cf95134905ffe09000888e86e88c9a400a4468 (diff)
parentff71329437a5195b60799e019871181c916024ff (diff)
downloademacs-3f0607e49476578a260289a51a84639b1885c161.tar.gz
emacs-3f0607e49476578a260289a51a84639b1885c161.tar.bz2
emacs-3f0607e49476578a260289a51a84639b1885c161.zip
Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-65
Merge from emacs--cvs-trunk--0 Patches applied: * emacs--cvs-trunk--0 (patch 425-445) - Remove "-face" suffix from gnus faces - Update from CVS - Remove "-face" suffix from MH-E faces - Remove "-face" suffix from cc-mode faces - Remove "-face" suffix from eshell faces - Remove "-face" suffix from ediff faces - Implement tty vertical-divider face - Rename vertical-divider face to vertical-border - Change escape-glyph color on dark backgrounds back to cyan - Update reference to renamed Buffer-menu-buffer face
Diffstat (limited to 'lisp/emacs-lisp/lisp-mode.el')
-rw-r--r--lisp/emacs-lisp/lisp-mode.el17
1 files changed, 15 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index 72924417109..1ffc33835e9 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -617,10 +617,23 @@ Reinitialize the face according to the `defface' specification."
;; `defface' is macroexpanded to `custom-declare-face'.
((eq (car form) 'custom-declare-face)
;; Reset the face.
- (put (eval (nth 1 form)) 'face-defface-spec nil)
(setq face-new-frame-defaults
(assq-delete-all (eval (nth 1 form)) face-new-frame-defaults))
- form)
+ (put (eval (nth 1 form)) 'face-defface-spec nil)
+ ;; Setting `customized-face' to the new spec after calling
+ ;; the form, but preserving the old saved spec in `saved-face',
+ ;; imitates the situation when the new face spec is set
+ ;; temporarily for the current session in the customize
+ ;; buffer, thus allowing `face-user-default-spec' to use the
+ ;; new customized spec instead of the saved spec.
+ ;; Resetting `saved-face' temporarily to nil is needed to let
+ ;; `defface' change the spec, regardless of a saved spec.
+ (prog1 `(prog1 ,form
+ (put ',(eval (nth 1 form)) 'saved-face
+ ',(get (eval (nth 1 form)) 'saved-face))
+ (put ',(eval (nth 1 form)) 'customized-face
+ ',(eval (nth 2 form))))
+ (put (eval (nth 1 form)) 'saved-face nil)))
((eq (car form) 'progn)
(cons 'progn (mapcar 'eval-defun-1 (cdr form))))
(t form)))