auctex-devel
[Top][All Lists]

Re: [AUCTeX-devel] Feature Request

 From: Mosè Giordano Subject: Re: [AUCTeX-devel] Feature Request Date: Fri, 18 Dec 2015 23:05:46 +0100

```2015-12-18 22:53 GMT+01:00 Tassilo Horn <address@hidden>:
>
>>>>    > I have been recommended to mail the list with a feature request, I
>>>>    > hope this is the right place.
>>>>
>>>>    > Currently if file.tex has \cite{ref2} and ref2 does not exist in the
>>>>    > bib file, it displays no differently to \cite{ref1} which does.
>>>>
>>>>    > Is it possible to get some sort of visual indication that ref2
>>>>    > does not exist in the bib file? A red squiggly line, highlight,
>>>>    > different colour, something?
>>
>> This would be a very nice feature.  RefTeX basically has the
>> functionality to know which citations are available in the bib file(s).
>> See `reftex-extract-bib-entries' and
>> `reftex-extract-bib-entries-from-thebibliography'.
>>
>> So we could add some variable like `reftex-known-bibtex-entry-keys'
>> containing all known reftex entry keys.  I guess a hash-table would be
>> best because we need a fast contains-check.
>
> I just had a better idea: We could just collect the _undefined_
> references and citations in `TeX-LaTeX-sentinel' and friends.  We
> already parse LaTeX output of these forms
>
>   LaTeX Warning: Reference `foolabel' on page 1 undefined on input line 6.
>   LaTeX Warning: Citation `barcite' on page 1 undefined on input line 8.
>
> just don't do much with that information except for noticing that we
> have to run bibtex and latex again.
>
> Then we could have that feature also without font-lock.  We know the
> undefined labels and citations and the lines they are in, so we could
> just use overlays (which would make the feature Emacs-specific) and
> update them after a LaTeX run (or the last LaTeX run in
> `TeX-command-run-all').

Actually, something like this is one of the entry of the wishlist:

Improvements to error reporting
Fringe indicators for errors in the main text would be nice.

That is, something like flymake/flycheck, but builtin in AUCTeX.  Ok,
it won't be on-the-fly,[1] but when I look for errors/warnings after
compilation I often miss this feature.

Bye,
Mosè

Note:
[1] Given that a full run of the tex compiler can be very slow, even
with draft-mode enabled, and one needs to actually compile more than
once to get correct errors/warnings, a real on-the-fly syntax checker
based on tex compilers (not on other, simpler, external tools) is far
from becoming true anyway.

```