From eba0f091d9c1a2cffc45d11c6b3f0814901e4d0b Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 14 Aug 2023 23:01:12 -0400 Subject: [PATCH] * lisp/emacs-lisp/pp.el (pp-fill): Fix bug#65159 --- lisp/emacs-lisp/pp.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/emacs-lisp/pp.el b/lisp/emacs-lisp/pp.el index 550fab2f4b3..95ad222cc4d 100644 --- a/lisp/emacs-lisp/pp.el +++ b/lisp/emacs-lisp/pp.el @@ -226,8 +226,10 @@ it inserts and pretty-prints that arg at point." (if (eq lif 'defun) (setq lif 2)) (when (natnump lif) (goto-char (match-end 0)) - (forward-sexp lif) - (funcall newline))))) + ;; Do nothing if there aren't enough args. + (ignore-error scan-error + (forward-sexp lif) + (funcall newline)))))) (save-excursion (pp-fill (1+ paired) (1- (point))))) ;; Now the sexp either ends beyond `fill-column' or is -- 2.39.2