From 01d4effe81aa809fdab0c483371bf15356cc4c43 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Fri, 6 Jul 2007 17:30:06 +0000 Subject: (eval-last-sexp): Avoid introducing any dynamic bindings around the evaluation of the expression. --- lisp/emacs-lisp/lisp-mode.el | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'lisp/emacs-lisp/lisp-mode.el') diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 164756dfdc3..73379a816d7 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -628,13 +628,13 @@ this command arranges for all errors to enter the debugger." (interactive "P") (if (null eval-expression-debug-on-error) (eval-last-sexp-1 eval-last-sexp-arg-internal) - (let ((old-value eval-last-sexp-fake-value) new-value value) - (let ((debug-on-error old-value)) - (setq value (eval-last-sexp-1 eval-last-sexp-arg-internal)) - (setq new-value debug-on-error)) - (unless (eq old-value new-value) - (setq debug-on-error new-value)) - value))) + (let ((value + (let ((debug-on-error eval-last-sexp-fake-value)) + (cons (eval-last-sexp-1 eval-last-sexp-arg-internal) + debug-on-error)))) + (unless (eq (cdr value) eval-last-sexp-fake-value) + (setq debug-on-error (cdr value))) + (car value)))) (defun eval-defun-1 (form) "Treat some expressions specially. -- cgit v1.2.3 From c40e86ef0a28ef43d849f39c1bb0d76bc43932bb Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Tue, 10 Jul 2007 01:07:09 +0000 Subject: (eval-defun): Explain special handling of `defface'. --- lisp/ChangeLog | 5 +++++ lisp/emacs-lisp/lisp-mode.el | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'lisp/emacs-lisp/lisp-mode.el') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 87e471753e5..dcdb04cc5fa 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-07-10 Richard Stallman + + * emacs-lisp/lisp-mode.el (eval-defun): + Explain special handling of `defface'. + 2007-07-09 Richard Stallman * isearch.el (isearch-edit-string): Call to isearch-push-state diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 73379a816d7..374d3ae2327 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -730,7 +730,9 @@ If the current defun is actually a call to `defvar' or `defcustom', evaluating it this way resets the variable using its initial value expression even if the variable already has some other value. \(Normally `defvar' and `defcustom' do not alter the value if there -already is one.) +already is one.) In an analogous way, evaluating a `defface' +overrides any customizations of the face, so that it becomes +defined exactly as the `defface' expression says. If `eval-expression-debug-on-error' is non-nil, which is the default, this command arranges for all errors to enter the debugger. -- cgit v1.2.3