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: 69093@debbugs.gnu.org
Subject: bug#69093: window-state-put doesn't update current buffer
Date: Tue, 20 Feb 2024 09:40:11 +0200	[thread overview]
Message-ID: <86il2jhb7o.fsf@mail.linkov.net> (raw)
In-Reply-To: <ae16566a-f425-4da3-9f67-f2eb90599eac@gmx.at> (martin rudalics's message of "Mon, 19 Feb 2024 10:43:00 +0100")

>>> Or could you tell beforehand which buffer will be current after
>>>
>>> (let ((configuration (current-window-configuration)))
>>>    (pop-to-buffer "*Messages*" '((display-buffer-pop-up-frame)))
>>>    (set-window-configuration configuration)
>>>    (current-buffer))
>>
>> Does this ambiguity exist only for multi-frame setups where
>> a system window manager decides what frame to select afterwards?
>
> The system window manager here does only what Emacs tells it to do.  But
> note that multi-frame setups got more and more broken since Emacs 26 and
> are maybe not used frequently nowadays.  So you probably needn't give
> them much attention in the first place.

Ok, since it's impossible to fix 'window-state-put',
let's narrow the scope just to the single-frame case
in the caller 'tab-bar-select-tab':

diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index d653f339fea..efca893fc16 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -1477,7 +1489,8 @@ tab-bar-select-tab
           ;; `window-state-put' fails when called in the minibuffer
           (when (window-minibuffer-p)
             (select-window (get-mru-window)))
-          (window-state-put ws nil 'safe)))
+          (window-state-put ws nil 'safe)
+          (set-buffer (window-buffer))))
 
         ;; Select the minibuffer when it was active before switching tabs
         (when (and minibuffer-was-active (active-minibuffer-window))






  parent reply	other threads:[~2024-02-20  7:40 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-13  7:39 bug#69093: window-state-put doesn't update current buffer Juri Linkov
2024-02-14  9:12 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-15  7:29   ` Juri Linkov
2024-02-16  9:39     ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-16 11:46       ` Eli Zaretskii
2024-02-18  7:43       ` Juri Linkov
2024-02-19  9:43         ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-19 17:36           ` Drew Adams
2024-02-20  7:40           ` Juri Linkov [this message]
2024-02-21  9:04             ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-21 17:27               ` Juri Linkov
2024-02-22  8:58                 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-22 17:23                   ` Juri Linkov
2024-02-23  8:48                     ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-24 17:32                       ` Juri Linkov
2024-02-25  9:17                         ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-25 18:19                           ` Juri Linkov
2024-02-26  8:42                             ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-04  9:40                               ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-05 17:14                                 ` Juri Linkov

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=86il2jhb7o.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=69093@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.