emacs-diffs
[Top][All Lists]
Advanced

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

master 05220498649: * lisp/tab-bar.el: Improve tab-bar-minibuffer-restor


From: Juri Linkov
Subject: master 05220498649: * lisp/tab-bar.el: Improve tab-bar-minibuffer-restore-tab (bug#64373).
Date: Fri, 7 Jul 2023 02:34:33 -0400 (EDT)

branch: master
commit 0522049864951fcb1231e80725a3c8d7d88605c6
Author: Juri Linkov <juri@linkov.net>
Commit: Juri Linkov <juri@linkov.net>

    * lisp/tab-bar.el: Improve tab-bar-minibuffer-restore-tab (bug#64373).
    
    (tab-bar-select-tab): Set tab-bar-minibuffer-restore-tab and
    minibuffer-exit-hook minibuffer-locally to handle recursive minibuffers
    for non-nil read-minibuffer-restore-windows.
    (tab-bar-minibuffer-restore-tab): No need to reset minibuffer-local values.
---
 lisp/tab-bar.el | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index 234e7e5d14d..f47c4a7bb6c 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -1261,10 +1261,8 @@ inherits the current tab's `explicit-name' parameter."
 This is necessary to prepare the same window configuration where
 original windows were saved and will be restored.  This function
 is used only when `read-minibuffer-restore-windows' is non-nil."
-  (when (and read-minibuffer-restore-windows
-             tab-bar-minibuffer-restore-tab)
-    (tab-bar-select-tab tab-bar-minibuffer-restore-tab)
-    (setq tab-bar-minibuffer-restore-tab nil)))
+  (when tab-bar-minibuffer-restore-tab
+    (tab-bar-select-tab tab-bar-minibuffer-restore-tab)))
 
 (defun tab-bar-select-tab (&optional tab-number)
   "Switch to the tab by its absolute position TAB-NUMBER in the tab bar.
@@ -1293,8 +1291,8 @@ Negative TAB-NUMBER counts tabs from the end of the tab 
bar."
 
     (when (and read-minibuffer-restore-windows minibuffer-was-active
                (not tab-bar-minibuffer-restore-tab))
-      (setq tab-bar-minibuffer-restore-tab (1+ from-index))
-      (add-hook 'minibuffer-exit-hook 'tab-bar-minibuffer-restore-tab))
+      (setq-local tab-bar-minibuffer-restore-tab (1+ from-index))
+      (add-hook 'minibuffer-exit-hook 'tab-bar-minibuffer-restore-tab nil t))
 
     (unless (eq from-index to-index)
       (let* ((from-tab (tab-bar--tab))



reply via email to

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