Variable: shell-command-dont-erase-buffer
shell-command-dont-erase-buffer is a customizable variable defined in
simple.el.gz.
Value
nil
Documentation
Whether to erase the output buffer before executing shell command.
A nil value erases the output buffer before execution of the shell command, except when the output buffer is the current one.
The value erase ensures the output buffer is erased before
execution of the shell command even if it is the current buffer.
Other non-nil values prevent the output buffer from being erased; they also reposition point in the shell output buffer after execution of the shell command, except when the output buffer is the current buffer.
The value beg-last-out sets point at the beginning of the last
output, end-last-out sets point at the end of the last output,
and save-point restores the buffer position as it was before the
shell command.
This variable was added, or its default value changed, in Emacs 27.1.
Probably introduced at or before Emacs version 26.1.
Source Code
;; Defined in /usr/src/emacs/lisp/simple.el.gz
(defcustom shell-command-dont-erase-buffer nil
"Whether to erase the output buffer before executing shell command.
A nil value erases the output buffer before execution of the
shell command, except when the output buffer is the current one.
The value `erase' ensures the output buffer is erased before
execution of the shell command even if it is the current buffer.
Other non-nil values prevent the output buffer from being erased; they
also reposition point in the shell output buffer after execution of the
shell command, except when the output buffer is the current buffer.
The value `beg-last-out' sets point at the beginning of the last
output, `end-last-out' sets point at the end of the last output,
and `save-point' restores the buffer position as it was before the
shell command."
:type '(choice
(const :tag "Erase output buffer if not the current one" nil)
(const :tag "Always erase output buffer" erase)
(const :tag "Set point to beginning of last output" beg-last-out)
(const :tag "Set point to end of last output" end-last-out)
(const :tag "Save point" save-point))
:group 'shell
:version "27.1")