Tell xref to find definitions in Emacs' source code?

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Tell xref to find definitions in Emacs' source code?

Eric Abrahamsen-2
Hi all,

Has anyone convinced xref to look up elisp definitions in a local git
clone of the Emacs source code, instead of the installed files? I'm
looking at building a tags table in the source directory, and then
adding a function to `elisp-xref-find-def-functions' that would try to
use the tags table to find a symbol in my git clone.

Does anyone have anything like this on hand?

Thanks,
Eric


Reply | Threaded
Open this post in threaded view
|

Re: Tell xref to find definitions in Emacs' source code?

Nick Dokos-3
Eric Abrahamsen <[hidden email]> writes:

> Has anyone convinced xref to look up elisp definitions in a local git
> clone of the Emacs source code, instead of the installed files? I'm
> looking at building a tags table in the source directory, and then
> adding a function to `elisp-xref-find-def-functions' that would try to
> use the tags table to find a symbol in my git clone.
>
> Does anyone have anything like this on hand?
>

Not directly an answer, but have you tried cscope? The emacs interface
is xcscope.el and can be found at https://github.com/dkogan/xcscope.el.

--
Nick


Reply | Threaded
Open this post in threaded view
|

Re: Tell xref to find definitions in Emacs' source code?

Nick Dokos-3
Nick Dokos <[hidden email]> writes:

> Eric Abrahamsen <[hidden email]> writes:
>
>> Has anyone convinced xref to look up elisp definitions in a local git
>> clone of the Emacs source code, instead of the installed files? I'm
>> looking at building a tags table in the source directory, and then
>> adding a function to `elisp-xref-find-def-functions' that would try to
>> use the tags table to find a symbol in my git clone.
>>
>> Does anyone have anything like this on hand?
>>
>
> Not directly an answer, but have you tried cscope? The emacs interface
> is xcscope.el and can be found at https://github.com/dkogan/xcscope.el.

Never mind: for some unfathomable reason, I thought it could index .el files -
it cannot.

--
Nick


Reply | Threaded
Open this post in threaded view
|

Re: Tell xref to find definitions in Emacs' source code?

Eric Abrahamsen-2
Nick Dokos <[hidden email]> writes:

> Nick Dokos <[hidden email]> writes:
>
>> Eric Abrahamsen <[hidden email]> writes:
>>
>>> Has anyone convinced xref to look up elisp definitions in a local git
>>> clone of the Emacs source code, instead of the installed files? I'm
>>> looking at building a tags table in the source directory, and then
>>> adding a function to `elisp-xref-find-def-functions' that would try to
>>> use the tags table to find a symbol in my git clone.
>>>
>>> Does anyone have anything like this on hand?
>>>
>>
>> Not directly an answer, but have you tried cscope? The emacs interface
>> is xcscope.el and can be found at https://github.com/dkogan/xcscope.el.
>
> Never mind: for some unfathomable reason, I thought it could index .el files -
> it cannot.

No worries, thanks for the pointer!


Reply | Threaded
Open this post in threaded view
|

Re: Tell xref to find definitions in Emacs' source code?

Dmitry Gutov
In reply to this post by Eric Abrahamsen-2
On 10/31/17 9:31 PM, Eric Abrahamsen wrote:

