From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#50202: bibtex-mode: unescaped dollar sign in file field leads to wrong highlighting Date: Fri, 26 Aug 2022 15:00:31 -0400 Message-ID: References: <87mtbw4acj.fsf@gnus.org> <87zgftqbam.fsf@gnu.org> <87sflkjn5i.fsf@gnu.org> <87r113knmw.fsf@gnu.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28616"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Lars Ingebrigtsen , 50202@debbugs.gnu.org, Yuu Yin To: Roland Winkler Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Aug 26 21:01:13 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 1oReZt-0007LC-2n for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 26 Aug 2022 21:01:13 +0200 Original-Received: from localhost ([::1]:43914 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oReZr-00065Q-O5 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 26 Aug 2022 15:01:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43560) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oReZi-000659-Gu for bug-gnu-emacs@gnu.org; Fri, 26 Aug 2022 15:01:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36542) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oReZi-0001pm-7l for bug-gnu-emacs@gnu.org; Fri, 26 Aug 2022 15:01:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oReZi-0006pT-3U for bug-gnu-emacs@gnu.org; Fri, 26 Aug 2022 15:01:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 26 Aug 2022 19:01:02 +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.166154044226205 (code B ref 50202); Fri, 26 Aug 2022 19:01:02 +0000 Original-Received: (at 50202) by debbugs.gnu.org; 26 Aug 2022 19:00:42 +0000 Original-Received: from localhost ([127.0.0.1]:54521 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oReZN-0006oa-Te for submit@debbugs.gnu.org; Fri, 26 Aug 2022 15:00:42 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:5766) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oReZL-0006oN-Ex for 50202@debbugs.gnu.org; Fri, 26 Aug 2022 15:00:40 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id C3D584418B2; Fri, 26 Aug 2022 15:00:33 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 5DB6744183D; Fri, 26 Aug 2022 15:00:32 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1661540432; bh=6J3Y4pNMJ7yC5T09R+ZGZ825zwljIV2JXnTHs3SOIAw=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=iHeObIfhyDAezIeBYUo2vbvLVIMfoDaTHbWT38a0Wj+vsibx+LADFcyrCK/TjRxOs k/RQLOEMd+sRoGW2HCad8/VFGzAwdB3lBgIXzQe3UwRrKm5K1LH2rtPyZ9L5TUfP01 RPDwjheJ/yUvOP3Hhqj494DnBYlROFZFGxn6/iXfNQ2z8ISc1FyA/paauxvErJ2UMA G7G3bRb+6xL14hVjC614tZTEc7I2NoigzESdlfpeICEzOoyQxmw7AbCa4U8Ukj2stk XKQldMCdoJtFRwFHuxd/3fpiKLyhGM8Zij/9YIf1FGkv8wDTdeb6dzuFmRps3hGgyf L+7EmB3YPWVyw== Original-Received: from pastel (unknown [45.72.195.111]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 24C9D1202C2; Fri, 26 Aug 2022 15:00:32 -0400 (EDT) In-Reply-To: <87r113knmw.fsf@gnu.org> (Roland Winkler's message of "Fri, 26 Aug 2022 10:52:55 -0500") 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:240857 Archived-At: > 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 $. My BibTeX file is in the same boat as yours, but I don't find the highlighting of those thingies important at all. The $ signs themselves are more than enough to clarify visually what is what, since the text between them is invariably short. >> 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. Another option is to mark $ as punctuation and then rely instead on `font-lock-keywords` to highlight something like "\\$[^$\n]+\\$". So $^2$ would still be highlighted in URLs but "foo$bar" wouldn't. Stefan