[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 89519d0932: Make `C-M-x' use the original value of print-length w
From: |
Lars Ingebrigtsen |
Subject: |
master 89519d0932: Make `C-M-x' use the original value of print-length while evalling |
Date: |
Wed, 27 Apr 2022 14:04:53 -0400 (EDT) |
branch: master
commit 89519d0932b3f2961dfc74b9f945c3a5a21e70fd
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>
Make `C-M-x' use the original value of print-length while evalling
* lisp/progmodes/elisp-mode.el (elisp--eval-defun): Eval the form
with the original values of print-level and print-length
(bug#135).
---
lisp/progmodes/elisp-mode.el | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el
index 33f6902491..a4088fa467 100644
--- a/lisp/progmodes/elisp-mode.el
+++ b/lisp/progmodes/elisp-mode.el
@@ -1614,8 +1614,6 @@ Return the result of evaluation."
;; printing, not while evaluating.
(defvar elisp--eval-defun-result)
(let ((debug-on-error eval-expression-debug-on-error)
- (print-length eval-expression-print-length)
- (print-level eval-expression-print-level)
elisp--eval-defun-result)
(save-excursion
;; Arrange for eval-region to "read" the (possibly) altered form.
@@ -1630,10 +1628,17 @@ Return the result of evaluation."
(setq beg (point))
(setq form (funcall load-read-function (current-buffer)))
(setq end (point)))
- ;; Alter the form if necessary.
- (let ((form (eval-sexp-add-defvars
- (elisp--eval-defun-1
- (macroexpand form)))))
+ ;; Alter the form if necessary. We bind `print-level' (etc.)
+ ;; in the form itself, because we want evalling the form to
+ ;; use the original values, while we want the printing to use
+ ;; `eval-expression-print-length' (etc.).
+ (let ((form `(let ((print-level ,print-level)
+ (print-length ,print-length))
+ ,(eval-sexp-add-defvars
+ (elisp--eval-defun-1
+ (macroexpand form)))))
+ (print-length eval-expression-print-length)
+ (print-level eval-expression-print-level))
(eval-region beg end standard-output
(lambda (_ignore)
;; Skipping to the end of the specified region
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 89519d0932: Make `C-M-x' use the original value of print-length while evalling,
Lars Ingebrigtsen <=