Subject: bug#47894: 28.0.50; isearch does not work if enable-recursive-minibuffers is on and some input method is set.

From: Gregory Heytings <[email-masked]>
Date: Wed, 21 Apr 2021 07:16:31 +0000

>> - display-buffer-select is not a documented action, and does not even 
>> appear in the sources (even Google does not find it!), yet it works;
>
> I don't understand you here.  It is defined above
>

Yes, I guess I was a bit tired when I wrote this ;-)  Sorry for the noise.

>> - After this action, point has moved, but (current-buffer) does not 
>> return the buffer where point is; (window-buffer (selected-window)) 
>> does.  It seems to me that at the top-level these two should always be 
>> equal; apparently they are not.
>
> They need not be equal - only command_loop_1 ascertains that once here
>
>      /* Make sure the current window's buffer is selected.  */
>      set_buffer_internal (XBUFFER (XWINDOW (selected_window)->contents));
>
> but `display-buffer' can be called anywhere.  The major point is that, 
> due to the fact that `display-buffer' may pop up a new frame and the WM 
> will usually focus that frame, an application can _never_ be sure which 
> window will get selected and which buffer will be current after calling 
> `display-buffer' finished.
>

Okay, thanks for the clarification.  IIUC the right way to determine what 
the "current buffer" is (from a user's point of view: in which buffer will 
"a" be added if I press "a") is what I do: (window-buffer 
(selected-window)) and not what I did: (current-buffer)?