Subject: Re: bug#28814: [BUMP, PATCH] (26.0.90; When *xref* window is needed, original window-switching intent is lost )

From: Dmitry Gutov <[email-masked]>
Date: Wed, 25 Oct 2017 13:24:01 +0300

On 10/25/17 10:43 AM, João Távora wrote:

>> OK, but is it the correct thing to do? The thresholds are there for a
>> reason, and having a window that's only a few lines tall (which could
>> happen in some example) will hardly be more helpful than showing it in
>> a different window, even if the user expected xref to use the "other
>> window".
> 
> Well, I don’t think it’s that bad if a tiny window pops up, considering:

Yeah, maybe it's not too bad. Like I said, no strong objections.

> I see, there’s prior art here. You approach is much more ambitious than
> mine and given the hairiness of window code, it’s no wonder it didn’t
> work well, if you will excuse the hindsight 20/20 :-)

It would have given a more consistent mental model, though. And it's 
something that corresponds to some users expectations already.

Think Ctrl-P or "Goto Definition" preview in Sublime Text. You can look 
at the destinations and pick one, or not pick anything, and the tabs 
list would be intact.

> If it helps, this itch didn’t pop out of thin air: as you know, xref.el
> is lifted from SLIME’s UI. SLY, my fork of SLIME, does the same, and a
> user complained about SLY’s use of popup windows in a way that finally
> convinced me. See https://github.com/joaotavora/sly/issues/121

I agree that it might be a step forward, and help you retain some main 
aspects of behavior that the users are accustomed to. I just wish it was 
a step toward a more well-rounded UI.

>> If there are other non-dedicated windows, will one of them be used
>> (that would seem fine)?
> 
> Yes, of course, in keeping with the current spirit that splitting a
> small window is a last resort before popping a frame.

Good.

>> I have to wonder if we have other commands that quit the current
>> window when called with a prefix. Particularly commands bound to RET.
> 
> I see, it’s a bit odd indeed, but I had no idea of any kind of rule or
> policy in that direction.

If we don't, maybe we should. Consistency in the way modes work is a 
good thing, and allows the user to adapt to each of them much quicker. 
Not to mention having to keep the effects of different bindings in 
memory (both muscle and cranial).

> Anyway, In the thread you pointed me to, there was talk of an ’a’
> command but I never saw it. It was some hypothetical
> xref-quit-and-goto-xref. I’m perfectly fine with implementing that
> instead.

But 'a' (correct me if I'm wrong) normally replaces a buffer in the 
*current* window. And kill the previous buffer.

> Of course my priority goes towards RET doing xref-quit-and-goto-xref and
> something else doing xref-goto-xref. If that default isn’t changed, I’ll
> probably to that remap in my init file..

So you'd always use "something else" to navigate to project-find-regexp 
search results?