[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#69093: window-state-put doesn't update current buffer
From: |
martin rudalics |
Subject: |
bug#69093: window-state-put doesn't update current buffer |
Date: |
Sun, 25 Feb 2024 10:17:24 +0100 |
User-agent: |
Mozilla Thunderbird |
> 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))
Silly me. So far this apparently never caused any problems because
command_loop_1 makes the buffer of the selected window current. But it
will affect any code running after calling 'window-state-put' up to and
including the next 'post-command-hook'.
The attached patch (including the former changes) should fix it. I left
the old 'select-window' call in just for the case that its effect is
used elsewhere in a function called by 'window--state-put-2' later.
Many thanks for the analysis, martin
keep-windows.diff
Description: Text Data
- bug#69093: window-state-put doesn't update current buffer, (continued)
- bug#69093: window-state-put doesn't update current buffer, Juri Linkov, 2024/02/18
- bug#69093: window-state-put doesn't update current buffer, martin rudalics, 2024/02/19
- bug#69093: window-state-put doesn't update current buffer, Drew Adams, 2024/02/19
- bug#69093: window-state-put doesn't update current buffer, Juri Linkov, 2024/02/20
- bug#69093: window-state-put doesn't update current buffer, martin rudalics, 2024/02/21
- bug#69093: window-state-put doesn't update current buffer, Juri Linkov, 2024/02/21
- bug#69093: window-state-put doesn't update current buffer, martin rudalics, 2024/02/22
- bug#69093: window-state-put doesn't update current buffer, Juri Linkov, 2024/02/22
- bug#69093: window-state-put doesn't update current buffer, martin rudalics, 2024/02/23
- bug#69093: window-state-put doesn't update current buffer, Juri Linkov, 2024/02/24
- bug#69093: window-state-put doesn't update current buffer,
martin rudalics <=
- bug#69093: window-state-put doesn't update current buffer, Juri Linkov, 2024/02/25
- bug#69093: window-state-put doesn't update current buffer, martin rudalics, 2024/02/26