Subject: bug#20489: 25.0.50; next-error-find-buffer chooses non-current buffer without good reason

From: Juri Linkov <[email-masked]>
Date: Wed, 07 Mar 2018 00:25:30 +0200

>> Actually no new feature is needed, ‘display-buffer-alist’ is powerful enough,
>> and this can be easily implemented with a few lines of code:
>>
>> 1. next-error for *xref* to reuse the same window:
>>
>> ...
>>
>> 2. with e.g. two *grep* windows, typing RET to select the right locus window:
>>
>> ...
> Both of these sound pretty cool (and a fair distance over my head). I'm not
> sure they'd make a radical change to any of my workflows.

I created such complex solution to work around the peculiarities of xref:
navigating with next-error displays every new opened buffer in another window,
thus eventually obscuring the *xref* buffer itself.  Could you change xref
to use the same logic as is used in compilation/grep that shows all next-error
places in the same window adjacent to the initial window with the list of
compilation errors or grep hits that are always visible on the screen.

> In many ways, I feel window management is a bit of a lost cause in
> Emacs, and if anyone's going to fix that, next-error is probably not
> the place to start.

For better window management we need a higher declarative layer of
configuration based on display-buffer-alist.