]> git.eshelyaron.com Git - emacs.git/commitdiff
Use fields on log-edit headers (which changes `C-a' behaviour)
authorLars Ingebrigtsen <larsi@gnus.org>
Tue, 10 May 2022 15:05:22 +0000 (17:05 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Tue, 10 May 2022 15:05:22 +0000 (17:05 +0200)
* lisp/vc/log-edit.el (log-edit-insert-message-template): Fieldify
headers so that `C-a' takes us to the start of the string, not the
line (bug#15645).

lisp/vc/log-edit.el

index 79dafe60cc2c06c9052b54fc4d7f58fa8e3dff61..e958673fea8ff0c8ff3d8a940d06227c74f32235 100644 (file)
@@ -710,10 +710,14 @@ different header separator appropriate for `log-edit-mode'."
   (interactive)
   (when (or (called-interactively-p 'interactive)
             (log-edit-empty-buffer-p))
-    (insert "Summary: ")
-    (when log-edit-setup-add-author
-      (insert "\nAuthor: "))
-    (insert "\n\n")
+    (dolist (header (append '("Summary") (and log-edit-setup-add-author
+                                              '("Author"))))
+      ;; Make `C-a' work like in other buffers with header names.
+      (insert (propertize (concat header ": ")
+                          'field 'header
+                          'rear-nonsticky t)
+              "\n"))
+    (insert "\n")
     (message-position-point)))
 
 (defun log-edit-insert-cvs-template ()