Re: reftex completing bibtex keys
Tassilo Horn <tassilo <at> member.fsf.org>
2012-07-18 19:35:54 GMT
Marcus Frings <iam-est-hora-surgere <at> despammed.com> writes:
>>> Huh, that is weird because I have tab completion here (CVS AUCTeX). I
>>> use `C-C [' and then start to type the first letters of a key and after
>>> pressing TAB I get a *Completions* buffer showing possible keys.
>> Really? Does `C-c [' run the very same function?
>> ,----[ C-h k C-c [ ]
>> | C-c [ runs the command reftex-citation, which is an interactive autoloaded
>> | compiled Lisp function in `reftex-cite.el'.
> Yes, it runs the same function, the only difference is the output of the
> first two lines:
> ,----[ C-h k C-c [ ]
> | C-c [ runs the command reftex-citation, which is an interactive
> | compiled Lisp function.
> (The rest of the description is the same.)
>> And does regex search work in addition to completion?
> Yes, I can either type "FringsTAB" to get a *completions* buffer with a
> possible list of keys like Frings2009, Frings2010 and so on or I just
> type "fringsENTER" and get the *RefTeX Select* buffer where I can mark,
> select complete entries matching "frings".
>> Maybe the difference is that you use the biber patches?
> No idea. I'm just happy that everything is working, hahaha. If
> anyone wants, I can send my emacs_tex.el where I have all my AUCTeX
> configuration stuff.
Not needed, I've isolated the problem. The call (LaTeX-bibitem-list) in
`reftex-extract-bib-entries' returns nil here. `LaTeX-bibitem-list' is
a generated function which calls (TeX-auto-list-information 'bibitem).
That tries to lookup something in `TeX-auto-parser', whose value is:
,----[ C-h v TeX-auto-parser RET ]
| TeX-auto-parser is a variable defined in `tex.el'.
| Its value is (("index-entry" LaTeX-auto-index-entry LaTeX-add-index-entries
| ("bibliography" LaTeX-auto-bibliography LaTeX-add-bibliographies LaTeX-bibliography-list LaTeX-bibliography-changed)
| ("environment" LaTeX-auto-environment LaTeX-add-environments LaTeX-environment-list LaTeX-environment-changed)
| ("bibitem" LaTeX-auto-bibitem LaTeX-add-bibitems LaTeX-bibitem-list LaTeX-bibitem-changed)
| ("label" LaTeX-auto-label LaTeX-add-labels LaTeX-label-list LaTeX-label-changed)
| ("symbol" TeX-auto-symbol TeX-add-symbols TeX-symbol-list TeX-symbol-changed)
| (styles TeX-auto-file TeX-run-style-hooks))
1. Observation: The generated function wants to look up a symbol, but
the alist has string keys for everything except styles? Intended?
2. Even if I change the lookup so that it gets "bibitem" as string,
`reftex-extract-bib-entries' returns nil. It can find an entry, but
the symbol-value of LaTeX-bibitem-list is nil.
All in all, I don't really understand the code and how that auto-stuff
is supposed to work. So please, someone with deeper knowledge of that
code should take a look.