]> git.eshelyaron.com Git - emacs.git/commitdiff
pp--insert-lisp: Don't bug out on certain forms at beginning of buffer
authorVisuwesh <visuweshm@gmail.com>
Sat, 28 May 2022 10:54:32 +0000 (12:54 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Sat, 28 May 2022 16:39:43 +0000 (18:39 +0200)
* pp.el (pp--insert): Check if point is in beginning of buffer before
calling `looking-back' (bug#55677).

lisp/emacs-lisp/pp.el

index 3c849c2d01bde2ee10a2138f2225646b3e32487d..a3ff2ecbaa694e5510be6ff42e4d35e453672319 100644 (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)))))))