> Has anyone convinced xref to look up elisp definitions in a local git
> clone of the Emacs source code, instead of the installed files? I'm
> looking at building a tags table in the source directory, and then
> adding a function to `elisp-xref-find-def-functions' that would try to
> use the tags table to find a symbol in my git clone.
>
> Does anyone have anything like this on hand?

The easiest way to do that is to build that clone and run Emacs from it.

Like ./src/emacs.

The alternative is to add xref-etags-mode to emacs-lisp-mode, and M-x
visit-tags-table. Then you'll just use etags.

Not sure if elisp-xref-find-def-functions can provide a straightforward
alternative.


Reply | Threaded
Open this post in threaded view
|

Re: Tell xref to find definitions in Emacs' source code?

Eric Abrahamsen-2
Dmitry Gutov <[hidden email]> writes:

> On 10/31/17 9:31 PM, Eric Abrahamsen wrote:
>
>> Has anyone convinced xref to look up elisp definitions in a local git
>> clone of the Emacs source code, instead of the installed files? I'm
>> looking at building a tags table in the source directory, and then
>> adding a function to `elisp-xref-find-def-functions' that would try to
>> use the tags table to find a symbol in my git clone.
>>
>> Does anyone have anything like this on hand?
>
> The easiest way to do that is to build that clone and run Emacs from it.
>
> Like ./src/emacs.
>
> The alternative is to add xref-etags-mode to emacs-lisp-mode, and M-x
> visit-tags-table. Then you'll just use etags.
>
> Not sure if elisp-xref-find-def-functions can provide a
> straightforward alternative.

Okay, thanks for the tips. I'll probably just do it the easy way and run
Emacs from the source directory.

Eric


Reply | Threaded
Open this post in threaded view
|

Re: Tell xref to find definitions in Emacs' source code?

Narendra Joshi
Eric Abrahamsen <[hidden email]> writes:

> Dmitry Gutov <[hidden email]> writes:
>
>> On 10/31/17 9:31 PM, Eric Abrahamsen wrote:
>>
>>> Has anyone convinced xref to look up elisp definitions in a local git
>>> clone of the Emacs source code, instead of the installed files? I'm
>>> looking at building a tags table in the source directory, and then
>>> adding a function to `elisp-xref-find-def-functions' that would try to
>>> use the tags table to find a symbol in my git clone.
>>>
>>> Does anyone have anything like this on hand?
>>
>> The easiest way to do that is to build that clone and run Emacs from it.
>>
>> Like ./src/emacs.
>>
>> The alternative is to add xref-etags-mode to emacs-lisp-mode, and M-x
>> visit-tags-table. Then you'll just use etags.
>>
>> Not sure if elisp-xref-find-def-functions can provide a
>> straightforward alternative.
>
> Okay, thanks for the tips. I'll probably just do it the easy way and run
> Emacs from the source directory.
Or you can create a symbolic link (say ~/.local/bin/emacs) that points
to $EMACS_SOURCE_DIR/src/emacs. That's how I have been using it.

--
Narendra Joshi

Reply | Threaded
Open this post in threaded view
|

Re: Tell xref to find definitions in Emacs' source code?

Eric Abrahamsen-2
Narendra Joshi <[hidden email]> writes:

> Eric Abrahamsen <[hidden email]> writes:
>
>> Dmitry Gutov <[hidden email]> writes:
>>
>>> On 10/31/17 9:31 PM, Eric Abrahamsen wrote:
>>>
>>>> Has anyone convinced xref to look up elisp definitions in a local git
>>>> clone of the Emacs source code, instead of the installed files? I'm
>>>> looking at building a tags table in the source directory, and then
>>>> adding a function to `elisp-xref-find-def-functions' that would try to
>>>> use the tags table to find a symbol in my git clone.
>>>>
>>>> Does anyone have anything like this on hand?
>>>
>>> The easiest way to do that is to build that clone and run Emacs from it.
>>>
>>> Like ./src/emacs.
>>>
>>> The alternative is to add xref-etags-mode to emacs-lisp-mode, and M-x
>>> visit-tags-table. Then you'll just use etags.
>>>
>>> Not sure if elisp-xref-find-def-functions can provide a
>>> straightforward alternative.
>>
>> Okay, thanks for the tips. I'll probably just do it the easy way and run
>> Emacs from the source directory.
> Or you can create a symbolic link (say ~/.local/bin/emacs) that points
> to $EMACS_SOURCE_DIR/src/emacs. That's how I have been using it.

Okay, good suggestion!