emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r104991: * emacs-lisp/lisp-mode.el (e


From: Lars Magne Ingebrigtsen
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r104991: * emacs-lisp/lisp-mode.el (eval-defun-1): Update the documentation
Date: Wed, 06 Jul 2011 18:46:27 +0200
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 104991
fixes bug(s): http://debbugs.gnu.org/8378
committer: Lars Magne Ingebrigtsen <address@hidden>
branch nick: trunk
timestamp: Wed 2011-07-06 18:46:27 +0200
message:
  * 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.
modified:
  lisp/ChangeLog
  lisp/emacs-lisp/lisp-mode.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-07-06 16:44:33 +0000
+++ b/lisp/ChangeLog    2011-07-06 16:46:27 +0000
@@ -10,6 +10,10 @@
 
 2011-07-06  Lars Magne Ingebrigtsen  <address@hidden>
 
+       * emacs-lisp/lisp-mode.el (eval-defun-1): Update the documentation
+       of faces when `M-C-x'-ing their definitions (bug#8378).  Also
+       clean up the code slightly.
+
        * progmodes/grep.el (rgrep): Don't bind `process-connection-type',
        because that makes the colours go away.
 

=== modified file 'lisp/emacs-lisp/lisp-mode.el'
--- a/lisp/emacs-lisp/lisp-mode.el      2011-07-05 18:26:33 +0000
+++ b/lisp/emacs-lisp/lisp-mode.el      2011-07-06 16:46:27 +0000
@@ -789,25 +789,25 @@
        ;; `defface' is macroexpanded to `custom-declare-face'.
        ((eq (car form) 'custom-declare-face)
         ;; Reset the face.
-        (setq face-new-frame-defaults
-              (assq-delete-all (eval (nth 1 form) lexical-binding)
-                                face-new-frame-defaults))
-        (put (eval (nth 1 form) lexical-binding) '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 ,(nth 1 form) 'saved-face
-                       ',(get (eval (nth 1 form) lexical-binding)
-                               'saved-face))
-                  (put ,(nth 1 form) 'customized-face
-                       ,(nth 2 form)))
-          (put (eval (nth 1 form) lexical-binding) 'saved-face nil)))
+        (let ((face-symbol (eval (nth 1 form) lexical-binding)))
+          (setq face-new-frame-defaults
+                (assq-delete-all face-symbol face-new-frame-defaults))
+          (put face-symbol 'face-defface-spec nil)
+          (put face-symbol 'face-documentation (nth 3 form))
+          ;; 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 ,(nth 1 form) 'saved-face
+                         ',(get face-symbol 'saved-face))
+                    (put ,(nth 1 form) 'customized-face
+                         ,(nth 2 form)))
+            (put face-symbol 'saved-face nil))))
        ((eq (car form) 'progn)
         (cons 'progn (mapcar 'eval-defun-1 (cdr form))))
        (t form)))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]