GNU bug report logs - #61102
28.1; with-selected-window/save-window-excursion calls buffer-list-update-hook only once

Previous Next

Package: emacs;

Reported by: Al Haji-Ali <abdo.haji.ali <at> gmail.com>

Date: Fri, 27 Jan 2023 18:41:02 UTC

Severity: normal

Found in version 28.1

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #31 received at 61102 <at> debbugs.gnu.org (full text, mbox):

From: Al Haji-Ali <abdo.haji.ali <at> gmail.com>
To: martin rudalics <rudalics <at> gmx.at>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 61102 <at> debbugs.gnu.org
Subject: Re: bug#61102: 28.1; with-selected-window/save-window-excursion
 calls buffer-list-update-hook only once
Date: Thu, 02 Feb 2023 21:21:12 +0000
On 02/02/2023, martin rudalics wrote:
> 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.

Thanks! I should have clarified that I am developing a package that keeps track of the currently active window and executes certain code when the selected window changes (similar to auto-dim-other-buffers, if you are aware of it). I can't control what the user of my package does, in terms of combining `save-window-excursion` with `with-selected-window` or otherwise, so I am looking for a solution that works regardless

I guess my only option is have an idle timer that checks if the current selected window is different compared to the last time a `buffer-list-update-hook` was called.

-- Al




This bug report was last modified 2 years and 106 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.