[Top][All Lists]

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

Re: Consistency for xref-show-{xrefs,definitions}-function

From: Dmitry Gutov
Subject: Re: Consistency for xref-show-{xrefs,definitions}-function
Date: Fri, 15 Jan 2021 19:20:34 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0


On 14.01.2021 22:27, Gabriel do Nascimento Ribeiro wrote:
I noticed that the options 'xref-show-xrefs-function' and
'xref-show-definitions-function' are not symmetrical.

The defcustom for 'xref-show-xrefs-function' does not have type choices
as 'xref-show-definitions-function' has. Furthermore, it's quite strange
to configure it as follow:

(setq xref-show-xrefs-function

I suggest to create similar functions for 'xref-show-xrefs-function',
which at this moment can be just aliases but can be independent
functions in the future, if necessary:
   - xref-show-xrefs-buffer
   - xref-show-xrefs-buffer-at-bottom
   - xref-show-xrefs-completing-read

Also, the docstrings of both options could be improved a little bit to
give more information about the default choices.

I can submit a patch if these suggestions are accepted.

Why do you want this?

xref-find-definitions differs from the rest of Xref-using commands in that it usually only find one location, and when there are several, the user wants to quickly choose one of the alternatives, the faster the better. The different options for xref-show-definitions-function provide different solutions for that problem.

In all other cases returning multiple results is the common case, and you usually want to see all of them, not just one. For that, the completing-read UI, for example, is not very suitable.

reply via email to

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