bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#69093: window-state-put doesn't update current buffer


From: Juri Linkov
Subject: bug#69093: window-state-put doesn't update current buffer
Date: Thu, 22 Feb 2024 19:23:36 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu)

>> (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).





reply via email to

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