GNU bug report logs -
#50202
bibtex-mode: unescaped dollar sign in file field leads to wrong highlighting
Previous Next
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 #23 received at 50202 <at> debbugs.gnu.org (full text, mbox):
On Thu, Aug 25 2022, Stefan Monnier wrote:
> The downside of treating $ as punctuation is that $^2$ won't be
> highlighted specially, but the upside is that "foo$bar" won't be
> mishighlighted in a url.
>
> To me the highlighting of math formulas is sufficiently secondary that
> I'd err on the safe side (i.e. avoid mishighlighting).
For me, the situation is opposite: in my BibTeX files (with quite many
entries that have accumulated over the years), many entries contain
LaTeX constructs like $^2$ so that I appreciate proper highlighting.
But I never encountered the opposite problem when a field should contain
a single $.
> The other option is to try and make this choice on a field-by-field
> basis, which seems like a lot of work for fairly little benefit.
I agree it doesn't make sense to (try to) highlight different fields
differently. That's why I suggest that bibtex-mode continues to use
only one syntax table. But make it customizable how this syntax table
treats $: You and the OP can make it a punctuation character (also fine
with me as default, it doesn't cause harm), while it remains possible to
keep the current behavior.
Roland
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.