From 25de262bd95b587beb757e1a82828ad4fffbf168 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 5 Mar 2025 18:35:35 -0500 Subject: (pp-fill): Fix bug#76715 * lisp/emacs-lisp/pp.el (pp-fill): Don't break before `.` within symbols. * test/lisp/emacs-lisp/pp-tests.el (pp-tests--bug76715): New test. --- lisp/emacs-lisp/pp.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/pp.el b/lisp/emacs-lisp/pp.el index 3e75807f757..c183f442d8d 100644 --- a/lisp/emacs-lisp/pp.el +++ b/lisp/emacs-lisp/pp.el @@ -208,7 +208,14 @@ it inserts and pretty-prints that arg at point." (while (progn (funcall avoid-unbreakable) - (not (zerop (skip-chars-backward " \t({[',."))))) + (let ((pos (point))) + (skip-chars-backward " \t({[',.") + (while (and (memq (char-after) '(?\. ?\{)) + (not (memq (char-before) + '(nil ?\n ?\) \" ?\])))) + ;; `.' and `{' within symbols? (Bug#76715) + (forward-char 1)) + (not (eql pos (point)))))) (if (bolp) ;; The sexp already starts on its own line. (progn (goto-char beg) nil) -- cgit v1.2.3