emacs-diffs
[Top][All Lists]
Advanced

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

emacs-29 42a28ffdc27 2/2: * lisp/tab-bar.el: Don't use 'minibuffer-selec


From: Juri Linkov
Subject: emacs-29 42a28ffdc27 2/2: * lisp/tab-bar.el: Don't use 'minibuffer-selected-window' (bug#62427).
Date: Fri, 19 May 2023 14:16:14 -0400 (EDT)

branch: emacs-29
commit 42a28ffdc27498b66904c3d49e2f000a9b4690ca
Author: Juri Linkov <juri@linkov.net>
Commit: Juri Linkov <juri@linkov.net>

    * lisp/tab-bar.el: Don't use 'minibuffer-selected-window' (bug#62427).
    
    (tab-bar-select-tab, tab-bar-new-tab-to):
    Use 'window-minibuffer-p' instead of 'minibuffer-selected-window'.
    And switch to 'get-mru-window' instead of 'minibuffer-selected-window'.
---
 lisp/tab-bar.el | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index 73f2ff77c50..dc9ea63c490 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -1319,8 +1319,8 @@ Negative TAB-NUMBER counts tabs from the end of the tab 
bar."
 
          (ws
           ;; `window-state-put' fails when called in the minibuffer
-          (when (minibuffer-selected-window)
-            (select-window (minibuffer-selected-window)))
+          (when (window-minibuffer-p)
+            (select-window (get-mru-window)))
           (window-state-put ws nil 'safe)))
 
         ;; Select the minibuffer when it was active before switching tabs
@@ -1331,8 +1331,8 @@ Negative TAB-NUMBER counts tabs from the end of the tab 
bar."
         ;; another tab, then after going back to the first tab, it has
         ;; such inconsistent state that the current buffer is the minibuffer,
         ;; but its window is not active.  So try to undo this mess.
-        (when (and (minibufferp) (not (active-minibuffer-window)))
-          (other-window 1))
+        (when (and (window-minibuffer-p) (not (active-minibuffer-window)))
+          (select-window (get-mru-window)))
 
         (when tab-bar-history-mode
           (setq tab-bar-history-omit t))
@@ -1550,8 +1550,8 @@ After the tab is created, the hooks in
 
     (when tab-bar-new-tab-choice
       ;; Handle the case when it's called in the active minibuffer.
-      (when (minibuffer-selected-window)
-        (select-window (minibuffer-selected-window)))
+      (when (window-minibuffer-p)
+        (select-window (get-mru-window)))
       (let ((ignore-window-parameters t)
             (window--sides-inhibit-check t))
         (if (eq tab-bar-new-tab-choice 'clone)



reply via email to

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