[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to define xref-find-definitions for a new mode?
From: |
Marcin Borkowski |
Subject: |
Re: How to define xref-find-definitions for a new mode? |
Date: |
Fri, 15 Jun 2018 06:49:43 +0200 |
User-agent: |
mu4e 1.1.0; emacs 27.0.50 |
On 2018-06-11, at 17:13, Eli Zaretskii <eliz@gnu.org> wrote:
>> From: Marcin Borkowski <mbork@mbork.pl>
>> Cc: help-gnu-emacs@gnu.org
>> Date: Mon, 11 Jun 2018 05:22:26 +0200
>>
>> >> > (Btw, doesn't it already work? Etags is an existing back-end for
>> >> > Xref, and 'etags' the program already supports TeX and its
>> >> > derivatives, so it is able to create TAGS tables for LaTeX files.)
>> >>
>> >> Well, possibly, but I'd like it to work like for Elisp or JavaScript,
>> >> without a TAGS table.
>> >
>> > Is this likely to happen? Lisp and JavaScript know where to find
>> > functions and variables because they keep that information as part of
>> > defining them. I don't think TeX does anything similar, does it?
>>
>> Why couldn't it (at least in theory)? If etags can do it, why not
>> Emacs?
>
> You said "no TAGS", so do you mean you want to rewrite the TeX part of
> etags in Lisp, and make that run in real-time, when the user types
> "M-."? Won't this be too slow.
Well, it works with JS pretty well (I don't know how it's implemented,
though).
>> >> Also, I want it to go to \label when on \ref, to \bib / \bibitem
>> >> when on \cite etc.
>> >
>> > Are you sure it doesn't work already? E.g., if \label is tagged, then
>> > "M-." on the tag's name at \ref should go to the label's definition.
>>
>> Well, apparently it doesn't without the TAGS file. And even with it,
>> I couldn't make it to work. Also, amsrefs is not suppported.
>
> Then my suggestion would be to extend etags to support that. That way
> you won't be starting from scratch.
Well, in that case I'll pass for now. Etags is written in C, which
I don't speak very well. (Learning it better would be great, but
I don't have enough time for that now.)
Thanks,
--
Marcin Borkowski
http://mbork.pl
- How to define xref-find-definitions for a new mode?, Marcin Borkowski, 2018/06/09
- Re: How to define xref-find-definitions for a new mode?, Eli Zaretskii, 2018/06/09
- Re: How to define xref-find-definitions for a new mode?, Marcin Borkowski, 2018/06/09
- Re: How to define xref-find-definitions for a new mode?, Eli Zaretskii, 2018/06/09
- Re: How to define xref-find-definitions for a new mode?, Marcin Borkowski, 2018/06/10
- Re: How to define xref-find-definitions for a new mode?, Eli Zaretskii, 2018/06/11
- Re: How to define xref-find-definitions for a new mode?,
Marcin Borkowski <=
- Re: How to define xref-find-definitions for a new mode?, Eli Zaretskii, 2018/06/15
- Re: How to define xref-find-definitions for a new mode?, Marcin Borkowski, 2018/06/15
- Re: How to define xref-find-definitions for a new mode?, Dmitry Gutov, 2018/06/12