[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: xref "find references" and grouping

From: Vitalie Spinu
Subject: Re: xref "find references" and grouping
Date: Mon, 04 May 2015 15:10:35 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

 >>> Dmitry Gutov on Mon, 4 May 2015 05:09:17 +0300 wrote:

 > A set of widgets (like generic group, file group, method group, and a few 
 > kinds
 > of locations) will allow any language mode to return a structured set of
 > matches, which can even be rendered in different ways.

Ho about a simple tabular interface. Each back-end will return a list of
matches with a backend specific plist of metadata. For example:

  (foo . (:file "path/to/foo-file" :line 23 :priority 1 :type "method" :class 

Then arrange the xref in a simple flat table:

   File                  Priority  Type    Class  Target
   path/to/foo-file:23   1         method  bax    foo
   ...                   ...       ...     ...    ...

Then add a sorting command to sort on File, Priority Type etc. and
introduced a custom var for the default sorting.

There is a mode in emacs for tabular display, I forgot its name but I
think it already takes care of the sorting and other useful stuff.

Note that sorting with trees is not so straightforward. Depending on
sorting criteria you will get a very different trees in terms of inner

Trees also tend to waste a lot of space and are more demanding
cognitively because you need to figure out where one tree starts and
where it ends. As the "height" of each tree is different that could be a
rather hard task unless you use a clear delimiter between trees. But
that means using additional vertical space for delimiters.

One huge advantage of flat displays is that you can narrow candidates on
whatever component. So you can simply use selective display like occur,
helm-occur or ivy to narrow your buffer. You cannot do that with trees.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]