Subject: bug#20487: 25.0.50; Format and behavior of *xref* buffer is non-standard

From: Vitalie Spinu <[email-masked]>
Date: Sun, 03 May 2015 18:39:32 +0200

>>> Dmitry Gutov on Sun, 3 May 2015 17:30:43 +0300 wrote:

 > On 05/03/2015 01:20 AM, Vitalie Spinu wrote:
 >> - on RET *xref* is buried. That's not that other modes do and it's
 >> rather inconvenient IMO.

 > That's valid complaint, but it's very convenient to bury the xref buffer upon
 > jumping to a location, 

Not for me. Now I am using xref for what I would normally use grep
before - locate stuff around and familiarize myself with the code. So I
would like to keep it open.

 > Further, on more than one occasion I needed to only jump to one location in
 > *grep* and *compile* buffers, preferably in the same window, in order to hide
 > the said *grep* or *compile* buffer. We don't have an easy way to do that.

I never have problems with that. Emacs pops buffers in a variety of ways
but rarely hides them. I think people are used to manage their own
buffers as they see fit. I don't think xref should "help" them with
that.

Systems like HELM have their own consistent but different dynamics. I
would really leave hiding buffers to HELM on this occasion.

 > I'd welcome suggestions taking this into account.

I think if a new behavior is contentious the default should be
consistent with how other similar modes behave.

 >> I would rather prefer the way *grep* does that.

 > So, you'd call displaying the same file name over and over for each
 > location inside it, "efficient"? 

Are you questioning efficiency of *grep* displays?

I like the files being repeated. but that's not quite my point. I want
xref to place symbol description on the same line with the file (as
other modes do).

Repeated files have an advantage that you can immediately see which
symbol is in what file.

 > Do you favor vertical splits?

No. My splits are horizontal.

 > Someone can implement a different rendering method for xref buffer
 > (and set xref-show-xrefs-function to it), but I'm against making it
 > default.

Well. Xref already has broken a bunch of emacs UI standards. I think
this one is already one too many.

You can go against Emacs conventions but you cannot go against unix
world. You cannot change how grep outputs stuff in terminal. People are
used to standard displays and new mode better be considerate of that.

 > That rendering method will also encounter difficulties if xref groups
 > will sometimes have 2 levels of nesting (or more?).

What's the problem more concretely? You can still display hierarchical
information like this:

file1:23: Class foo
file1:25: -- Method boo {
              some more stuff her
            }
file1:26: -- Method baz
file2:70: Class foo

  Vitalie