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.
(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))