mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-06-14 04:21:24 +00:00
* 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.
37 lines
843 B
Text
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
|
|
|
|
=-=-=
|