aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Whitton2024-10-17 21:06:58 +0800
committerSean Whitton2024-10-17 21:24:17 +0800
commit8d7d9dd42a6c2bf1f941108148d9df91bce857fa (patch)
treea4227ab376b6842c9be1bc2cd29c7adfd32e018b
parent01c8f31a54df511913ad88cb6138a01390faafbe (diff)
downloademacs-8d7d9dd42a6c2bf1f941108148d9df91bce857fa.tar.gz
emacs-8d7d9dd42a6c2bf1f941108148d9df91bce857fa.zip
log-view-modify-change-comment: Prepend Summary header
* lisp/vc/log-view.el (log-edit): Require. (log-view-modify-change-comment): When log-edit-hook would insert an empty Summary header, prepend one to the old comment.
-rw-r--r--lisp/vc/log-view.el12
1 files changed, 12 insertions, 0 deletions
diff --git a/lisp/vc/log-view.el b/lisp/vc/log-view.el
index 0533af62343..647a7dc569f 100644
--- a/lisp/vc/log-view.el
+++ b/lisp/vc/log-view.el
@@ -111,6 +111,7 @@
111 111
112(require 'pcvs-util) 112(require 'pcvs-util)
113(require 'easy-mmode) 113(require 'easy-mmode)
114(require 'log-edit)
114(autoload 'vc-find-revision "vc") 115(autoload 'vc-find-revision "vc")
115(autoload 'vc-diff-internal "vc") 116(autoload 'vc-diff-internal "vc")
116 117
@@ -553,6 +554,17 @@ If called interactively, visit the version at point."
553 (vc-call-backend log-view-vc-backend 554 (vc-call-backend log-view-vc-backend
554 'get-change-comment files rev) 555 'get-change-comment files rev)
555 (vc-not-supported (log-view-extract-comment))))) 556 (vc-not-supported (log-view-extract-comment)))))
557 (when (memq 'log-edit-insert-message-template log-edit-hook)
558 (let* ((first-newline (string-match "\n" comment))
559 (summary (substring comment 0 first-newline))
560 (rest (and first-newline
561 (substring comment (1+ first-newline)))))
562 (setq comment
563 ;; As we are part of the VC subsystem I think we are
564 ;; entitled to call a \\`log-edit--' function.
565 ;; --spwhitton
566 (concat (log-edit--make-header-line "Summary" summary)
567 (if (length> rest 0) rest "\n")))))
556 (vc-modify-change-comment files rev comment))) 568 (vc-modify-change-comment files rev comment)))
557 569
558(defun log-view-annotate-version (pos) 570(defun log-view-annotate-version (pos)