From 3e7257c3ed3e7f5451d4dab0b222f93a2d1b2aa3 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Fri, 25 Mar 2022 16:44:01 +0100 Subject: [PATCH] Improve pp-last-sexp ergonomics * lisp/emacs-lisp/pp.el (pp-last-sexp): Ignore ,@? before a sexp, because eval-ing that will always lead to an error (bug#54537). --- lisp/emacs-lisp/pp.el | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lisp/emacs-lisp/pp.el b/lisp/emacs-lisp/pp.el index e782cdb1dab..ad693fa5a61 100644 --- a/lisp/emacs-lisp/pp.el +++ b/lisp/emacs-lisp/pp.el @@ -177,6 +177,10 @@ Also add the value to the front of the list in the variable `values'." (let ((pt (point))) (save-excursion (forward-sexp -1) + ;; Make `pp-eval-last-sexp' work the same way `eval-last-sexp' + ;; does. + (when (looking-at ",@?") + (goto-char (match-end 0))) (read ;; If first line is commented, ignore all leading comments: (if (save-excursion (beginning-of-line) (looking-at-p "[ \t]*;")) -- 2.39.5