comparison lisp/vc.el @ 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 36e1485fa93b
children 3a0db3b2366c
comparison
equal deleted inserted replaced
6562:0541a368505c 6563:15c92359800c
603 The optional argument REV may be a string specifying the new version level 603 The optional argument REV may be a string specifying the new version level
604 \(if nil increment the current level). The file is either retained with write 604 \(if nil increment the current level). The file is either retained with write
605 permissions zeroed, or deleted (according to the value of `vc-keep-workfiles'). 605 permissions zeroed, or deleted (according to the value of `vc-keep-workfiles').
606 COMMENT is a comment string; if omitted, a buffer is 606 COMMENT is a comment string; if omitted, a buffer is
607 popped up to accept a comment." 607 popped up to accept a comment."
608 (setq vc-log-after-operation-hook 'vc-checkin-hook) 608 ;; If we will pop up a buffer to edit the comment, and we are in a buffer
609 (vc-start-entry file rev comment "Enter a change comment." 'vc-backend-checkin)) 609 ;; on the file being checked in, insert a default header into the comment
610 ;; buffer based on the defun point is currently in.
611 (let ((defun (and (null comment) (string= file buffer-file-name)
612 (add-log-current-defun))))
613 (setq vc-log-after-operation-hook 'vc-checkin-hook)
614 (prog1 (vc-start-entry file rev comment "Enter a change comment."
615 'vc-backend-checkin)
616 (if defun (insert "(" defun "): ")))))
610 617
611 ;;; Here is a checkin hook that may prove useful to sites using the 618 ;;; Here is a checkin hook that may prove useful to sites using the
612 ;;; ChangeLog facility supported by Emacs. 619 ;;; ChangeLog facility supported by Emacs.
613 (defun vc-comment-to-change-log (&optional whoami file-name) 620 (defun vc-comment-to-change-log (&optional whoami file-name)
614 "Enter last VC comment into change log file for current buffer's file. 621 "Enter last VC comment into change log file for current buffer's file.