Subject: bug#50202: bibtex-mode: unescaped dollar sign in file field leads to wrong highlighting

From: Roland Winkler <[email-masked]>
Date: Thu, 25 Aug 2022 11:36:25 -0500

On Thu, Aug 25 2022, Stefan Monnier wrote:
>> A field "file" is, I believe, not part of standard BibTeX.  So the above
>> is somewhat pushing the limits of BibTeX mode.
>
> I think the report/problem would be the same if there was a $ in a
> URL, tho.

Good point.  (A url field is not part of standard BibTeX either, but for
sure it belongs to biblatex.)

> But I wonder how important it is for `bibtex-mode` to try and recognize
> the (La)TeX meaning of the $ character.
> Maybe we should just give $ the punctuation syntax in the syntax-table.

The (La)TeX meaning of the $ character is relevant for titles that my
contain formulas.  The question is what is in the end more acceptable:
formulas in titles that do not receive special treatment by font-lock.
Or $ being mis-treated in url and file fields (which goes beyond these
fields).  Maybe it is best to let the user decide whether $ should be
treated as math delimiter (the default) or as punctation.

Roland