changeset 6563:15c92359800c

(vc-checkin): Insert name of current defun in comment buffer.
author Roland McGrath <roland@gnu.org>
date Tue, 29 Mar 1994 00:03:10 +0000
parents 0541a368505c
children d9652e184eec
files lisp/vc.el
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/vc.el	Mon Mar 28 23:57:28 1994 +0000
+++ b/lisp/vc.el	Tue Mar 29 00:03:10 1994 +0000
@@ -605,8 +605,15 @@
 permissions zeroed, or deleted (according to the value of `vc-keep-workfiles').
 COMMENT is a comment string; if omitted, a buffer is
 popped up to accept a comment."
-  (setq vc-log-after-operation-hook 'vc-checkin-hook)
-  (vc-start-entry file rev comment "Enter a change comment." 'vc-backend-checkin))
+  ;; If we will pop up a buffer to edit the comment, and we are in a buffer
+  ;; on the file being checked in, insert a default header into the comment
+  ;; buffer based on the defun point is currently in.
+  (let ((defun (and (null comment) (string= file buffer-file-name)
+		    (add-log-current-defun))))
+    (setq vc-log-after-operation-hook 'vc-checkin-hook)
+    (prog1 (vc-start-entry file rev comment "Enter a change comment."
+			   'vc-backend-checkin)
+      (if defun (insert "(" defun "): ")))))
 
 ;;; Here is a checkin hook that may prove useful to sites using the
 ;;; ChangeLog facility supported by Emacs.