GNU bug report logs - #32389
Default behaviour of xref-find-references is inconsistent with the documentation

Previous Next

Package: emacs;

Reported by: Shitikanth <shitikanth1 <at> gmail.com>

Date: Tue, 7 Aug 2018 15:18:02 UTC

Severity: normal

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Shitikanth <shitikanth1 <at> gmail.com>
Subject: bug#32389: closed (Re: bug#32389: Default behaviour of
 xref-find-references is inconsistent with the documentation)
Date: Tue, 07 Aug 2018 16:21:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#32389: Default behaviour of xref-find-references is inconsistent with the documentation

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 32389 <at> debbugs.gnu.org.

-- 
32389: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=32389
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Eli Zaretskii <eliz <at> gnu.org>
To: Shitikanth <shitikanth1 <at> gmail.com>
Cc: 32389-done <at> debbugs.gnu.org
Subject: Re: bug#32389: Default behaviour of xref-find-references is
 inconsistent with the documentation
Date: Tue, 07 Aug 2018 19:20:23 +0300
> From: Shitikanth <shitikanth1 <at> gmail.com>
> Date: Tue, 7 Aug 2018 14:25:46 +0530
> 
> The function documentation of xref-find-references says:
> 
>     Find references to the identifier at point. With prefix argument, prompt for
>     the identifier.
> 
> The Emacs manual (Node: Identifier Search) says:
> 
>     ‘M-?’ finds all the references for the identifier at point. If there’s no
>     identifier at point, or when invoked with a prefix argument, the command
>     prompts for the identifier, with completion.
> 
> Inconsistent to both, the actual behaviour of xref-find-references and M-? is to
> *always* prompt for the identifier from the user (irrespective of whether it is
> invoked with or without the prefix-arg).

That's inaccurate: the actual behavior depends on the Xref backend,
and cannot be predicted in advance for every backend.  If the
backend-specific xref-backend-identifier-at-point method returns a
non-nil identifier, the command will not prompt.

However, the current documentation is also clearly inaccurate, so I
made it more so.

> The only way to get the documented
> behaviour is by customizing xref-prompt-for-identifier, and there is no way of
> discovering this without reading the source code.

Good point, I added a reference to the variable to the documentation
of the command.

With that, I'm closing the bug.  Thanks for bringing this to our
attention.

[Message part 3 (message/rfc822, inline)]
From: Shitikanth <shitikanth1 <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Default behaviour of xref-find-references is inconsistent with the
 documentation
Date: Tue, 7 Aug 2018 14:25:46 +0530
[Message part 4 (text/plain, inline)]
Related to bug#29619.

The function documentation of xref-find-references says:

    Find references to the identifier at point. With prefix argument,
prompt for
    the identifier.

The Emacs manual (Node: Identifier Search) says:

    ‘M-?’ finds all the references for the identifier at point. If there’s
no
    identifier at point, or when invoked with a prefix argument, the command
    prompts for the identifier, with completion.


Inconsistent to both, the actual behaviour of xref-find-references and M-?
is to
*always* prompt for the identifier from the user (irrespective of whether
it is
invoked with or without the prefix-arg). The only way to get the documented
behaviour is by customizing xref-prompt-for-identifier, and there is no way
of
discovering this without reading the source code.
[Message part 5 (text/html, inline)]

This bug report was last modified 6 years and 322 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.