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

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

[nongnu] elpa/idris-mode b6a5b2ec60 1/4: Kill Idris buffer and it's wind


From: ELPA Syncer
Subject: [nongnu] elpa/idris-mode b6a5b2ec60 1/4: Kill Idris buffer and it's window if it was the only
Date: Tue, 8 Nov 2022 07:59:02 -0500 (EST)

branch: elpa/idris-mode
commit b6a5b2ec60391099b491364ba3089cb9abcd88c2
Author: Marek L <nospam.keram@gmail.com>
Commit: Marek L <nospam.keram@gmail.com>

    Kill Idris buffer and it's window if it was the only
    
    buffer in windows history.
    Previously if we killed an Idris buffer Emacs would
    preserve the window and copy another visible buffer
    into it which leads to not good user experience.
---
 idris-common-utils.el | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/idris-common-utils.el b/idris-common-utils.el
index be9b8c4382..e8637934e4 100644
--- a/idris-common-utils.el
+++ b/idris-common-utils.el
@@ -73,7 +73,11 @@ Lisp package.")
               ((bufferp buffer)
                buffer)
               (t (message "don't know how to kill buffer")))))
-    (when (and buf (buffer-live-p buf)) (kill-buffer buf))))
+    (when (and buf (buffer-live-p buf))
+      (let ((win (get-buffer-window buf)))
+        (kill-buffer buf)
+        (when (null (window-prev-buffers win))
+          (delete-window win))))))
 
 (defun idris-minibuffer-respecting-message (text &rest args)
   "Display TEXT as a message, without hiding any minibuffer contents."



reply via email to

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