1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00

(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.
This commit is contained in:
Stefan Monnier 2025-03-05 18:35:35 -05:00
parent 70d0da3fe0
commit 25de262bd9
2 changed files with 17 additions and 1 deletions

View file

@ -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)