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

Previous Next

Package: emacs;

Reported by: Yuu Yin <yuuyin <at> protonmail.com>

Date: Wed, 25 Aug 2021 19:16:02 UTC

Severity: normal

Done: Roland Winkler <winkler <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #14 received at 50202 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Roland Winkler <winkler <at> gnu.org>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 50202 <at> debbugs.gnu.org,
 Yuu Yin <yuuyin <at> protonmail.com>
Subject: Re: bug#50202: bibtex-mode: unescaped dollar sign in file field
 leads to wrong highlighting
Date: Thu, 25 Aug 2022 08:52:55 -0400
>>> - bibtex-mode enabled,
>>> - and a BibTeX entry which has as value for file field a path that
>>> has dollar sign ~
>>> /path/to/file $ name.ext~
>>>
>>> bibtex-mode doesn't recognizes that the dollar sign is verbatim for
>>> the file field, leading to wrong highlighting.
>>
>> This behaviour is still present in Emacs 29.  Perhaps Roland has some
>> comments; added to the CCs.
>
> 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.

> From a more practical perspective, I need to say that the above problem
> reaches the limits of my knowledge of how font-lock works in general and
> how it deals with the (La)TeX delimiter "$" in particular.

It doesn't deal with $ very well, indeed.

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.


        Stefan





This bug report was last modified 2 years and 139 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.