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 DIFF-FUNCTION)

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. DIFF-FUNCTION is log-edit-diff-function for the Log Edit buffer.

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 diff-function)
  "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.
DIFF-FUNCTION is `log-edit-diff-function' for the Log Edit buffer."
  (let ((parent (or (and (length= files 1)
                         (not (vc-dispatcher-browsing))
                         (get-file-buffer (car files)))
                    (current-buffer)))
        (immediate (and comment (not initial-contents))))
    (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))
    (let (;; `log-edit-hook' is usually for things like
          ;; `log-edit-show-files' and `log-edit-maybe-show-diff' which
          ;; don't make sense if the user is not going to do any
          ;; editing, and can cause unexpected window layout changes.
          (log-edit-hook (and (not immediate)
                              (require 'log-edit) log-edit-hook)))
      (vc-log-edit files mode backend diff-function))
    (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 immediate
        (vc-finish-logentry (eq comment t))
      (message (substitute-command-keys
                  "%s  Type \\<log-edit-mode-map>\\[log-edit-done] when done")
                 msg))))