diff options
| author | Juri Linkov | 2021-12-16 21:16:50 +0200 |
|---|---|---|
| committer | Juri Linkov | 2021-12-16 21:16:50 +0200 |
| commit | e726a00381e0f2d8dbfa52a10c82116a8352adf0 (patch) | |
| tree | 729c04844c0b9794564d961e113a21d713bbdc5c /lisp/vc | |
| parent | 0b43e7a49327ce32c67648eb898551002f135ef5 (diff) | |
| download | emacs-e726a00381e0f2d8dbfa52a10c82116a8352adf0.tar.gz emacs-e726a00381e0f2d8dbfa52a10c82116a8352adf0.zip | |
* lisp/vc/vc-dispatcher.el (vc-command-messages): Add choice 'log'.
(vc-do-command): Don't display messages but only write them to the *Messages*
buffer when vc-command-messages is 'log' (bug#52518).
Diffstat (limited to 'lisp/vc')
| -rw-r--r-- | lisp/vc/vc-dispatcher.el | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/lisp/vc/vc-dispatcher.el b/lisp/vc/vc-dispatcher.el index 346974bdba8..f4d280c1463 100644 --- a/lisp/vc/vc-dispatcher.el +++ b/lisp/vc/vc-dispatcher.el | |||
| @@ -127,8 +127,11 @@ preserve the setting." | |||
| 127 | :group 'vc) | 127 | :group 'vc) |
| 128 | 128 | ||
| 129 | (defcustom vc-command-messages nil | 129 | (defcustom vc-command-messages nil |
| 130 | "If non-nil, display run messages from back-end commands." | 130 | "If non-nil, display and log run messages from back-end commands. |
| 131 | :type 'boolean | 131 | If `log', messages are logged to the *Messages* buffer but not displayed." |
| 132 | :type '(choice (const :tag "No messages" nil) | ||
| 133 | (const :tag "Display and log messages" t) | ||
| 134 | (const :tag "Log messages" log)) | ||
| 132 | :group 'vc) | 135 | :group 'vc) |
| 133 | 136 | ||
| 134 | (defcustom vc-suppress-confirm nil | 137 | (defcustom vc-suppress-confirm nil |
| @@ -311,7 +314,10 @@ case, and the process object in the asynchronous case." | |||
| 311 | (substring command 0 -1) | 314 | (substring command 0 -1) |
| 312 | command) | 315 | command) |
| 313 | " " (vc-delistify flags) | 316 | " " (vc-delistify flags) |
| 314 | " " (vc-delistify files)))) | 317 | " " (vc-delistify files))) |
| 318 | (vc-inhibit-message | ||
| 319 | (or (eq vc-command-messages 'log) | ||
| 320 | (eq (selected-window) (active-minibuffer-window))))) | ||
| 315 | (save-current-buffer | 321 | (save-current-buffer |
| 316 | (unless (or (eq buffer t) | 322 | (unless (or (eq buffer t) |
| 317 | (and (stringp buffer) | 323 | (and (stringp buffer) |
| @@ -335,7 +341,7 @@ case, and the process object in the asynchronous case." | |||
| 335 | (apply #'start-file-process command (current-buffer) | 341 | (apply #'start-file-process command (current-buffer) |
| 336 | command squeezed)))) | 342 | command squeezed)))) |
| 337 | (when vc-command-messages | 343 | (when vc-command-messages |
| 338 | (let ((inhibit-message (eq (selected-window) (active-minibuffer-window)))) | 344 | (let ((inhibit-message vc-inhibit-message)) |
| 339 | (message "Running in background: %s" full-command))) | 345 | (message "Running in background: %s" full-command))) |
| 340 | ;; Get rid of the default message insertion, in case we don't | 346 | ;; Get rid of the default message insertion, in case we don't |
| 341 | ;; set a sentinel explicitly. | 347 | ;; set a sentinel explicitly. |
| @@ -345,11 +351,11 @@ case, and the process object in the asynchronous case." | |||
| 345 | (when vc-command-messages | 351 | (when vc-command-messages |
| 346 | (vc-run-delayed | 352 | (vc-run-delayed |
| 347 | (let ((message-truncate-lines t) | 353 | (let ((message-truncate-lines t) |
| 348 | (inhibit-message (eq (selected-window) (active-minibuffer-window)))) | 354 | (inhibit-message vc-inhibit-message)) |
| 349 | (message "Done in background: %s" full-command))))) | 355 | (message "Done in background: %s" full-command))))) |
| 350 | ;; Run synchronously | 356 | ;; Run synchronously |
| 351 | (when vc-command-messages | 357 | (when vc-command-messages |
| 352 | (let ((inhibit-message (eq (selected-window) (active-minibuffer-window)))) | 358 | (let ((inhibit-message vc-inhibit-message)) |
| 353 | (message "Running in foreground: %s" full-command))) | 359 | (message "Running in foreground: %s" full-command))) |
| 354 | (let ((buffer-undo-list t)) | 360 | (let ((buffer-undo-list t)) |
| 355 | (setq status (apply #'process-file command nil t nil squeezed))) | 361 | (setq status (apply #'process-file command nil t nil squeezed))) |
| @@ -364,7 +370,7 @@ case, and the process object in the asynchronous case." | |||
| 364 | (if (integerp status) (format "status %d" status) status) | 370 | (if (integerp status) (format "status %d" status) status) |
| 365 | full-command)) | 371 | full-command)) |
| 366 | (when vc-command-messages | 372 | (when vc-command-messages |
| 367 | (let ((inhibit-message (eq (selected-window) (active-minibuffer-window)))) | 373 | (let ((inhibit-message vc-inhibit-message)) |
| 368 | (message "Done (status=%d): %s" status full-command))))) | 374 | (message "Done (status=%d): %s" status full-command))))) |
| 369 | (vc-run-delayed | 375 | (vc-run-delayed |
| 370 | (run-hook-with-args 'vc-post-command-functions | 376 | (run-hook-with-args 'vc-post-command-functions |