unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: master b02c9bc: Improve documentation of new Xref options
Date: Thu, 9 Sep 2021 04:22:48 +0300	[thread overview]
Message-ID: <23668bf1-4e51-b3ba-a8f6-6fe45f4639bc@yandex.ru> (raw)
In-Reply-To: <83lf47oajr.fsf@gnu.org>

On 08.09.2021 09:18, Eli Zaretskii wrote:

>> But the feature doesn't seem to be particularly popular/polished: the
>> example value for Elisp, for instance, sets up search across all symbols
>> (obarray), but subsequent navigation only works for commands, and only
>> ones documented in the manual.
> 
> I don't think we should be too bothered about that: once we have
> replacements for all of those etags features, we could declare the
> originals obsolete and point to replacements, something we cannot do
> when the replacements are missing.  So I think we should install this.

Fair enough.

I'd still like to see someone working on a better suggested default 
config for it, but it's not a blocker.

>>   (cl-defmethod xref-backend-apropos ((_backend (eql 'etags)) pattern)
>> -  (etags--xref-find-definitions (xref-apropos-regexp pattern) t))
>> +  (let ((regexp (xref-apropos-regexp pattern)))
>> +    (nconc
>> +     (etags--xref-find-definitions regexp t)
>> +     (etags--xref-apropos-additional regexp))))
> 
> I'm not sure I understand why is this specific to the etags backend.
> The spec seems to be more general, and xref-find-apropos is not
> specific to etags, right?

If as you say above it is for feature parity with 'M-x tags-apropos', 
then the previously sent patch should be enough.

We are honoring the etags-specific variable 
(tags-apropos-additional-actions), so the result should be specific to 
the etags backend.

> We'd also need a defcustom, similar to tags-apropos-additional-actions.

Could we extend it to be the feature of 'M-x xref-find-apropos' in 
general rather than the etags backend? It's possible, if we see specific 
user demand for it.

Here are considerations why I chose the other route:

- As I said, the existing etags feature is not very polished. To bring 
it into the Xref API proper, we'd have to redesign it somehow, and since 
the feature doesn't seem to scratch any of my personal itches, I need 
feature requests to narrow down the design space.

- It has been somewhat of a rule that backend methods don't change 
behavior based on some global user option, both in project.el and xref. 
Rather, each backend is more free to do its own thing and have 
backend-specific options for configuring. We can break this rule, of 
course, when presented with good reasons for it.

- It's hard for me to say whether third-party backends will want this 
behavior added to their backends unconditionally. But even when we're 
talking about the elisp backend... do we? Want it there?

- We don't need to make this choice now. It will be easy to install the 
already provided patch and then possibly extend the feature to all 
backends at some later point.



  reply	other threads:[~2021-09-09  1:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20210907130400.31609.90502@vcs0.savannah.gnu.org>
     [not found] ` <20210907130401.D074320A10@vcs0.savannah.gnu.org>
2021-09-07 15:21   ` master b02c9bc: Improve documentation of new Xref options Dmitry Gutov
2021-09-07 15:45     ` Eli Zaretskii
2021-09-07 16:06       ` Dmitry Gutov
2021-09-07 16:23         ` Eli Zaretskii
2021-09-08  0:24           ` Dmitry Gutov
2021-09-08  6:18             ` Eli Zaretskii
2021-09-09  1:22               ` Dmitry Gutov [this message]
2021-09-09  6:26                 ` Eli Zaretskii
2021-09-10  0:18                   ` Dmitry Gutov
2021-09-10 12:06                     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=23668bf1-4e51-b3ba-a8f6-6fe45f4639bc@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).