[Top][All Lists]

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

Re: UI inconveniences with M-.

From: Vitalie Spinu
Subject: Re: UI inconveniences with M-.
Date: Mon, 04 May 2015 15:41:28 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

 >>> Stefan Monnier on Sat, 02 May 2015 02:59:28 -0400 wrote:

 > - make xref-find-function return not a list of locations, but a list of
 >   lists of locations (i.e. every location inside a sub-list is
 >   considered to have the same "level/quality/likelihood", but the lists
 >   are sorted by their "level/quality/likelihood").

That would allow for one hard-codded sorting. I think it's much better
to return a plist of metadata for each candidates. Then you can order on
multiple criteria.

 > - let the backend provide its own sorting function to override the
 >   current "group by file" sorting.

I think that's the task for the user to decide. The backend can compute
it's own :priority meta score and pass it back. If user's custom var
says sort on :priority then sort on priority.

Some backends might return more meta than others, so user's option
should be a list (:priority :type :file). The sorting algorithm should
got through the list and sort on first component which is defined. :file
must be defined for all backends.

 > I think it would make sense to make it possible for the user to
 > dynamically choose among the potentially many more backends (e.g. we
 > could add an xref/grep backend, and there will hopefulyl be more using
 > things like id-utils, gtags, ...) and maybe also to use several backends
 > at the same time (merging the results).  

Ho about the following UI. Instead of one set of backends you have
multiple levels of increasing sets of backends.

At each moment of time there is only one active "set" which you can
change with `xref-rotate-level`. The user then can customize levels of

  xref-backend-level-1 . (xref-default-mode-backend)
  xref-backend-level-2 . (xref-etags elisp-xref)
  xref-backend-level-3 . ....

A set corresponding to level N would automatically include all backends
from the lower levels. In the above example, if you set the level to 2
xref will merge default-backend, etags and elisp-xref.

Thus the UI is only 2 commands:

   xref-add-backend-in-level (ask for level and on prefix remove backend)
   xref-rotate-level (with numeric prefix, set level)

Users can then customize each level per mode or globally and thus have
consistent levels that they can rely upon independently of the context.


reply via email to

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