emacs/test/lisp/textmodes/fill-resources/fill-paragraph-handle-comment.erts
Juri Linkov 2e70b88623 Fix fill-paragraph combining text with preceding comment
* lisp/textmodes/fill.el (fill-paragraph): Handle the case
when a non-comment line follows a comment line with
non-nil 'fill-paragraph-handle-comment' (bug#80449).
Skip such a comment line before filling a non-comment line.

* test/lisp/textmodes/fill-tests.el
(fill-test-fill-paragraph-handle-comment): Add new test.

* test/lisp/textmodes/fill-resources/fill-paragraph-handle-comment.erts:
New file.
2026-05-27 18:32:40 +03:00

37 lines
843 B
Text

Point-Char: |
Name: fill-paragraph-handle-comment - non-comment line before comment line
Code:
(lambda ()
(setq-local comment-start "# ")
(setq-local fill-paragraph-handle-comment t)
(setq-local fill-column 42)
(fill-paragraph))
=-=
this is not part of the comment this is not part of the comment|
# this is a comment this is a comment this is a comment
=-=
this is not part of the comment this is
not part of the comment
# this is a comment this is a comment this is a comment
=-=-=
Name: fill-paragraph-handle-comment - non-comment line after comment line
=-=
# this is a comment this is a comment this is a comment
this is not part of the comment this is not part of the comment|
=-=
# this is a comment this is a comment this is a comment
this is not part of the comment this is
not part of the comment
=-=-=