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

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

[nongnu] elpa/idris-mode d1a9171fd7 1/8: Jump to last Idris Code buffer


From: ELPA Syncer
Subject: [nongnu] elpa/idris-mode d1a9171fd7 1/8: Jump to last Idris Code buffer when we quit buffer
Date: Fri, 11 Nov 2022 06:58:58 -0500 (EST)

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

    Jump to last Idris Code buffer when we quit buffer
    
    With current version, when Idris buffer is displayed in window
    that already contains other buffer then
    on pressing "q" to quit Idris buffer the focus
    stays in the window of the Idris buffer.
    
    This change ensures that the focus returns to the buffer
    and window from where we have most likely
    came to the killed Idris buffer.
---
 idris-common-utils.el | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/idris-common-utils.el b/idris-common-utils.el
index 5e981d6243..857bd36615 100644
--- a/idris-common-utils.el
+++ b/idris-common-utils.el
@@ -72,12 +72,15 @@ Lisp package.")
                (get-buffer buffer))
               ((bufferp buffer)
                buffer)
-              (t (message "don't know how to kill buffer")))))
+              (t (message "don't know how to kill buffer"))))
+        (return-buffer (seq-find (lambda (b) (eq 'idris-mode 
(buffer-local-value 'major-mode b)))
+                                 (buffer-list))))
     (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))))))
+          (delete-window win))))
+    (when return-buffer (pop-to-buffer return-buffer 
`(display-buffer-reuse-window)))))
 
 (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]