From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#69093: window-state-put doesn't update current buffer Date: Sat, 24 Feb 2024 19:32:56 +0200 Organization: LINKOV.NET Message-ID: <86o7c5epiv.fsf@mail.linkov.net> References: <86il2s6cva.fsf@mail.linkov.net> <2387160a-717f-4164-a0ad-cd831cabd60f@gmx.at> <86cysy1c7e.fsf@mail.linkov.net> <9bc224fd-265b-42a6-9315-9e1caa9e7172@gmx.at> <86msryw7gy.fsf@mail.linkov.net> <86il2jhb7o.fsf@mail.linkov.net> <843eff0e-134a-4ade-8c9f-c49166f85241@gmx.at> <86y1bdviba.fsf@mail.linkov.net> <86sf1ks9oj.fsf@mail.linkov.net> <5307fa5c-725a-4d73-ae2f-07668e4bd5b3@gmx.at> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36296"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) Cc: 69093@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Feb 24 21:26:04 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rdyay-0009Gh-Gu for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 24 Feb 2024 21:26:04 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rdyac-00022Y-9n; Sat, 24 Feb 2024 15:25:42 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rdyaZ-000213-3Z for bug-gnu-emacs@gnu.org; Sat, 24 Feb 2024 15:25:40 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rdyaY-0005Bw-BJ for bug-gnu-emacs@gnu.org; Sat, 24 Feb 2024 15:25:38 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rdyaw-0001qa-Id for bug-gnu-emacs@gnu.org; Sat, 24 Feb 2024 15:26:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 24 Feb 2024 20:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69093 X-GNU-PR-Package: emacs Original-Received: via spool by 69093-submit@debbugs.gnu.org id=B69093.17088063206960 (code B ref 69093); Sat, 24 Feb 2024 20:26:02 +0000 Original-Received: (at 69093) by debbugs.gnu.org; 24 Feb 2024 20:25:20 +0000 Original-Received: from localhost ([127.0.0.1]:55261 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rdyaF-0001o6-QN for submit@debbugs.gnu.org; Sat, 24 Feb 2024 15:25:20 -0500 Original-Received: from mslow1.mail.gandi.net ([217.70.178.240]:46671) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rdyaD-0001ng-Vo for 69093@debbugs.gnu.org; Sat, 24 Feb 2024 15:25:18 -0500 Original-Received: from relay6-d.mail.gandi.net (unknown [217.70.183.198]) by mslow1.mail.gandi.net (Postfix) with ESMTP id CAFE1C28B6 for <69093@debbugs.gnu.org>; Sat, 24 Feb 2024 17:55:42 +0000 (UTC) Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 8A594C0007; Sat, 24 Feb 2024 17:55:16 +0000 (UTC) In-Reply-To: <5307fa5c-725a-4d73-ae2f-07668e4bd5b3@gmx.at> (martin rudalics's message of "Fri, 23 Feb 2024 09:48:05 +0100") X-GND-Sasl: juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:280577 Archived-At: >> 'window-state-put' fails to select the previously selected >> window's buffer with the property (selected . t). > > It should have selected it here > > ;; Select window if it's the selected one. > (when (cdr (assq 'selected state)) > (select-window window)) > > Please first check whether this 'select-window' call is executed at all > in your scenario. If it is, please find out which window apparently > gets selected instead afterwards and try to find out why. The right window is selected, and its buffer becomes current. > If there's no clue, you would have to find out who undoes that > selection first by putting a breakpoint into Fselect_window and, if > that fails, by putting a breakpoint into select_window (which can be > a pain). The problem is that afterwards the same function undoes the setting of current buffer. In window--state-put-2, select-window is inside with-current-buffer that undoes the current buffer selection: (with-current-buffer buffer ... ;; Select window if it's the selected one. (when (cdr (assq 'selected state)) (select-window window)) Also in window-state-put, with-temp-buffer undoes the current buffer: (with-temp-buffer (set-window-buffer window (current-buffer)) (window--state-put-1 state window nil totals pixelwise) (window--state-put-2 ignore pixelwise))