diff options
| author | Tino Calancha | 2020-01-19 11:13:02 +0100 |
|---|---|---|
| committer | Tino Calancha | 2020-01-19 11:13:02 +0100 |
| commit | 2eb0b7835d1a9cd4b804436e33c71058cb38f178 (patch) | |
| tree | 9edfabae5617c7d9113eec228e9b09f0319321ec /etc | |
| parent | c134978a769a27c10de4a1c3d28c073f3de87a3c (diff) | |
| download | emacs-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 'etc')
| -rw-r--r-- | etc/NEWS | 8 |
1 files changed, 8 insertions, 0 deletions
| @@ -2038,6 +2038,14 @@ variable for remote shells. It still defaults to "/bin/sh". | |||
| 2038 | ** Single shell commands | 2038 | ** Single shell commands |
| 2039 | 2039 | ||
| 2040 | +++ | 2040 | +++ |
| 2041 | *** 'shell-command-dont-erase-buffer' accepts the value 'erase' to | ||
| 2042 | force to erase the output buffer before execution of the command. | ||
| 2043 | |||
| 2044 | *** The new functions shell-command-save-pos-or-erase' and | ||
| 2045 | 'shell-command-set-point-after-cmd' control how point is handled | ||
| 2046 | between two consecutive shell commands in the same buffer. | ||
| 2047 | |||
| 2048 | +++ | ||
| 2041 | *** 'async-shell-command-width' defines the number of display columns | 2049 | *** 'async-shell-command-width' defines the number of display columns |
| 2042 | available for output of asynchronous shell commands. | 2050 | available for output of asynchronous shell commands. |
| 2043 | 2051 | ||