From 5d8b6ba89efdcddfd0189da77dd4099283466a05 Mon Sep 17 00:00:00 2001 From: Visuwesh Date: Sat, 28 May 2022 12:54:32 +0200 Subject: [PATCH] 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). --- lisp/emacs-lisp/pp.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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))))))) -- 2.39.2