diff options
author | Juri Linkov <juri@jurta.org> | 2005-06-21 15:59:33 +0000 |
---|---|---|
committer | Juri Linkov <juri@jurta.org> | 2005-06-21 15:59:33 +0000 |
commit | a416b8923fb063c3a04bac2a84842cee29516ec6 (patch) | |
tree | 07823104a3b574bf43d90fc341943fb07d3b31b4 /lisp/emacs-lisp/lisp-mode.el | |
parent | e44d251c0d57f0cb1c8850e0cb6fcab8e38316d5 (diff) | |
download | emacs-a416b8923fb063c3a04bac2a84842cee29516ec6.tar.gz emacs-a416b8923fb063c3a04bac2a84842cee29516ec6.tar.bz2 emacs-a416b8923fb063c3a04bac2a84842cee29516ec6.zip |
(eval-defun-1):
Set `saved-face' temporarily to nil before calling form.
Set `customized-face' to the new spec after that.
Diffstat (limited to 'lisp/emacs-lisp/lisp-mode.el')
-rw-r--r-- | lisp/emacs-lisp/lisp-mode.el | 17 |
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))) |