summaryrefslogtreecommitdiff
path: root/lisp/vc/vc-dispatcher.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/vc/vc-dispatcher.el')
-rw-r--r--lisp/vc/vc-dispatcher.el58
1 files changed, 32 insertions, 26 deletions
diff --git a/lisp/vc/vc-dispatcher.el b/lisp/vc/vc-dispatcher.el
index a55954467e0..e2a490092b5 100644
--- a/lisp/vc/vc-dispatcher.el
+++ b/lisp/vc/vc-dispatcher.el
@@ -127,8 +127,12 @@ preserve the setting."
:group 'vc)
(defcustom vc-command-messages nil
- "If non-nil, display run messages from back-end commands."
- :type 'boolean
+ "If non-nil, display and log messages about running back-end commands.
+If the value is `log', messages about running VC back-end commands are
+logged in the *Messages* buffer, but not displayed."
+ :type '(choice (const :tag "No messages" nil)
+ (const :tag "Display and log messages" t)
+ (const :tag "Log messages, but don't display" log))
:group 'vc)
(defcustom vc-suppress-confirm nil
@@ -311,7 +315,10 @@ case, and the process object in the asynchronous case."
(substring command 0 -1)
command)
" " (vc-delistify flags)
- " " (vc-delistify files))))
+ " " (vc-delistify files)))
+ (vc-inhibit-message
+ (or (eq vc-command-messages 'log)
+ (eq (selected-window) (active-minibuffer-window)))))
(save-current-buffer
(unless (or (eq buffer t)
(and (stringp buffer)
@@ -335,7 +342,7 @@ case, and the process object in the asynchronous case."
(apply #'start-file-process command (current-buffer)
command squeezed))))
(when vc-command-messages
- (let ((inhibit-message (eq (selected-window) (active-minibuffer-window))))
+ (let ((inhibit-message vc-inhibit-message))
(message "Running in background: %s" full-command)))
;; Get rid of the default message insertion, in case we don't
;; set a sentinel explicitly.
@@ -345,11 +352,11 @@ case, and the process object in the asynchronous case."
(when vc-command-messages
(vc-run-delayed
(let ((message-truncate-lines t)
- (inhibit-message (eq (selected-window) (active-minibuffer-window))))
+ (inhibit-message vc-inhibit-message))
(message "Done in background: %s" full-command)))))
;; Run synchronously
(when vc-command-messages
- (let ((inhibit-message (eq (selected-window) (active-minibuffer-window))))
+ (let ((inhibit-message vc-inhibit-message))
(message "Running in foreground: %s" full-command)))
(let ((buffer-undo-list t))
(setq status (apply #'process-file command nil t nil squeezed)))
@@ -364,7 +371,7 @@ case, and the process object in the asynchronous case."
(if (integerp status) (format "status %d" status) status)
full-command))
(when vc-command-messages
- (let ((inhibit-message (eq (selected-window) (active-minibuffer-window))))
+ (let ((inhibit-message vc-inhibit-message))
(message "Done (status=%d): %s" status full-command)))))
(vc-run-delayed
(run-hook-with-args 'vc-post-command-functions
@@ -629,23 +636,23 @@ NOT-URGENT means it is ok to continue if the user says not to save."
(and (local-variable-p 'vc-log-fileset)
(not (equal vc-log-fileset fileset))))
`((log-edit-listfun
- . (lambda ()
- ;; FIXME: When fileset includes directories, and
- ;; there are relevant ChangeLog files inside their
- ;; children, we don't find them. Either handle it
- ;; in `log-edit-insert-changelog-entries' by
- ;; walking down the file trees, or somehow pass
- ;; `fileset-only-files' from `vc-next-action'
- ;; through to this function.
- (let ((root (vc-root-dir)))
- ;; Returns paths relative to the root, so that
- ;; `log-edit-changelog-insert-entries'
- ;; substitutes them in correctly later, even when
- ;; `vc-checkin' was called from a file buffer, or
- ;; a non-root VC-Dir buffer.
- (mapcar
- (lambda (file) (file-relative-name file root))
- ',fileset))))
+ . ,(lambda ()
+ ;; FIXME: When fileset includes directories, and
+ ;; there are relevant ChangeLog files inside their
+ ;; children, we don't find them. Either handle it
+ ;; in `log-edit-insert-changelog-entries' by
+ ;; walking down the file trees, or somehow pass
+ ;; `fileset-only-files' from `vc-next-action'
+ ;; through to this function.
+ (let ((root (vc-root-dir)))
+ ;; Returns paths relative to the root, so that
+ ;; `log-edit-changelog-insert-entries'
+ ;; substitutes them in correctly later, even when
+ ;; `vc-checkin' was called from a file buffer, or
+ ;; a non-root VC-Dir buffer.
+ (mapcar
+ (lambda (file) (file-relative-name file root))
+ fileset))))
(log-edit-diff-function . vc-diff)
(log-edit-vc-backend . ,backend)
(vc-log-fileset . ,fileset))
@@ -754,8 +761,7 @@ the buffer contents as a comment."
;; (while (and (not member) fileset)
;; (let ((elem (pop fileset)))
;; (if (if (file-directory-p elem)
-;; (eq t (compare-strings buffer-file-name nil (length elem)
-;; elem nil nil))
+;; (string-prefix-p elem buffer-file-name)
;; (eq (current-buffer) (get-file-buffer elem)))
;; (setq member t))))
;; member))