diff options
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/byte-opt.el | 16 | ||||
-rw-r--r-- | lisp/emacs-lisp/edebug.el | 11 | ||||
-rw-r--r-- | lisp/emacs-lisp/lisp-mode.el | 17 | ||||
-rw-r--r-- | lisp/emacs-lisp/lisp.el | 2 |
4 files changed, 33 insertions, 13 deletions
diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index acb882dd9a3..e1aacdd51e9 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el @@ -152,11 +152,11 @@ ;; ;; Associative math should recognize subcalls to identical function: ;; (disassemble (lambda (x) (+ (+ (foo) 1) (+ (bar) 2)))) ;; ;; This should generate the same as (1+ x) and (1- x) - + ;; (disassemble (lambda (x) (cons (+ x 1) (- x 1)))) ;; ;; An awful lot of functions always return a non-nil value. If they're ;; ;; error free also they may act as true-constants. - + ;; (disassemble (lambda (x) (and (point) (foo)))) ;; ;; When ;; ;; - all but one arguments to a function are constant @@ -165,19 +165,19 @@ ;; ;; condition is side-effect-free [assignment-free] then the other ;; ;; arguments may be any expressions. Since, however, the code size ;; ;; can increase this way they should be "simple". Compare: - + ;; (disassemble (lambda (x) (eq (if (point) 'a 'b) 'c))) ;; (disassemble (lambda (x) (if (point) (eq 'a 'c) (eq 'b 'c)))) - + ;; ;; (car (cons A B)) -> (prog1 A B) ;; (disassemble (lambda (x) (car (cons (foo) 42)))) - + ;; ;; (cdr (cons A B)) -> (progn A B) ;; (disassemble (lambda (x) (cdr (cons 42 (foo))))) - + ;; ;; (car (list A B ...)) -> (prog1 A B ...) ;; (disassemble (lambda (x) (car (list (foo) 42 (bar))))) - + ;; ;; (cdr (list A B ...)) -> (progn A (list B ...)) ;; (disassemble (lambda (x) (cdr (list 42 (foo) (bar))))) @@ -1126,7 +1126,7 @@ This assumes that the function will not have any side-effects and that its return value depends solely on its arguments. If the function can signal an error, this might change the semantics -of FORM by signalling the error at compile-time." +of FORM by signaling the error at compile-time." (let ((args (cdr form)) (constant t)) (while (and args constant) diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index e9c767961cd..ebe375088a3 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -511,9 +511,16 @@ the minibuffer." (set-default (nth 1 form) (eval (nth 2 form)))) ((eq (car form) 'defface) ;; Reset the face. - (put (nth 1 form) 'face-defface-spec nil) (setq face-new-frame-defaults - (assq-delete-all (nth 1 form) face-new-frame-defaults)))) + (assq-delete-all (nth 1 form) face-new-frame-defaults)) + (put (nth 1 form) 'face-defface-spec nil) + ;; See comments in `eval-defun-1' for purpose of code below + (setq form (prog1 `(prog1 ,form + (put ',(nth 1 form) 'saved-face + ',(get (nth 1 form) 'saved-face)) + (put ',(nth 1 form) 'customized-face + ',(nth 2 form))) + (put (nth 1 form) 'saved-face nil))))) (setq edebug-result (eval form)) (if (not edebugging) (princ edebug-result) 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))) diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el index 955bc4499bc..a14c4815374 100644 --- a/lisp/emacs-lisp/lisp.el +++ b/lisp/emacs-lisp/lisp.el @@ -489,7 +489,7 @@ More accurately, check the narrowed part of the buffer for unbalanced expressions (\"sexps\") in general. This is done according to the current syntax table and will find unbalanced brackets or quotes as appropriate. (See Info node `(emacs)Parentheses'.) If imbalance is -found, an error is signalled and point is left at the first unbalanced +found, an error is signaled and point is left at the first unbalanced character." (interactive) (condition-case data |