]> git.eshelyaron.com Git - emacs.git/commit
lisp: Introduce a `lisp-fill-paragraph-as-displayed' variable.
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>
Tue, 21 Jan 2025 02:50:44 +0000 (11:50 +0900)
committerEshel Yaron <me@eshelyaron.com>
Sat, 25 Jan 2025 17:49:00 +0000 (18:49 +0100)
commitba0f17d1b9991a09004e21e5c7e720ff58d94d54
tree1215609128d72842e193710b019e366183b8783e
parentaa33e6358c344d232cf1a11f8d40752e606796a1
lisp: Introduce a `lisp-fill-paragraph-as-displayed' variable.

Starting with Emacs 28, filling strings now happens in a
narrowed scope, and looses the leading indentation and can cause
the string to extend past the fill-column value.  Introduce
`lisp-fill-paragraph-as-displayed' as a new variable allowing
opting out of this new behavior in specific scenarios (such as
when using the Scheme major mode, say).

* lisp/emacs-lisp/lisp-mode.el
(lisp-fill-paragraph-as-displayed): New variable.
(lisp-fill-paragraph): Honor it, by avoiding the logic narrow to
strings before applying fill-paragraph.
* test/lisp/emacs-lisp/lisp-mode-tests.el
(lisp-fill-paragraph-respects-fill-column): Test it.
(lisp-fill-paragraph-docstring-boundaries): New test, as a
safeguard to avoid regressions.

Fixes: bug#56197
(cherry picked from commit 192355e54af91ad6e7d1343071a749e1ced29400)
lisp/emacs-lisp/lisp-mode.el
test/lisp/emacs-lisp/lisp-mode-tests.el