aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Magne Ingebrigtsen2011-07-06 18:46:27 +0200
committerLars Magne Ingebrigtsen2011-07-06 18:46:27 +0200
commitf4f7319875f9502424804f56e2a12cd620b51c12 (patch)
treee90985be3807f34cfc3085057bd05aa80aedcf8a
parentaa8a705c161b87c5ff6f61b7d8041efb6918f46e (diff)
downloademacs-f4f7319875f9502424804f56e2a12cd620b51c12.tar.gz
emacs-f4f7319875f9502424804f56e2a12cd620b51c12.zip
* emacs-lisp/lisp-mode.el (eval-defun-1): Update the documentation
of faces when `M-C-x'-ing their definitions. Also clean up the code slightly. Fixes: debbugs:8378
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/emacs-lisp/lisp-mode.el38
2 files changed, 23 insertions, 19 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 080f9494996..a2b389f4fe4 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -10,6 +10,10 @@
10 10
112011-07-06 Lars Magne Ingebrigtsen <larsi@gnus.org> 112011-07-06 Lars Magne Ingebrigtsen <larsi@gnus.org>
12 12
13 * emacs-lisp/lisp-mode.el (eval-defun-1): Update the documentation
14 of faces when `M-C-x'-ing their definitions (bug#8378). Also
15 clean up the code slightly.
16
13 * progmodes/grep.el (rgrep): Don't bind `process-connection-type', 17 * progmodes/grep.el (rgrep): Don't bind `process-connection-type',
14 because that makes the colours go away. 18 because that makes the colours go away.
15 19
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index 32f67a173f9..c8620aaa439 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -789,25 +789,25 @@ Reinitialize the face according to the `defface' specification."
789 ;; `defface' is macroexpanded to `custom-declare-face'. 789 ;; `defface' is macroexpanded to `custom-declare-face'.
790 ((eq (car form) 'custom-declare-face) 790 ((eq (car form) 'custom-declare-face)
791 ;; Reset the face. 791 ;; Reset the face.
792 (setq face-new-frame-defaults 792 (let ((face-symbol (eval (nth 1 form) lexical-binding)))
793 (assq-delete-all (eval (nth 1 form) lexical-binding) 793 (setq face-new-frame-defaults
794 face-new-frame-defaults)) 794 (assq-delete-all face-symbol face-new-frame-defaults))
795 (put (eval (nth 1 form) lexical-binding) 'face-defface-spec nil) 795 (put face-symbol 'face-defface-spec nil)
796 ;; Setting `customized-face' to the new spec after calling 796 (put face-symbol 'face-documentation (nth 3 form))
797 ;; the form, but preserving the old saved spec in `saved-face', 797 ;; Setting `customized-face' to the new spec after calling
798 ;; imitates the situation when the new face spec is set 798 ;; the form, but preserving the old saved spec in `saved-face',
799 ;; temporarily for the current session in the customize 799 ;; imitates the situation when the new face spec is set
800 ;; buffer, thus allowing `face-user-default-spec' to use the 800 ;; temporarily for the current session in the customize
801 ;; new customized spec instead of the saved spec. 801 ;; buffer, thus allowing `face-user-default-spec' to use the
802 ;; Resetting `saved-face' temporarily to nil is needed to let 802 ;; new customized spec instead of the saved spec.
803 ;; `defface' change the spec, regardless of a saved spec. 803 ;; Resetting `saved-face' temporarily to nil is needed to let
804 (prog1 `(prog1 ,form 804 ;; `defface' change the spec, regardless of a saved spec.
805 (put ,(nth 1 form) 'saved-face 805 (prog1 `(prog1 ,form
806 ',(get (eval (nth 1 form) lexical-binding) 806 (put ,(nth 1 form) 'saved-face
807 'saved-face)) 807 ',(get face-symbol 'saved-face))
808 (put ,(nth 1 form) 'customized-face 808 (put ,(nth 1 form) 'customized-face
809 ,(nth 2 form))) 809 ,(nth 2 form)))
810 (put (eval (nth 1 form) lexical-binding) 'saved-face nil))) 810 (put face-symbol 'saved-face nil))))
811 ((eq (car form) 'progn) 811 ((eq (car form) 'progn)
812 (cons 'progn (mapcar 'eval-defun-1 (cdr form)))) 812 (cons 'progn (mapcar 'eval-defun-1 (cdr form))))
813 (t form))) 813 (t form)))