emacs-diffs
[Top][All Lists]
Advanced

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

master e948cdb: Allow creating a new tab for tab-switcher from the minib


From: Juri Linkov
Subject: master e948cdb: Allow creating a new tab for tab-switcher from the minibuffer (bug#45072)
Date: Mon, 14 Dec 2020 03:52:34 -0500 (EST)

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

    Allow creating a new tab for tab-switcher from the minibuffer (bug#45072)
    
    * lisp/tab-bar.el (tab-switcher): Simplify by let-binding
    tab-bar-new-tab-choice to t before calling tab-bar-new-tab
    that handles the case when it's called in the active minibuffer.
---
 lisp/tab-bar.el | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index 1327bde..3a705aa 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -762,6 +762,7 @@ After the tab is created, the hooks in
          (from-tab (tab-bar--tab)))
 
     (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)))
       (delete-other-windows)
@@ -1200,18 +1201,11 @@ Type q to remove the list of window configurations from 
the display.
 The first column shows `D' for a window configuration you have
 marked for deletion."
   (interactive)
-  (let ((dir default-directory)
-        (minibuf (minibuffer-selected-window)))
-    (let ((tab-bar-show nil)) ; don't enable tab-bar-mode if it's disabled
+  (let ((dir default-directory))
+    (let ((tab-bar-new-tab-choice t)
+          ;; Don't enable tab-bar-mode if it's disabled
+          (tab-bar-show nil))
       (tab-bar-new-tab))
-    ;; Handle the case when it's called in the active minibuffer.
-    (when minibuf (select-window (minibuffer-selected-window)))
-    (delete-other-windows)
-    ;; Create a new window to replace the existing one, to not break the
-    ;; window parameters (e.g. prev/next buffers) of the window just saved
-    ;; to the window configuration.  So when a saved window is restored,
-    ;; its parameters left intact.
-    (split-window) (delete-window)
     (let ((switch-to-buffer-preserve-window-point nil))
       (switch-to-buffer (tab-switcher-noselect)))
     (setq default-directory dir))



reply via email to

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