From: Visuwesh Date: Sat, 28 May 2022 10:54:32 +0000 (+0200) Subject: pp--insert-lisp: Don't bug out on certain forms at beginning of buffer X-Git-Tag: emacs-29.0.90~1910^2~365 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5d8b6ba89efdcddfd0189da77dd4099283466a05;p=emacs.git 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). --- diff --git a/lisp/emacs-lisp/pp.el b/lisp/emacs-lisp/pp.el index 3c849c2d01b..a3ff2ecbaa6 100644 --- a/lisp/emacs-lisp/pp.el +++ b/lisp/emacs-lisp/pp.el @@ -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)))))))