unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Roland Winkler <winkler@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Lars Ingebrigtsen <larsi@gnus.org>,
	50202@debbugs.gnu.org, Yuu Yin <yuuyin@protonmail.com>
Subject: bug#50202: bibtex-mode: unescaped dollar sign in file field leads to wrong highlighting
Date: Fri, 26 Aug 2022 10:52:55 -0500	[thread overview]
Message-ID: <87r113knmw.fsf@gnu.org> (raw)
In-Reply-To: <jwvfshk2pke.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Thu, 25 Aug 2022 13:41:00 -0400")

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





  reply	other threads:[~2022-08-26 15:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-25 17:48 bug#50202: bibtex-mode: unescaped dollar sign in file field leads to wrong highlighting Yuu Yin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-22 14:33 ` Lars Ingebrigtsen
2022-08-25  2:58   ` Roland Winkler
2022-08-25 12:52     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-25 16:36       ` Roland Winkler
2022-08-25 17:41         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-26 15:52           ` Roland Winkler [this message]
2022-08-26 19:00             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-29 15:19               ` Roland Winkler
2022-12-30  5:49                 ` Roland Winkler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r113knmw.fsf@gnu.org \
    --to=winkler@gnu.org \
    --cc=50202@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=yuuyin@protonmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).