Function: vc-start-logentry
vc-start-logentry is a byte-compiled function defined in
vc-dispatcher.el.gz.
Signature
(vc-start-logentry FILES COMMENT INITIAL-CONTENTS MSG LOGBUF MODE ACTION &optional AFTER-HOOK BACKEND PATCH-STRING)
Documentation
Accept a comment for an operation on FILES.
If COMMENT is nil, pop up a LOGBUF buffer, emit MSG, and set the
action on close to ACTION. If COMMENT is a string and
INITIAL-CONTENTS is non-nil, then COMMENT is used as the initial
contents of the log entry buffer. If COMMENT is a string and
INITIAL-CONTENTS is nil, do action immediately as if the user had
entered COMMENT. If COMMENT is t, also do action immediately with an
empty comment. Remember the file's buffer in vc-parent-buffer
(current one if no file). Puts the log-entry buffer in major mode
MODE, defaulting to log-edit-mode if MODE is nil.
AFTER-HOOK specifies the local value for vc-log-after-operation-hook.
BACKEND, if non-nil, specifies a VC backend for the Log Edit buffer.
PATCH-STRING is a patch to check in.
Source Code
;; Defined in /usr/src/emacs/lisp/vc/vc-dispatcher.el.gz
(defun vc-start-logentry (files comment initial-contents msg logbuf mode action &optional after-hook backend patch-string)
"Accept a comment for an operation on FILES.
If COMMENT is nil, pop up a LOGBUF buffer, emit MSG, and set the
action on close to ACTION. If COMMENT is a string and
INITIAL-CONTENTS is non-nil, then COMMENT is used as the initial
contents of the log entry buffer. If COMMENT is a string and
INITIAL-CONTENTS is nil, do action immediately as if the user had
entered COMMENT. If COMMENT is t, also do action immediately with an
empty comment. Remember the file's buffer in `vc-parent-buffer'
\(current one if no file). Puts the log-entry buffer in major mode
MODE, defaulting to `log-edit-mode' if MODE is nil.
AFTER-HOOK specifies the local value for `vc-log-after-operation-hook'.
BACKEND, if non-nil, specifies a VC backend for the Log Edit buffer.
PATCH-STRING is a patch to check in."
(let ((parent
(if (vc-dispatcher-browsing)
;; If we are called from a directory browser, the parent buffer is
;; the current buffer.
(current-buffer)
(if (and files (equal (length files) 1))
(get-file-buffer (car files))
(current-buffer)))))
(if (and comment (not initial-contents))
(set-buffer (get-buffer-create logbuf))
(pop-to-buffer (get-buffer-create logbuf)))
(setq-local vc-parent-buffer parent)
(setq-local vc-parent-buffer-name
(concat " from " (buffer-name vc-parent-buffer)))
(when patch-string
(setq-local vc-patch-string patch-string))
(vc-log-edit files mode backend)
(make-local-variable 'vc-log-after-operation-hook)
(when after-hook
(setq vc-log-after-operation-hook after-hook))
(setq-local vc-log-operation action)
(when comment
(erase-buffer)
(when (stringp comment) (insert comment)))
(if (or (not comment) initial-contents)
(message (substitute-command-keys
(if (eq major-mode 'log-edit-mode)
"%s Type \\[log-edit-done] when done"
"%s Type \\`C-c C-c' when done"))
msg)
(vc-finish-logentry (eq comment t)))))