]> git.eshelyaron.com Git - emacs.git/commit
Fix shell-command-dont-erase-buffer feature
authorTino Calancha <tino.calancha@gmail.com>
Sun, 19 Jan 2020 10:13:02 +0000 (11:13 +0100)
committerTino Calancha <tino.calancha@gmail.com>
Sun, 19 Jan 2020 10:13:02 +0000 (11:13 +0100)
commit2eb0b7835d1a9cd4b804436e33c71058cb38f178
tree9edfabae5617c7d9113eec228e9b09f0319321ec
parentc134978a769a27c10de4a1c3d28c073f3de87a3c
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.
doc/emacs/misc.texi
etc/NEWS
lisp/simple.el
test/lisp/simple-tests.el