branch: externals/shell-command+ commit f1bb8877567000b2521302f32b1ac72c777db691 Author: Philip Kaludercic <phil...@posteo.net> Commit: Philip Kaludercic <phil...@posteo.net>
Check if shell output buffer exists before killing it --- shell-command+.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/shell-command+.el b/shell-command+.el index 1d4abe3..5211bea 100644 --- a/shell-command+.el +++ b/shell-command+.el @@ -361,7 +361,9 @@ between BEG and END. Otherwise the whole buffer is processed." (default-directory (shell-command+-expand-path (or path ".")))) ;; Make sure the previous output buffer was killed, to prevent ;; TRAMP paths from persisting between commands. - (kill-buffer shell-command-buffer-name) + (let ((shell-command-buffer (get-buffer shell-command-buffer-name))) + (when shell-command-buffer + (kill-buffer shell-command-buffer))) (cond ((eq mode 'input) (delete-region beg end) (shell-command rest t shell-command-default-error-buffer)