]> git.eshelyaron.com Git - emacs.git/commit
Update `fill-region-as-paragraph-semlf' to follow fill.el protocols
authorRoi Martin <jroi.martin@gmail.com>
Tue, 17 Jun 2025 17:21:18 +0000 (19:21 +0200)
committerEshel Yaron <me@eshelyaron.com>
Wed, 23 Jul 2025 20:10:05 +0000 (22:10 +0200)
commit4730c54e946068aafbe200cd2702f4b411c581aa
tree919255ccfc031e57393fe66a3e243ff293ec28db
parentdca73f686b76b832cb582e6564baa4b43fd51e5a
Update `fill-region-as-paragraph-semlf' to follow fill.el protocols

Update the `fill-region-as-paragraph-semlf' function to follow the
`fill-region-as-paragraph-function' protocol.  This allows us to
reimplement the `fill-paragraph-semlf' function using `fill-paragraph'
and `fill-region-as-paragraph-function'.
* lisp/textmodes/fill.el (fill-region-as-paragraph-semlf): Make this
function compatible with `fill-region-as-paragraph-function'.  Avoid
narrowing.
(fill-paragraph-semlf): Reimplement using `fill-paragraph' and
`fill-region-as-paragraph-function'.
* test/lisp/textmodes/fill-tests.el (fill-test-semlf-fill-region): Add
test.
(fill-test-fill-paragraph-semlf-fill-paragraph-function): Remove test.
(fill-test-fill-paragraph-semlf, fill-test-semlf)
(fill-test-fill-paragraph-semlf-justify, fill-test-semlf-justify)
(fill-test-fill-paragraph-semlf-sentence-end-double-space)
(fill-test-semlf-sentence-end-double-space)
(fill-test-fill-paragraph-semlf-fill-column, fill-test-semlf-fill-column)
(fill-test-fill-paragraph-semlf-punctuation-marks)
(fill-test-semlf-punctuation-marks, fill-test-fill-paragraph-semlf-twice)
(fill-test-semlf-twice, fill-test-fill-paragraph-semlf-fill-prefix)
(fill-test-semlf-fill-prefix)
(fill-test-fill-paragraph-semlf-indented-block)
(fill-test-semlf-indented-block, fill-test-fill-paragraph-semlf-revert)
(fill-test-semlf-revert, fill-test-fill-paragraph-semlf-emacs-lisp-mode)
(fill-test-semlf-emacs-lisp-mode, fill-test-fill-paragraph-semlf-c-mode)
(fill-test-semlf-c-mode, fill-test-fill-paragraph-semlf-org-mode)
(fill-test-semlf-org-mode, fill-test-fill-paragraph-semlf-markdown-mode)
(fill-test-semlf-markdown-mode): User shorter function names consistent
with erts file names.
* test/lisp/textmodes/fill-resources/semlf-fill-region.erts: Add test
data.
* test/lisp/textmodes/fill-resources/semlf-fill-paragraph-function.erts:
Delete file.
* test/lisp/textmodes/fill-resources/semlf-emacs-lisp-mode.erts: Remove
newlines around indented block.
* doc/lispref/text.texi (Filling): Highlight that
`fill-region-as-paragraph-function' changes the behavior of
`fill-paragraph'.

(cherry picked from commit 0ac21120cf12f151c7505d7b18601d533ea7f931)
doc/lispref/text.texi
lisp/textmodes/fill.el
test/lisp/textmodes/fill-resources/semlf-emacs-lisp-mode.erts
test/lisp/textmodes/fill-resources/semlf-fill-paragraph-function.erts [deleted file]
test/lisp/textmodes/fill-resources/semlf-fill-region.erts [new file with mode: 0644]
test/lisp/textmodes/fill-tests.el