1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-28 16:21:07 -08:00

pp--insert-lisp: Don't bug out on certain forms at beginning of buffer

* pp.el (pp--insert): Check if point is in beginning of buffer before
calling `looking-back' (bug#55677).
This commit is contained in:
Visuwesh 2022-05-28 12:54:32 +02:00 committed by Lars Ingebrigtsen
parent 2301f13a67
commit 5d8b6ba89e

View file

@ -382,7 +382,7 @@ Use the `pp-max-width' variable to control the desired line length."
(when (> (current-column) (pp--max-width))
(condition-case ()
(backward-up-list 1)
(:success (when (looking-back " " 2)
(:success (when (and (not (bobp)) (looking-back " " 2))
(insert "\n")))
(error nil)))))))