* xref-find-definitions
@ 2021-02-24 18:30 Leo Butler
2021-02-24 18:58 ` xref-find-definitions Dmitry Gutov
2021-02-25 8:43 ` xref-find-definitions Philip Kaludercic
0 siblings, 2 replies; 6+ messages in thread
From: Leo Butler @ 2021-02-24 18:30 UTC (permalink / raw)
To: Emacs
What is the name of the regexp used by xref-find-definitions to determine
the identifier? I have looked in xref.el, but I don't see any way to do
this.
Leo
PS:
M-. runs the command xref-find-definitions (found in global-map),
which is an autoloaded interactive compiled Lisp function in
‘xref.el’.
It is bound to M-., <menu-bar> <edit> <goto> <xref-find-def>.
(xref-find-definitions IDENTIFIER)
Probably introduced at or before Emacs version 25.1.
Find the definition of the identifier at point.
With prefix argument or when there’s no identifier at point,
prompt for it.
If sufficient information is available to determine a unique
definition for IDENTIFIER, display it in the selected window.
Otherwise, display the list of the possible definitions in a
buffer where the user can select from the list.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: xref-find-definitions
2021-02-24 18:30 xref-find-definitions Leo Butler
@ 2021-02-24 18:58 ` Dmitry Gutov
2021-02-24 19:38 ` xref-find-definitions Leo Butler
2021-02-25 8:43 ` xref-find-definitions Philip Kaludercic
1 sibling, 1 reply; 6+ messages in thread
From: Dmitry Gutov @ 2021-02-24 18:58 UTC (permalink / raw)
To: Leo Butler, Emacs
Hi!
On 24.02.2021 20:30, Leo Butler wrote:
> What is the name of the regexp used by xref-find-definitions to determine
> the identifier? I have looked in xref.el, but I don't see any way to do
> this.
It depends on the current xref backend in use.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: xref-find-definitions
2021-02-24 18:58 ` xref-find-definitions Dmitry Gutov
@ 2021-02-24 19:38 ` Leo Butler
2021-02-24 21:48 ` xref-find-definitions Dmitry Gutov
0 siblings, 1 reply; 6+ messages in thread
From: Leo Butler @ 2021-02-24 19:38 UTC (permalink / raw)
To: Emacs
Dmitry Gutov <dgutov@yandex.ru> writes:
> On 24.02.2021 20:30, Leo Butler wrote:
>> What is the name of the regexp used by xref-find-definitions to determine
>> the identifier? I have looked in xref.el, but I don't see any way to do
>> this.
>
> It depends on the current xref backend in use.
How do I determine which backend is in use?
I am using a TAGS table, if that helps.
Leo
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: xref-find-definitions
2021-02-24 19:38 ` xref-find-definitions Leo Butler
@ 2021-02-24 21:48 ` Dmitry Gutov
0 siblings, 0 replies; 6+ messages in thread
From: Dmitry Gutov @ 2021-02-24 21:48 UTC (permalink / raw)
To: Leo Butler, Emacs
On 24.02.2021 21:38, Leo Butler wrote:
> How do I determine which backend is in use?
> I am using a TAGS table, if that helps.
Then it must be the etags backend.
Check out the definition of 'find-tag--default'.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: xref-find-definitions
2021-02-24 18:30 xref-find-definitions Leo Butler
2021-02-24 18:58 ` xref-find-definitions Dmitry Gutov
@ 2021-02-25 8:43 ` Philip Kaludercic
2021-02-25 12:38 ` xref-find-definitions Dmitry Gutov
1 sibling, 1 reply; 6+ messages in thread
From: Philip Kaludercic @ 2021-02-25 8:43 UTC (permalink / raw)
To: Leo Butler; +Cc: Emacs
[-- Attachment #1: Type: text/plain, Size: 1186 bytes --]
Leo Butler <leo.butler@umanitoba.ca> writes:
> What is the name of the regexp used by xref-find-definitions to determine
> the identifier? I have looked in xref.el, but I don't see any way to do
> this.
Depending on the backend, it will call the method
xref-backend-identifier-at-point, that defaults to symbol-at-point, so
it doesn't use a regular expression in that sense.
> Leo
>
> PS:
>
> M-. runs the command xref-find-definitions (found in global-map),
> which is an autoloaded interactive compiled Lisp function in
> ‘xref.el’.
>
> It is bound to M-., <menu-bar> <edit> <goto> <xref-find-def>.
>
> (xref-find-definitions IDENTIFIER)
>
> Probably introduced at or before Emacs version 25.1.
>
> Find the definition of the identifier at point.
> With prefix argument or when there’s no identifier at point,
> prompt for it.
>
> If sufficient information is available to determine a unique
> definition for IDENTIFIER, display it in the selected window.
> Otherwise, display the list of the possible definitions in a
> buffer where the user can select from the list.
>
>
>
--
Philip K.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 686 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: xref-find-definitions
2021-02-25 8:43 ` xref-find-definitions Philip Kaludercic
@ 2021-02-25 12:38 ` Dmitry Gutov
0 siblings, 0 replies; 6+ messages in thread
From: Dmitry Gutov @ 2021-02-25 12:38 UTC (permalink / raw)
To: Philip Kaludercic, Leo Butler; +Cc: Emacs
On 25.02.2021 10:43, Philip Kaludercic wrote:
> Depending on the backend, it will call the method
> xref-backend-identifier-at-point, that defaults to symbol-at-point, so
> it doesn't use a regular expression in that sense.
symbol-at-point ultimately delegates to forward-symbol, which uses
certain regexps.
But find-tag--default also adds a few ways the major mode can override
the bounds-finding logic.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-02-25 12:38 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-24 18:30 xref-find-definitions Leo Butler
2021-02-24 18:58 ` xref-find-definitions Dmitry Gutov
2021-02-24 19:38 ` xref-find-definitions Leo Butler
2021-02-24 21:48 ` xref-find-definitions Dmitry Gutov
2021-02-25 8:43 ` xref-find-definitions Philip Kaludercic
2021-02-25 12:38 ` xref-find-definitions Dmitry Gutov
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).