[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [AUCTeX-devel] Feature Request

From: Mosè Giordano
Subject: Re: [AUCTeX-devel] Feature Request
Date: Fri, 18 Dec 2015 22:57:24 +0100

Hi Tassilo,

2015-12-18 22:12 GMT+01:00 Tassilo Horn <address@hidden>:
>> Anyway, AUCTeX holds the list of known bibliography items in
>> `LaTeX-bibitem-list',
> That only contains the \bibitems of a thebibliography environment, not
> the entries of standalone bibtex files.

Uh, it does for me:  "auto/bibliography.el" file, associated to
"bibliography.bib", contains

--8<---------------cut here---------------start------------->8---
 (lambda ()
--8<---------------cut here---------------end--------------->8---

This is done by `BibTeX-auto-store', that is added to
`bibtex-mode-hook' by tex-site.el.  But yes, this relies on the
bibliography file having being edited beforehand.

>> but I'm not expert enough of font-locking to implement this feature
>> without some hints.
> It shouldn't be overly hard in general, i.e., you write 2 functions
> `font-latex-match-(un)known-citation' which search for the next
>   "\\\\cite{\\([[:alnum:]:-]+\\)}"
> [1] where the group 1 is (not) contained in the hash-table.  Then these
> functions could be used as font-lock matchers, e.g.
>   (font-latex-match-known-citation 1 font-latex-known-citation-face)
>   (font-latex-match-unknown-citation 1 font-latex-unknown-citation-face)

Thanks for the hint!

> The only problem I see is with updates.  Point one is that we don't get
> notifications about updates of bibtex entries, and re-computing all keys
> can be slow.  I have a rfc.bib which contains all IETF RFCs amounting to
> almost 100.000 lines.  Extracting all entries from that file takes about
> 3 seconds.  However, `reftex-extract-bib-entries' does much more than
> just extracting the keys, so we could easily add a much faster version
> just for that purpose and then update the hash-table in an
> `after-save-hook' or so.

This function should go into RefTeX, right?

I'll try to have a look to this feature now that I know where to
start, but not really soon, I'm pretty busy in this period.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]