Subject: Re: bug#32790: 27.0.50; point jumps unexpectedly after delete-window

From: martin rudalics <[email-masked]>
Date: Mon, 29 Oct 2018 09:44:53 +0100

>> Once more: What could go posibly wrong if you added 'hook' to
 >> 'post-command-hook' and unconditionally (that is completely
 >> disregarding whether a buffer display action succeeded or not) removed
 >> the overriding action there.
 >
 > Please note that for example S-M-up M-x ffap RET RET involves
 > the minibuffer before a buffer-displaying command is executed.

One more argument against using 'window-state-change-functions' or the
like.  Selecting the minibuffer window would count as a state change
and immediately reinstall the previous overriding action.

Rather, the function on 'post-command-hook' would have to be more
intelligent - check whether the minibuffer-window is selected and
leave the overriding action untouched in that case.  Moreover, using
'post-command-hook' would automatically fix any problems when quitting
an S-M-up action.  I see no way to catch quitting via a state change
of windows.

martin