(zerop (forward-line 1))))
(eobp))))
+(defun log-edit--make-header-line (header &optional value)
+ ;; Make \\`C-a' work like it does in other buffers with header names.
+ (concat (propertize (concat header ": ")
+ 'field 'header
+ 'rear-nonsticky t)
+ value
+ "\n"))
+
(defun log-edit-insert-message-template ()
"Insert the default VC commit log template with Summary and Author."
(interactive)
(log-edit-empty-buffer-p))
(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 (log-edit--make-header-line header)))
(insert "\n")
(message-position-point)))
clear it. Make sure there is an empty line after the headers.
Return t if toggled on (or TOGGLE is nil), otherwise nil."
(let ((val t)
- (line (concat header ": " value "\n")))
+ (line (log-edit--make-header-line header value)))
(save-excursion
(save-restriction
(rfc822-goto-eoh)