From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Roland Winkler Newsgroups: gmane.emacs.bugs Subject: bug#50202: bibtex-mode: unescaped dollar sign in file field leads to wrong highlighting Date: Fri, 26 Aug 2022 10:52:55 -0500 Message-ID: <87r113knmw.fsf@gnu.org> References: <87mtbw4acj.fsf@gnus.org> <87zgftqbam.fsf@gnu.org> <87sflkjn5i.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27681"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Lars Ingebrigtsen , 50202@debbugs.gnu.org, Yuu Yin To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Aug 26 17:54:31 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oRbfA-00070J-2F for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 26 Aug 2022 17:54:28 +0200 Original-Received: from localhost ([::1]:50568 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oRbf9-0006mV-02 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 26 Aug 2022 11:54:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57098) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oRbev-0006kN-Ep for bug-gnu-emacs@gnu.org; Fri, 26 Aug 2022 11:54:13 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36379) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oRbek-0003kt-9m for bug-gnu-emacs@gnu.org; Fri, 26 Aug 2022 11:54:12 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oRbej-0001V0-Rq for bug-gnu-emacs@gnu.org; Fri, 26 Aug 2022 11:54:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Roland Winkler Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 26 Aug 2022 15:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50202 X-GNU-PR-Package: emacs Original-Received: via spool by 50202-submit@debbugs.gnu.org id=B50202.16615291865615 (code B ref 50202); Fri, 26 Aug 2022 15:54:01 +0000 Original-Received: (at 50202) by debbugs.gnu.org; 26 Aug 2022 15:53:06 +0000 Original-Received: from localhost ([127.0.0.1]:54361 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oRbdp-0001SV-Qm for submit@debbugs.gnu.org; Fri, 26 Aug 2022 11:53:06 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:50396) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oRbdn-0001Rz-UH for 50202@debbugs.gnu.org; Fri, 26 Aug 2022 11:53:04 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:56342) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oRbdi-0003fJ-09; Fri, 26 Aug 2022 11:52:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=uspa3XIZ2PRmw1aNBNBb/qKJAM5bHsvUNDKkaZ8TGJo=; b=lstOD0arciZIQf0Fbe5F RobJ+WjXAYDwHku3ZZMi7wMQB9wOdLsyFXu7b1ags+04VU53LzZa2N3MLKwRfH1SHe87o1frt2RLO h7jp8i/azZtyhIPK6Q94NGhidGxYMtIqa0Q2YbpXPW7mK5XEmb8mFAoTGzE8xmZgkqQhlszMxBx9E /5DUK0M4XBihBNImTRZg/O5bQrUDeKbpdGQQLzRhl6mL7Cbz2VlKHMG3VNG6msi/YxPEPd1RdBerc 92DcuyEGoRxJoJtzq0rHqlnS777Vuv1uhT7yPZ+jHtZ+TlDpuTcW2jiqlKWhZLQsFA4JlDE1i9N2d izeIEyeGTT1oWg==; Original-Received: from [131.156.156.74] (port=45648 helo=regnitz) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oRbdh-0006bO-NO; Fri, 26 Aug 2022 11:52:57 -0400 In-Reply-To: (Stefan Monnier's message of "Thu, 25 Aug 2022 13:41:00 -0400") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:240847 Archived-At: 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