summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-01-29 06:50:38 +0100
committerLars Ingebrigtsen <larsi@gnus.org>2021-01-29 07:04:47 +0100
commit5f650422e4a4c44ffc5ee0be4ec969765a307c7b (patch)
tree3f5812242097e2ecb13ae020e119ab4c1fb1b97a
parentde51d94721efb90b153d70dc15691c16d0fbb46a (diff)
downloademacs-5f650422e4a4c44ffc5ee0be4ec969765a307c7b.tar.gz
Set revert-buffer-function in shell command output buffers
* simple.el (shell-command, shell-command-on-region): Set revert-buffer-function in shell command output buffers (bug#46151).
-rw-r--r--lisp/simple.el6
1 files changed, 6 insertions, 0 deletions
diff --git a/lisp/simple.el b/lisp/simple.el
index e82b138b0da..64ee0421356 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -3991,6 +3991,9 @@ impose the use of a shell (with its need to quote arguments)."
(start-process-shell-command "Shell" buffer command)))
(setq mode-line-process '(":%s"))
(shell-mode)
+ (setq revert-buffer-function
+ (lambda (&rest _)
+ (async-shell-command command (current-buffer))))
(set-process-sentinel proc #'shell-command-sentinel)
;; Use the comint filter for proper handling of
;; carriage motion (see comint-inhibit-carriage-motion).
@@ -4257,6 +4260,9 @@ characters."
buffer))))
;; Report the output.
(with-current-buffer buffer
+ (setq revert-buffer-function
+ (lambda (&rest _)
+ (shell-command command)))
(setq mode-line-process
(cond ((null exit-status)
" - Error")