aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorEli Zaretskii2020-04-18 12:01:26 +0300
committerEli Zaretskii2020-04-18 12:01:26 +0300
commit175c61c18bfaa1d75aa087ba4bd4de3ebfe1a1d6 (patch)
treedfbb644b07477429f7958c7a8c01998aa6e68cf6 /doc
parent6b297519b580df27d8721943f55629689b4c83e0 (diff)
downloademacs-175c61c18bfaa1d75aa087ba4bd4de3ebfe1a1d6.tar.gz
emacs-175c61c18bfaa1d75aa087ba4bd4de3ebfe1a1d6.zip
Fix "C-u M-!" when 'shell-command-dont-erase-buffer' is non-nil
* lisp/simple.el (shell-command-dont-erase-buffer): Clarify the effect of the various values in the doc string. (shell-command-save-pos-or-erase, shell-command): Don't move or push point if the output will go to the current buffer. (Bug#40690) (shell-command): Mention 'shell-command-dont-erase-buffer' in the doc string. * test/lisp/simple-tests.el (with-shell-command-dont-erase-buffer): Don't is shell quoting 'like this', as it doesn't work on MS-Windows; quote "like this" instead. (simple-tests-shell-command-dont-erase-buffer): Adapt the test to the new modus operandi. * doc/emacs/misc.texi (Single Shell): Document the effect of the various values of 'shell-command-dont-erase-buffer'. * etc/NEWS: Expand and reword the entry regarding changes in 'shell-command-dont-erase-buffer'.
Diffstat (limited to 'doc')
-rw-r--r--doc/emacs/misc.texi27
1 files changed, 19 insertions, 8 deletions
diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi
index d097f4ee7d8..294430aa183 100644
--- a/doc/emacs/misc.texi
+++ b/doc/emacs/misc.texi
@@ -740,10 +740,11 @@ creates the file @file{foo} and produces no terminal output.
740 740
741 A numeric argument to @code{shell-command}, e.g., @kbd{M-1 M-!}, 741 A numeric argument to @code{shell-command}, e.g., @kbd{M-1 M-!},
742causes it to insert terminal output into the current buffer instead of 742causes it to insert terminal output into the current buffer instead of
743a separate buffer. It puts point before the output, and sets the mark 743a separate buffer. By default, it puts point before the output, and
744after the output. For instance, @kbd{M-1 M-! gunzip < foo.gz 744sets the mark after the output (but a non-default value of
745@key{RET}} would insert the uncompressed form of the file 745@code{shell-command-dont-erase-buffer} can change that, see below).
746@file{foo.gz} into the current buffer. 746For instance, @kbd{M-1 M-! gunzip < foo.gz @key{RET}} would insert the
747uncompressed form of the file @file{foo.gz} into the current buffer.
747 748
748 Provided the specified shell command does not end with @samp{&}, it 749 Provided the specified shell command does not end with @samp{&}, it
749runs @dfn{synchronously}, and you must wait for it to exit before 750runs @dfn{synchronously}, and you must wait for it to exit before
@@ -829,11 +830,21 @@ inserted into a buffer of that name.
829 By default, the output buffer is erased between shell commands, except 830 By default, the output buffer is erased between shell commands, except
830when the output goes to the current buffer. If you change the value 831when the output goes to the current buffer. If you change the value
831of the option @code{shell-command-dont-erase-buffer} to @code{erase}, 832of the option @code{shell-command-dont-erase-buffer} to @code{erase},
832then the output buffer is always erased. Any other non-@code{nil} 833then the output buffer is always erased. Other non-@code{nil} values
833value prevents to erase the output buffer. 834prevent erasing of the output buffer, and---if the output buffer is
835not the current buffer---also control where to put point after
836inserting the output of the shell command:
834 837
835This option also controls where to set the point in the output buffer 838@table @code
836after the command completes; see the documentation of the option for details. 839@item beg-last-out
840Puts point at the beginning of the last shell-command output.
841@item end-last-out
842Puts point at the end of the last shell-command output, i.e.@: at the
843end of the output buffer.
844@item save-point
845Restores the position of point as it was before inserting the
846shell-command output.
847@end table
837 848
838@node Interactive Shell 849@node Interactive Shell
839@subsection Interactive Subshell 850@subsection Interactive Subshell