* lisp/simple.el (shell-command):
* doc/emacs/misc.texi (Single Shell): Clarify where the output
goes if the specified buffer isn't the current one (bug#40896).
shell-command output.
@end table
+In case the output buffer is not the current buffer, shell command
+output is appended at the end of this buffer.
+
@node Interactive Shell
@subsection Interactive Subshell
output in current buffer after point leaving mark after it. This
cannot be done asynchronously.
+If OUTPUT-BUFFER is a buffer or buffer name different from the
+current buffer, instead of outputting at point in that buffer,
+the output will be appended at the end of that buffer.
+
The user option `shell-command-dont-erase-buffer', which see, controls
whether the output buffer is erased and where to put point after
the shell command.