Mercurial > emacs
comparison lisp/emacs-lisp/lisp-mode.el @ 78073:36ddacf0d44b
(eval-last-sexp): Avoid introducing any
dynamic bindings around the evaluation of the expression.
author | Andreas Schwab <schwab@suse.de> |
---|---|
date | Fri, 06 Jul 2007 17:29:51 +0000 |
parents | def0f242e449 |
children | 8e308ce2d884 988f1edc9674 |
comparison
equal
deleted
inserted
replaced
78072:51ee6159fec2 | 78073:36ddacf0d44b |
---|---|
626 If `eval-expression-debug-on-error' is non-nil, which is the default, | 626 If `eval-expression-debug-on-error' is non-nil, which is the default, |
627 this command arranges for all errors to enter the debugger." | 627 this command arranges for all errors to enter the debugger." |
628 (interactive "P") | 628 (interactive "P") |
629 (if (null eval-expression-debug-on-error) | 629 (if (null eval-expression-debug-on-error) |
630 (eval-last-sexp-1 eval-last-sexp-arg-internal) | 630 (eval-last-sexp-1 eval-last-sexp-arg-internal) |
631 (let ((old-value eval-last-sexp-fake-value) new-value value) | 631 (let ((value |
632 (let ((debug-on-error old-value)) | 632 (let ((debug-on-error eval-last-sexp-fake-value)) |
633 (setq value (eval-last-sexp-1 eval-last-sexp-arg-internal)) | 633 (cons (eval-last-sexp-1 eval-last-sexp-arg-internal) |
634 (setq new-value debug-on-error)) | 634 debug-on-error)))) |
635 (unless (eq old-value new-value) | 635 (unless (eq (cdr value) eval-last-sexp-fake-value) |
636 (setq debug-on-error new-value)) | 636 (setq debug-on-error (cdr value))) |
637 value))) | 637 (car value)))) |
638 | 638 |
639 (defun eval-defun-1 (form) | 639 (defun eval-defun-1 (form) |
640 "Treat some expressions specially. | 640 "Treat some expressions specially. |
641 Reset the `defvar' and `defcustom' variables to the initial value. | 641 Reset the `defvar' and `defcustom' variables to the initial value. |
642 Reinitialize the face according to the `defface' specification." | 642 Reinitialize the face according to the `defface' specification." |