Mercurial > emacs
changeset 27302:1cb6c18c3163
(eval-expression): Don't bind debug-on-error if
eval-expression-debug-on-error is nil. Detect changed
debug-on-error, and propagate new value to global binding, if
eval-expression-debug-on-error is non-nil,
(eval-expression-debug-on-error): Change doc string.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Wed, 12 Jan 2000 13:06:52 +0000 |
parents | 8c79b30d8475 |
children | 6af9b684a1a0 |
files | lisp/simple.el |
diffstat | 1 files changed, 16 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/simple.el Wed Jan 12 05:22:30 2000 +0000 +++ b/lisp/simple.el Wed Jan 12 13:06:52 2000 +0000 @@ -554,7 +554,8 @@ :version "21.1") (defcustom eval-expression-debug-on-error t - "*Value to use for `debug-on-error' when evaluating in `eval-expression'." + "*Non-nil means set `debug-on-error' when evaluating in `eval-expression'. +If nil, don't change the value of `debug-on-error'." :group 'lisp :type 'boolean :version "21.1") @@ -570,8 +571,20 @@ nil read-expression-map t 'read-expression-history) current-prefix-arg)) - (let ((debug-on-error eval-expression-debug-on-error)) - (setq values (cons (eval eval-expression-arg) values))) + + (if (null eval-expression-debug-on-error) + (setq values (cons (eval eval-expression-arg) values)) + (let ((old-value (make-symbol "t")) new-value) + ;; Bind debug-on-error to something unique so that we can + ;; detect when evaled code changes it. + (let ((debug-on-error old-value)) + (setq values (cons (eval eval-expression-arg) values)) + (setq new-value debug-on-error)) + ;; If evaled code has changed the value of debug-on-error, + ;; propagate that change to the global binding. + (unless (eq old-value new-value) + (setq debug-on-error new-value)))) + (let ((print-length eval-expression-print-length) (print-level eval-expression-print-level)) (prin1 (car values)