auctex-devel
[Top][All Lists]

## Re: [AUCTeX-devel] amsrefs support in reftex

 From: Tassilo Horn Subject: Re: [AUCTeX-devel] amsrefs support in reftex Date: Fri, 16 Oct 2015 12:16:46 +0200 User-agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.0.50 (gnu/linux)

Marcin Borkowski <address@hidden> writes:

>> Uh, that sounds quite complicated to integrate into RefTeX.
>> Basically, you have to have something similar to
>> reftex-parse-bibtex-entry' or reftex-parse-bibitem' for amsrefs
>> entries which knows about custom entry types and fields.
>
> Well, what I would like to have is not really /that/ complicated (or
> so I hope).  The thing I would really like to have is that when the
> point is on a \cite (and btw, amsrefs has a bit different syntax for
> \cite; this seems insane, but it's not), I can see some details of the
> bib entry in the echo area.  I hear that RefTeX can do that (I haven't
> tried it yet).

Yes, it does that.

,----[ C-h v reftex-auto-view-crossref RET ]
| reftex-auto-view-crossref is a variable defined in ‘reftex-vars.el’.
| Its value is t
|
| Documentation:
| Non-nil means, initially turn automatic viewing of crossref info on.
| Automatic viewing of crossref info normally uses the echo area.
| Whenever point is idle for more than ‘reftex-idle-time’ seconds on the
| argument of a \ref or \cite macro, and no other message is being
| displayed, the echo area will display information about that cross
| reference.  You can also set the variable to the symbol ‘window’.  In
| this case a small temporary window is used for the display.
| This feature can be turned on and off from the menu
| (Ref->Options).
|
| You can customize this variable.
----

That's basically all implemented in reftex-dcr.el (dcr = display
cross-ref).

> Well, this could be easily implemented using eldoc (at least in simple
> cases, where the bibliography is in the same file as the document; but
> even if not, this doesn't seem extremely hard).  Maybe I should do
> /this/ first, since I really, really need this - I can live without
> it, but it's very inefficient.  (What I need is to be able to
> determine quickly whether the reference I'm on points to a paper or a
> book.)
>
> But using eldoc when RefTeX exists seems wrong.
>
> OTOH, the parsing functions which find the bib entry /somewhere/ and
> extract information from it would be the same anyway.

In theory, yes.  The thing you want to do seems to be quite doable with
eldoc.  But if you also want to have support for reftex-citation' and
friends, then you need a real integration.

> BTW, this leads to another problem: general parsing of (La)TeX by
> Emacs.  AFAICT, AUCTeX doesn't really have this.

(La)TeX is not parsable. ;-)

> There is TeX-macro-boundaries, but it deals with "macros", i.e.,
> control sequences /with parameters/.  What I would like to start with
> would be /tokens/ (in TeX's meaning, which is made a bit difficult
> because of the whitespace-after-control-word issue and because of the
> blank-line-is-a-par issue).

Another issue is catcodes.  You can change the meaning of any character
at any place, and it's hard to keep track of that.  Basically, I can
assume a working (La)TeX parser which could parse a file from the
beginning to the end.  The problem is that you rarely want to do that
but are only concerned about the region around point.

> In fact, I wrote some functions to deal with that (they almost work, I
> discovered yet another bug yesterday), and used them for one nice
> thing (see https://github.com/mbork/tex-plus.el and especially the
> functions with "delimiter" in their name) - but that's another story,
> though I'd like to see that integrated into AUCTeX, too.

Looks interesting.

Bye,
Tassilo