aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorTino Calancha2020-01-19 11:13:02 +0100
committerTino Calancha2020-01-19 11:13:02 +0100
commit2eb0b7835d1a9cd4b804436e33c71058cb38f178 (patch)
tree9edfabae5617c7d9113eec228e9b09f0319321ec /doc
parentc134978a769a27c10de4a1c3d28c073f3de87a3c (diff)
downloademacs-2eb0b7835d1a9cd4b804436e33c71058cb38f178.tar.gz
emacs-2eb0b7835d1a9cd4b804436e33c71058cb38f178.zip
Fix shell-command-dont-erase-buffer feature
* lisp/simple.el (shell-command-dont-erase-buffer): The default, nil, is backward compatible, i.e. it erases the buffer only if the output buffer is not the current one; the new value 'erase always erases the output buffer. Update docstring. (shell-command-save-pos-or-erase): Add optional arg output-to-current-buffer. Rename it so that it's not internal. All callers updated. (shell-command-set-point-after-cmd): Rename it so that it's not internal. All callers updated. Adjust it to cover a side case. (shell-command): Adjust logic to match the specification (Bug#39067). Enable the feature when the output buffer is the current one. (shell-command-on-region): Little tweak to follow `shell-command-dont-erase-buffer' specification. * test/lisp/simple-tests.el (with-shell-command-dont-erase-buffer): Add helper macro. (simple-tests-shell-command-39067) (simple-tests-shell-command-dont-erase-buffer): Add tests. * doc/emacs/misc.texi (Single Shell): Update manual. * etc/NEWS (Single shell commands): Announce the change.
Diffstat (limited to 'doc')
-rw-r--r--doc/emacs/misc.texi14
1 files changed, 8 insertions, 6 deletions
diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi
index ab3318c4a24..6b95b12a846 100644
--- a/doc/emacs/misc.texi
+++ b/doc/emacs/misc.texi
@@ -826,12 +826,14 @@ the output buffer. But if you change the value of the variable
826inserted into a buffer of that name. 826inserted into a buffer of that name.
827 827
828@vindex shell-command-dont-erase-buffer 828@vindex shell-command-dont-erase-buffer
829 By default, the output buffer is erased between shell commands. 829 By default, the output buffer is erased between shell commands, except
830If you change the value of the variable 830when the output goes to the current buffer. If you change the value
831@code{shell-command-dont-erase-buffer} to a non-@code{nil} value, 831of the option @code{shell-command-dont-erase-buffer} to @code{erase},
832the output buffer is not erased. This variable also controls where to 832then the output buffer is always erased. Any other non-@code{nil}
833set the point in the output buffer after the command completes; see the 833value prevents to erase the output buffer.
834documentation of the variable for details. 834
835This option also controls where to set the point in the output buffer
836after the command completes; see the documentation of the option for details.
835 837
836@node Interactive Shell 838@node Interactive Shell
837@subsection Interactive Subshell 839@subsection Interactive Subshell