[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#61102: 28.1; with-selected-window/save-window-excursion calls buffer
From: |
martin rudalics |
Subject: |
bug#61102: 28.1; with-selected-window/save-window-excursion calls buffer-list-update-hook only once |
Date: |
Thu, 2 Feb 2023 19:17:10 +0100 |
> I see that the behaviour is not a bug as per the documentation.
>
> But it does lead to strange behaviours in code or packages that rely
> on tracking the selected window since there is no way (that I see at
> least) to detect that the selected window did not change, or changed
> back at the end of executing this code.
You can save the selected window, call 'select-window', run your code,
call 'select-window' with the previously selected window again. Or have
a look at 'window-selection-change-functions'. If you told me what your
code is supposed to do within 'with-selected-window', I might be able to
give you further advice. As a rule, both 'save-window-excursion' and
'with-selected-window' should be avoided, if possible.
martin