1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-05 22:20:24 -08:00

Add constants for shell command output buffer names

Buffers `*Shell Command Output*' and `*Async Shell Command*'
have been around since a long time; used across several libraries,
they are de facto output buffers for shell commands.

* lisp/simple.el (shell-command-buffer-name)
(shell-command-buffer-name-async): New variables.
* lisp/dired-aux.el
* lisp/gnus/gnus-sum.el
* lisp/gnus/gnus-win.el
* lisp/ibuf-ext.el
* lisp/net/tramp.el: Use them.

* etc/NEWS (Changes in Emacs 28.1): Announce this change.

* doc/emacs/misc.texi (Single Shell)
* doc/misc/tramp.texi (Remote processes):
Update manual (bug#39138).
This commit is contained in:
Tino Calancha 2020-08-09 14:18:09 +02:00 committed by Lars Ingebrigtsen
parent db77e9a0da
commit 2ed502d2a7
9 changed files with 50 additions and 33 deletions

View file

@ -504,7 +504,7 @@ format. See `ibuffer-update-saved-filters-format' and
(ibuffer-forward-line 0))
(defun ibuffer--maybe-erase-shell-cmd-output ()
(let ((buf (get-buffer "*Shell Command Output*")))
(let ((buf (get-buffer shell-command-buffer-name)))
(when (and (buffer-live-p buf)
(not shell-command-dont-erase-buffer)
(not (zerop (buffer-size buf))))
@ -517,7 +517,7 @@ format. See `ibuffer-update-saved-filters-format' and
:opstring "Shell command executed on"
:before (ibuffer--maybe-erase-shell-cmd-output)
:modifier-p nil)
(let ((out-buf (get-buffer-create "*Shell Command Output*")))
(let ((out-buf (get-buffer-create shell-command-buffer-name)))
(with-current-buffer out-buf (goto-char (point-max)))
(call-shell-region (point-min) (point-max)
command nil out-buf)))
@ -542,7 +542,7 @@ format. See `ibuffer-update-saved-filters-format' and
:modifier-p nil)
(let ((file (and (not (buffer-modified-p))
buffer-file-name))
(out-buf (get-buffer-create "*Shell Command Output*")))
(out-buf (get-buffer-create shell-command-buffer-name)))
(unless (and file (file-exists-p file))
(setq file
(make-temp-file