From a5f26395c8f5dc7b7c0f30bdd8877fbfe3d7c51f Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 27 Jun 2024 14:39:27 -0400 Subject: [PATCH] (eval-last-sexp): Fix bug#71774 * lisp/progmodes/elisp-mode.el (eval-last-sexp): Set `values` only when `eval-expression-debug-on-error` is nil. (cherry picked from commit bf8c9f702ba7cba8f835996d49cad01865e2813e) --- lisp/progmodes/elisp-mode.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index a8bb45a4dce..b365a0adb2b 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -1632,7 +1632,10 @@ integer value is also printed as a character of that codepoint. If `eval-expression-debug-on-error' is non-nil, which is the default, this command arranges for all errors to enter the debugger." (interactive "P") - (values--store-value + (funcall + ;; Not sure why commit 4428c27c1ae7d stored into `values' only when + ;; `eval-expression-debug-on-error' was nil, but let's preserve that. + (if eval-expression-debug-on-error #'identity #'values--store-value) (handler-bind ((error (if eval-expression-debug-on-error #'eval-expression--debug #'ignore))) (elisp--eval-last-sexp eval-last-sexp-arg-internal)))) -- 2.39.2