From: Lars Ingebrigtsen Date: Fri, 25 Mar 2022 15:44:01 +0000 (+0100) Subject: Improve pp-last-sexp ergonomics X-Git-Tag: emacs-29.0.90~1931^2~920 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3e7257c3ed3e7f5451d4dab0b222f93a2d1b2aa3;p=emacs.git 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). --- 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]*;"))