From: Roland McGrath Date: Tue, 29 Mar 1994 00:03:10 +0000 (+0000) Subject: (vc-checkin): Insert name of current defun in comment buffer. X-Git-Tag: emacs-19.34~9289 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=32eff0b035c0b8857f34ca2dcb0282e5e385765f;p=emacs.git (vc-checkin): Insert name of current defun in comment buffer. --- diff --git a/lisp/vc.el b/lisp/vc.el index c3ed06b89bc..b6a2731b522 100644 --- a/lisp/vc.el +++ b/lisp/vc.el @@ -605,8 +605,15 @@ The optional argument REV may be a string specifying the new version level 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.