branch: externals/shell-command+
commit b5032a88c5ba54a60835e57d72a8d77f5b66aa31
Author: Philip Kaludercic <phil...@posteo.net>
Commit: Philip Kaludercic <phil...@posteo.net>

    Do not invoke 'erase-buffer' twice when handling "clear"
---
 shell-command+.el | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/shell-command+.el b/shell-command+.el
index 6e640a7524..b5acbfab25 100644
--- a/shell-command+.el
+++ b/shell-command+.el
@@ -286,9 +286,9 @@ prefix the command with \"../../../../\" or \"....\".")
 
 (defcustom shell-command+-clear-function
   (lambda ()
+    (erase-buffer)
     (when-let ((win (get-buffer-window)))
-      (quit-window nil win))
-    (erase-buffer))
+      (quit-window nil win)))
   "Function to invoke without any arguments when handling \"clear\"."
   :type 'function)
 
@@ -296,7 +296,6 @@ prefix the command with \"../../../../\" or \"....\".")
   "Empty the contents of the the *Shell Output* buffer."
   (with-current-buffer (or (bound-and-true-p shell-command-buffer-name)
                            "*Shell Command Output*")
-    (erase-buffer)
     (funcall shell-command+-clear-function)))
 
 (defcustom shell-command+-substitute-alist

Reply via email to