emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/shell-command+ f1bb887 1/2: Check if shell output buffe


From: ELPA Syncer
Subject: [elpa] externals/shell-command+ f1bb887 1/2: Check if shell output buffer exists before killing it
Date: Fri, 15 Oct 2021 13:57:34 -0400 (EDT)

branch: externals/shell-command+
commit f1bb8877567000b2521302f32b1ac72c777db691
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]