diff options
| author | Sean Whitton | 2021-01-29 06:50:38 +0100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2021-01-29 07:04:47 +0100 |
| commit | 5f650422e4a4c44ffc5ee0be4ec969765a307c7b (patch) | |
| tree | 3f5812242097e2ecb13ae020e119ab4c1fb1b97a | |
| parent | de51d94721efb90b153d70dc15691c16d0fbb46a (diff) | |
| download | emacs-5f650422e4a4c44ffc5ee0be4ec969765a307c7b.tar.gz emacs-5f650422e4a4c44ffc5ee0be4ec969765a307c7b.zip | |
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.el | 6 |
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)." | |||
| 3991 | (start-process-shell-command "Shell" buffer command))) | 3991 | (start-process-shell-command "Shell" buffer command))) |
| 3992 | (setq mode-line-process '(":%s")) | 3992 | (setq mode-line-process '(":%s")) |
| 3993 | (shell-mode) | 3993 | (shell-mode) |
| 3994 | (setq revert-buffer-function | ||
| 3995 | (lambda (&rest _) | ||
| 3996 | (async-shell-command command (current-buffer)))) | ||
| 3994 | (set-process-sentinel proc #'shell-command-sentinel) | 3997 | (set-process-sentinel proc #'shell-command-sentinel) |
| 3995 | ;; Use the comint filter for proper handling of | 3998 | ;; Use the comint filter for proper handling of |
| 3996 | ;; carriage motion (see comint-inhibit-carriage-motion). | 3999 | ;; carriage motion (see comint-inhibit-carriage-motion). |
| @@ -4257,6 +4260,9 @@ characters." | |||
| 4257 | buffer)))) | 4260 | buffer)))) |
| 4258 | ;; Report the output. | 4261 | ;; Report the output. |
| 4259 | (with-current-buffer buffer | 4262 | (with-current-buffer buffer |
| 4263 | (setq revert-buffer-function | ||
| 4264 | (lambda (&rest _) | ||
| 4265 | (shell-command command))) | ||
| 4260 | (setq mode-line-process | 4266 | (setq mode-line-process |
| 4261 | (cond ((null exit-status) | 4267 | (cond ((null exit-status) |
| 4262 | " - Error") | 4268 | " - Error") |