mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-30 04:10:54 -08:00
Fix printing the result by 'eval-print-last-sexp'
* lisp/progmodes/elisp-mode.el (elisp--eval-last-sexp): Record the desired output stream before evaluating the expression. (Bug#70931)
This commit is contained in:
parent
be03dda5b0
commit
82a31e27e6
1 changed files with 10 additions and 7 deletions
|
|
@ -1557,13 +1557,16 @@ character)."
|
|||
(pcase-let*
|
||||
((`(,insert-value ,no-truncate ,char-print-limit)
|
||||
(eval-expression-get-print-arguments eval-last-sexp-arg-internal)))
|
||||
;; Setup the lexical environment if lexical-binding is enabled.
|
||||
(elisp--eval-last-sexp-print-value
|
||||
(eval (macroexpand-all
|
||||
(eval-sexp-add-defvars
|
||||
(elisp--eval-defun-1 (macroexpand (elisp--preceding-sexp)))))
|
||||
lexical-binding)
|
||||
(if insert-value (current-buffer) t) no-truncate char-print-limit)))
|
||||
;; The expression might change to a different buffer, so record the
|
||||
;; desired output stream now.
|
||||
(let ((output (if insert-value (current-buffer) t)))
|
||||
;; Setup the lexical environment if lexical-binding is enabled.
|
||||
(elisp--eval-last-sexp-print-value
|
||||
(eval (macroexpand-all
|
||||
(eval-sexp-add-defvars
|
||||
(elisp--eval-defun-1 (macroexpand (elisp--preceding-sexp)))))
|
||||
lexical-binding)
|
||||
output no-truncate char-print-limit))))
|
||||
|
||||
(defun elisp--eval-last-sexp-print-value
|
||||
(value output &optional no-truncate char-print-limit)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue