aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAugusto Stoffel2024-04-14 09:36:05 +0200
committerStefan Monnier2024-04-17 17:02:11 -0400
commit3cdd86b8affa6d58de8f6d07b4e117676fedd58c (patch)
tree40fa0c272e0c633461125bc75ca0c06c0b5571fe
parent0dbd9ed04660152276696e462359204a45ca933d (diff)
downloademacs-3cdd86b8affa6d58de8f6d07b4e117676fedd58c.tar.gz
emacs-3cdd86b8affa6d58de8f6d07b4e117676fedd58c.zip
Propagate 'lexical-binding' value to pp buffers
See bug#70137. * lisp/emacs-lisp/pp.el (pp-display-expression): Set lexical-binding to match the value in the calling buffer.
-rw-r--r--lisp/emacs-lisp/pp.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/pp.el b/lisp/emacs-lisp/pp.el
index d586fc59939..f89807c37be 100644
--- a/lisp/emacs-lisp/pp.el
+++ b/lisp/emacs-lisp/pp.el
@@ -327,7 +327,8 @@ If LISP, format with `pp-emacs-lisp-code'; use `pp' otherwise.
327 327
328If a temporary buffer is needed for representation, it will be named 328If a temporary buffer is needed for representation, it will be named
329after OUT-BUFFER-NAME." 329after OUT-BUFFER-NAME."
330 (let* ((old-show-function temp-buffer-show-function) 330 (let* ((lexical lexical-binding)
331 (old-show-function temp-buffer-show-function)
331 ;; Use this function to display the buffer. 332 ;; Use this function to display the buffer.
332 ;; This function either decides not to display it at all 333 ;; This function either decides not to display it at all
333 ;; or displays it in the usual way. 334 ;; or displays it in the usual way.
@@ -357,6 +358,7 @@ after OUT-BUFFER-NAME."
357 (pp expression)) 358 (pp expression))
358 (with-current-buffer standard-output 359 (with-current-buffer standard-output
359 (emacs-lisp-mode) 360 (emacs-lisp-mode)
361 (setq lexical-binding lexical)
360 (setq buffer-read-only nil) 362 (setq buffer-read-only nil)
361 (setq-local font-lock-verbose nil))))) 363 (setq-local font-lock-verbose nil)))))
362 364