]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve how change-log-mode fills all-file-name lines
authorLars Ingebrigtsen <larsi@gnus.org>
Tue, 25 Jan 2022 13:55:26 +0000 (14:55 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Tue, 25 Jan 2022 22:41:07 +0000 (23:41 +0100)
* lisp/vc/add-log.el (change-log-fill-file-list): New function to
improve how we fill all-file-name ChangeLog lines (bug#19341).
(change-log-indent): Use it.

lisp/vc/add-log.el

index e9a21825e1816f0640060f39fbbaff70e7232843..beaad2e835f413809e3cbbbe78a1068d9ab85217 100644 (file)
@@ -1068,8 +1068,23 @@ the change log file in another window."
            (insert-before-markers "("))
        (error nil)))))
 
+;; If we're filling a line that has a whole bunch of file names, and
+;; we're still in the file names, then transform this so that it'll
+;; still font-lock properly.
+(defun change-log-fill-file-list ()
+  (save-excursion
+    (unless (bobp)
+      (forward-line -1)
+      (when (looking-at change-log-file-names-re)
+        (goto-char (match-end 0))
+        (while (looking-at "\\=, \\([^ ,:([\n]+\\)")
+          (goto-char (match-end 0)))
+        (when (looking-at ", *\n")
+          (replace-match ":\n *" t t))))))
+
 (defun change-log-indent ()
   (change-log-fill-parenthesized-list)
+  (change-log-fill-file-list)
   (let* ((indent
          (save-excursion
            (beginning-of-line)