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: Thu, 22 Feb 2024 19:23:36 +0200 Organization: LINKOV.NET Message-ID: <86sf1ks9oj.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> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28943"; 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 Thu Feb 22 18:43:17 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 1rdD6K-0007OH-Qi for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 22 Feb 2024 18:43:16 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rdD5r-0002xh-2z; Thu, 22 Feb 2024 12:42:47 -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 1rdD5o-0002ww-7l for bug-gnu-emacs@gnu.org; Thu, 22 Feb 2024 12:42:44 -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 1rdD5k-0005mt-1y for bug-gnu-emacs@gnu.org; Thu, 22 Feb 2024 12:42:41 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rdD66-0002L9-Ub for bug-gnu-emacs@gnu.org; Thu, 22 Feb 2024 12:43: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: Thu, 22 Feb 2024 17:43: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.17086237428846 (code B ref 69093); Thu, 22 Feb 2024 17:43:02 +0000 Original-Received: (at 69093) by debbugs.gnu.org; 22 Feb 2024 17:42:22 +0000 Original-Received: from localhost ([127.0.0.1]:44682 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rdD5S-0002IZ-HD for submit@debbugs.gnu.org; Thu, 22 Feb 2024 12:42:22 -0500 Original-Received: from relay3-d.mail.gandi.net ([217.70.183.195]:33387) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rdD5R-0002IC-3Q for 69093@debbugs.gnu.org; Thu, 22 Feb 2024 12:42:21 -0500 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 1BE966000B; Thu, 22 Feb 2024 17:41:30 +0000 (UTC) In-Reply-To: (martin rudalics's message of "Thu, 22 Feb 2024 09:58:12 +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:280462 Archived-At: >> (defun pulse-momentary-highlight-one-line (&optional point face) >> (save-excursion >> (goto-char (or point (point))) >> (let ((start (progn (vertical-motion 0) (point))) >> (end (progn (vertical-motion 1) (point)))) >> (pulse-momentary-highlight-region start end face)))) >> >> It expects that 'point' should be in the current buffer >> that is displayed in the selected window. > > This function will probably not DTRT when the same buffer is displayed > in two windows with different values of point. It should use an overlay > with a 'window' property. Agreed, a 'window' property would be nice. > If by "fails" you mean that 'window-state-put' does not select the > window selected at the time the corresponding 'window-state-get' was > run, then you should fix this in the tab bar code by recording the > frame's selected window together with the state and, depending on > whether the frame you put the state into is selected or not, either set > that frame's selected window or select that window. The latter case > should then make that window's buffer current. The window state already has information about the selected window: (selected . t) > If by "fails" you mean that something in ‘window-state-put’ makes the > selected window not show the current buffer, we have to dig further. 'window-state-put' fails to select the previously selected window's buffer with the property (selected . t).