]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve pp-last-sexp ergonomics
authorLars Ingebrigtsen <larsi@gnus.org>
Fri, 25 Mar 2022 15:44:01 +0000 (16:44 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Fri, 25 Mar 2022 15:44:30 +0000 (16:44 +0100)
* 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

index e782cdb1dab1c361a79a3209f2b0ac5de2f0b8ea..ad693fa5a61258f91f148d3b131872404898f5b2 100644 (file)
@@ -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]*;"))