Subject: Re: bug#56305: 29.0.50; 'yes-or-no-p' deselects minibuffer frame

From: martin rudalics <[email-masked]>
Date: Tue, 19 Jul 2022 10:09:59 +0200

>>> In case you intend to fix this apparent blunder of mine: the point of
 >>> that commit was to set the selected window and frame so that ELisp code
 >>> run from the `mode-line-format` would see meaningful and consistent
 >>> values of selected-frame/window (and companions like the
 >>> frame-selected-window of the selected-frame, ...).
 >> How are display_mode_line or display_mode_lines affected by that commit?
 >
 > I'm sorry, I don't understand the question.

Above you said that "the point of that commit was to set the selected
window and frame so that ELisp code run from the `mode-line-format`
would see meaningful and consistent values ...".  The C functions that
evaluate 'mode-line-format' for redisplay are display_mode_lines and
display_mode_line and those functions did set the selected window and
frame before that commit and continued to do so after your commit in the
same way.  FWICS your commit changed the behavior of formatting frame
titles only.

 >> Worse even: People who want to know, for example, whether the mode line
 >> belongs to the selected window have to use 'old-selected-window' for
 >> getting that.
 >
 > Not sure "worse" than what.

Worse than being "misleading".

 > Clearly when computing the mode-line, there are 2 windows of interest:
 > the one to which this mode-line belongs and the one that's currently
 > considered (from the outside) as "the selected window".  Only one of the
 > two can be "the selected window" while computing the mode-line, and in
 > my experience most code wants/needs this to be the mode-line's window
 > rather than "the one that's currently considered (from the outside) as
 > the selected window".

"The selected window is the window in which the standard cursor for
selected windows appears."  I see no outside POV here.  And once more: I
don't ask to change this design but at least to tell users about it.

 >> NORECORD is not about focus.
 >
 > Then we need something like it but to say "I just want to change
 > selected-window temporarily, so don't mess with focus or any such thing".

Say to whom and where?

martin