diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2025-03-05 18:35:35 -0500 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2025-03-05 18:35:35 -0500 |
commit | 25de262bd95b587beb757e1a82828ad4fffbf168 (patch) | |
tree | eaf9a36778e8dc0cbabd0461012add1694c37368 /lisp/emacs-lisp | |
parent | 70d0da3fe0b73f7a8757a155feb5efa52e2a1c3a (diff) | |
download | emacs-25de262bd95b587beb757e1a82828ad4fffbf168.tar.gz emacs-25de262bd95b587beb757e1a82828ad4fffbf168.tar.bz2 emacs-25de262bd95b587beb757e1a82828ad4fffbf168.zip |
(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.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/pp.el | 9 |
1 files changed, 8 insertions, 1 deletions
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) |