Subject: bug#74361: [PATCH] New option xref-navigation-display-window-action

From: martin rudalics <[email-masked]>
Date: Fri, 6 Dec 2024 09:31:28 +0100

>>>         (with-current-buffer buffer
 >>>           (setq-local display-buffer-previous-window (selected-window)))))
 >>
 >> This relies on 'ofun' selecting a window and would not work for plain
 >> 'display-buffer'.  Right?
 >
 > It should work for plain 'display-buffer' because of using 'with-current-buffer'.

'display-buffer' per se doesn't care about the current buffer.  The
assumption that the selected window also holds the current buffer is
nowhere guaranteed.  Just think of 'display-buffer' running from a
timer.

martin