[Top][All Lists]

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

emacs-28 9bcb732: * lisp/window.el (quit-restore-window): Select previou

From: Juri Linkov
Subject: emacs-28 9bcb732: * lisp/window.el (quit-restore-window): Select previously selected window.
Date: Tue, 21 Dec 2021 14:12:53 -0500 (EST)

branch: emacs-28
commit 9bcb7326860ed8b234f8ffd8bceae866b968ff39
Author: Juri Linkov <juri@linkov.net>
Commit: Juri Linkov <juri@linkov.net>

    * lisp/window.el (quit-restore-window): Select previously selected window.
    After deleting the dedicated window, such as a window with *Completions*
    buffer, select the previously selected window, like most of other 'cond'
    branches do in this function (bug#52491).
 lisp/window.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lisp/window.el b/lisp/window.el
index d122326..ce1e609 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -5167,7 +5167,10 @@ nil means to not handle the buffer in a particular way.  
      ;; First try to delete dedicated windows that are not side windows.
      ((and dedicated (not (eq dedicated 'side))
-           (window--delete window 'dedicated (eq bury-or-kill 'kill))))
+           (window--delete window 'dedicated (eq bury-or-kill 'kill)))
+      ;; If the previously selected window is still alive, select it.
+      (when (window-live-p (nth 2 quit-restore))
+        (select-window (nth 2 quit-restore))))
      ((and (not prev-buffer)
           (eq (nth 1 quit-restore) 'tab)
           (eq (nth 3 quit-restore) buffer))

reply via email to

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