all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: martin rudalics <rudalics@gmx.at>
Cc: 62427@debbugs.gnu.org
Subject: bug#62427: tab-bar-new-tab-to now handles cases with multiple side-windows
Date: Thu, 18 May 2023 18:46:28 +0300	[thread overview]
Message-ID: <86wn153b43.fsf@mail.linkov.net> (raw)
In-Reply-To: <3a021a53-814d-3721-31fb-b77f4087a455@gmx.at> (martin rudalics's message of "Thu, 18 May 2023 10:31:13 +0200")

>> Would it be possible to update 'minibuf_selected_window'
>> with a new window after deleting the original window?
>
> Not really.  We'd change existing behavior that might rely on the fact
> that 'minibuffer-selected-window' returns nil once it got deleted.
>
> Besides, it might not make you happy anyway.  With the default of
> 'minibuffer-follows-selected-frame', a user may correspond with a
> minibuffer window that resides on another frame than that returned by
> 'minibuffer-selected-window' and neither minibuf_selected_window nor
> Vminibuf_scroll_window may make sense any more in such context.
>
> Why don't you use 'get-mru-window' on the frame that owns the
> 'minibuffer-window' instead of 'minibuffer-selected-window'?

Thanks for the idea, this works perfectly:

diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index 42fc5a23990..0ae7fb44b27 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -1339,8 +1340,7 @@ tab-bar-select-tab
 
          (ws
           ;; `window-state-put' fails when called in the minibuffer
-          (when (minibuffer-selected-window)
-            (select-window (minibuffer-selected-window)))
+          (when (minibufferp) (select-window (get-mru-window)))
           (window-state-put ws nil 'safe)))
 
         ;; Select the minibuffer when it was active before switching tabs
@@ -1575,8 +1575,7 @@ tab-bar-new-tab-to
 
     (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 (minibufferp) (select-window (get-mru-window)))
       (let ((ignore-window-parameters t)
             (window--sides-inhibit-check t))
         (if (eq tab-bar-new-tab-choice 'clone)





  reply	other threads:[~2023-05-18 15:46 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-24 21:07 bug#62427: tab-bar-new-tab-to now handles cases with multiple side-windows Benson Chu
2023-03-25 19:14 ` Juri Linkov
2023-03-26  4:19   ` Eli Zaretskii
2023-03-27  7:05     ` Juri Linkov
2023-03-27 13:36       ` Eli Zaretskii
2023-03-27 16:39         ` Juri Linkov
2023-03-27 17:06           ` Eli Zaretskii
2023-03-27 17:43             ` Benson Chu
2023-03-28 12:42               ` Eli Zaretskii
2023-03-28 16:17                 ` Benson Chu
2023-03-28 17:11                   ` Eli Zaretskii
2023-03-28 17:39                     ` Benson Chu
2023-03-30 16:43                 ` Juri Linkov
2023-03-31 16:20                   ` Benson Chu
2023-04-01 18:25                     ` Juri Linkov
2023-04-02 18:20                       ` Juri Linkov
2023-04-02 18:51                         ` Juri Linkov
2023-04-15  3:03                           ` Benson Chu
2023-04-15 18:42                             ` Juri Linkov
2023-04-18  6:58                               ` Juri Linkov
2023-04-22  9:05                                 ` Eli Zaretskii
2023-04-23 16:39                                   ` Juri Linkov
2023-04-24 11:50                                     ` Eli Zaretskii
2023-04-25 17:25                                       ` Juri Linkov
2023-05-15 17:32                                         ` Juri Linkov
2023-04-25 17:30                           ` Juri Linkov
2023-05-16 17:32                             ` Juri Linkov
2023-05-16 17:52                               ` Juri Linkov
2023-05-17  8:13                                 ` martin rudalics
2023-05-17 16:39                                   ` Juri Linkov
2023-05-18  8:31                                     ` martin rudalics
2023-05-18 15:46                                       ` Juri Linkov [this message]
2023-05-19  7:31                                         ` martin rudalics
2023-05-19 18:14                                           ` Juri Linkov
2023-05-16 18:23                               ` Eli Zaretskii
2023-05-17 16:32                                 ` Juri Linkov
2023-05-17 17:24                                   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86wn153b43.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=62427@debbugs.gnu.org \
    --cc=rudalics@gmx.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.