Handle filling of indented ChangeLog function entries
* lisp/vc/log-edit.el (log-edit-fill-entry): Relax regexp a bit to recognize function entries with leading blanks. * test/lisp/vc/log-edit-tests.el: New test.
This commit is contained in:
parent
7e78f0d1b2
commit
f8607d3c03
2 changed files with 26 additions and 1 deletions
|
@ -529,7 +529,7 @@ according to `fill-column'."
|
||||||
(and (< beg end)
|
(and (< beg end)
|
||||||
(re-search-forward
|
(re-search-forward
|
||||||
(concat "\\(?1:" change-log-unindented-file-names-re
|
(concat "\\(?1:" change-log-unindented-file-names-re
|
||||||
"\\)\\|^\\(?1:\\)(")
|
"\\)\\|^\\(?1:\\)[[:blank:]]*(")
|
||||||
end t)
|
end t)
|
||||||
(copy-marker (match-end 1)))
|
(copy-marker (match-end 1)))
|
||||||
;; Fill prose between log entries.
|
;; Fill prose between log entries.
|
||||||
|
|
|
@ -74,6 +74,31 @@ couple of sentences. Long enough to be
|
||||||
filled for several lines.
|
filled for several lines.
|
||||||
\(fun9): Etc."))))
|
\(fun9): Etc."))))
|
||||||
|
|
||||||
|
(ert-deftest log-edit-fill-entry-indented-func-entries ()
|
||||||
|
;; Indenting function entries is a typical mistake caused by using a
|
||||||
|
;; misconfigured or non-ChangeLog specific fill function.
|
||||||
|
(with-temp-buffer
|
||||||
|
(insert "\
|
||||||
|
* dir/file.ext (fun1):
|
||||||
|
(fun2):
|
||||||
|
(fun3):
|
||||||
|
* file2.txt (fun4):
|
||||||
|
(fun5):
|
||||||
|
(fun6):
|
||||||
|
(fun7): Some prose.
|
||||||
|
(fun8): A longer description of a complicated change.\
|
||||||
|
Spread over a couple of sentences.\
|
||||||
|
Long enough to be filled for several lines.
|
||||||
|
(fun9): Etc.")
|
||||||
|
(goto-char (point-min))
|
||||||
|
(let ((fill-column 72)) (log-edit-fill-entry))
|
||||||
|
(should (equal (buffer-string) "\
|
||||||
|
* dir/file.ext (fun1, fun2, fun3):
|
||||||
|
* file2.txt (fun4, fun5, fun6, fun7): Some prose.
|
||||||
|
\(fun8): A longer description of a complicated change. Spread over a
|
||||||
|
couple of sentences. Long enough to be filled for several lines.
|
||||||
|
\(fun9): Etc."))))
|
||||||
|
|
||||||
(ert-deftest log-edit-fill-entry-trailing-prose ()
|
(ert-deftest log-edit-fill-entry-trailing-prose ()
|
||||||
(with-temp-buffer
|
(with-temp-buffer
|
||||||
(insert "\
|
(insert "\
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue