[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Consistency for xref-show-{xrefs,definitions}-function
From: |
Daniel Martín |
Subject: |
Re: Consistency for xref-show-{xrefs,definitions}-function |
Date: |
Thu, 14 Jan 2021 22:04:38 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.1 (darwin) |
Gabriel do Nascimento Ribeiro <gabriel376@hotmail.com> writes:
> 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
> 'xref-show-definitions-completing-read)
>
> 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
>
I agree with your viewpoint, but do we need that much complexity? IIUC,
those functions mainly receive a list of xrefs and present them in a
certain way. I'm not sure why we should have xref-show-xrefs-* and
xref-show-definitions-* (even if they are aliases). I feel this
duplication won't scale well (imagine if we add support for any other
code relationship to xref).
Could we have a single implementation for each presentation style? That
would reduce confusion, and xref-show-xrefs-function and
xref-show-definitions-function may have different defaults to provide
the best possible UX for each operation.