Subject: Re: bug#67993: Selecting buffer automatically

From: martin rudalics <[email-masked]>
Date: Fri, 5 Jan 2024 10:23:10 +0100

> Martin, do you agree with this change?
 > If ok, then I could update the documentation as well.

The following looks like a glitch:

 >> +                      (when (window-live-p (old-selected-window))
 >> +                        (select-window (old-selected-window))))

is supposed to select the window selected the last time we ran window
change functions.  Now consider the following scenario:

- Redisplay runs the window change functions and sets the old selected
   window.

- An application changes the selected window.

- 'display-buffer' gets called with a (select-window . nil) entry.  The
   call will select the window selected at last redisplay.

So I think that calling 'old-selected-window' here is not TRT.

martin