diff options
| author | Eli Zaretskii | 2020-04-18 12:01:26 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2020-04-18 12:01:26 +0300 |
| commit | 175c61c18bfaa1d75aa087ba4bd4de3ebfe1a1d6 (patch) | |
| tree | dfbb644b07477429f7958c7a8c01998aa6e68cf6 /doc | |
| parent | 6b297519b580df27d8721943f55629689b4c83e0 (diff) | |
| download | emacs-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.texi | 27 |
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-!}, |
| 742 | causes it to insert terminal output into the current buffer instead of | 742 | causes it to insert terminal output into the current buffer instead of |
| 743 | a separate buffer. It puts point before the output, and sets the mark | 743 | a separate buffer. By default, it puts point before the output, and |
| 744 | after the output. For instance, @kbd{M-1 M-! gunzip < foo.gz | 744 | sets 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. | 746 | For instance, @kbd{M-1 M-! gunzip < foo.gz @key{RET}} would insert the |
| 747 | uncompressed 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 |
| 749 | runs @dfn{synchronously}, and you must wait for it to exit before | 750 | runs @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 |
| 830 | when the output goes to the current buffer. If you change the value | 831 | when the output goes to the current buffer. If you change the value |
| 831 | of the option @code{shell-command-dont-erase-buffer} to @code{erase}, | 832 | of the option @code{shell-command-dont-erase-buffer} to @code{erase}, |
| 832 | then the output buffer is always erased. Any other non-@code{nil} | 833 | then the output buffer is always erased. Other non-@code{nil} values |
| 833 | value prevents to erase the output buffer. | 834 | prevent erasing of the output buffer, and---if the output buffer is |
| 835 | not the current buffer---also control where to put point after | ||
| 836 | inserting the output of the shell command: | ||
| 834 | 837 | ||
| 835 | This option also controls where to set the point in the output buffer | 838 | @table @code |
| 836 | after the command completes; see the documentation of the option for details. | 839 | @item beg-last-out |
| 840 | Puts point at the beginning of the last shell-command output. | ||
| 841 | @item end-last-out | ||
| 842 | Puts point at the end of the last shell-command output, i.e.@: at the | ||
| 843 | end of the output buffer. | ||
| 844 | @item save-point | ||
| 845 | Restores the position of point as it was before inserting the | ||
| 846 | shell-command output. | ||
| 847 | @end table | ||
| 837 | 848 | ||
| 838 | @node Interactive Shell | 849 | @node Interactive Shell |
| 839 | @subsection Interactive Subshell | 850 | @subsection Interactive Subshell |