mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 10:30:25 -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:
parent
70d0da3fe0
commit
25de262bd9
2 changed files with 17 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -85,4 +85,13 @@
|
|||
(signal (car err) (cdr err))
|
||||
))))))))
|
||||
|
||||
(ert-deftest pp-tests--bug76715 ()
|
||||
(with-temp-buffer
|
||||
(let ((pp-default-function #'pp-fill)
|
||||
(fill-column 8)
|
||||
(val '(x. y{ z. a{ b. x. y{ z. a{ b.)))
|
||||
(pp val (current-buffer))
|
||||
(goto-char (point-min))
|
||||
(should (equal (read (current-buffer)) val)))))
|
||||
|
||||
;;; pp-tests.el ends here.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue