From 2f3cf7ffe3c9ce986caf6d093b880fed6046b7ec Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Tue, 10 May 2022 17:05:22 +0200 Subject: [PATCH] Use fields on log-edit headers (which changes `C-a' behaviour) * 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 | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lisp/vc/log-edit.el b/lisp/vc/log-edit.el index 79dafe60cc2..e958673fea8 100644 --- a/lisp/vc/log-edit.el +++ b/lisp/vc/log-edit.el @@ -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 () -- 2.39.2