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: Thu, 25 Aug 2022 08:52:55 -0400 Message-ID: References: <87mtbw4acj.fsf@gnus.org> <87zgftqbam.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="5799"; 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 Thu Aug 25 14: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 1oRCNO-00014Y-Tt for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 25 Aug 2022 14:54:27 +0200 Original-Received: from localhost ([::1]:40700 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oRCNN-000248-B8 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 25 Aug 2022 08:54:25 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42244) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oRCN2-00021y-2B for bug-gnu-emacs@gnu.org; Thu, 25 Aug 2022 08:54:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59604) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oRCN0-0003XB-Ii for bug-gnu-emacs@gnu.org; Thu, 25 Aug 2022 08:54:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oRCN0-00074v-EN for bug-gnu-emacs@gnu.org; Thu, 25 Aug 2022 08:54: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: Thu, 25 Aug 2022 12:54: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.166143198527143 (code B ref 50202); Thu, 25 Aug 2022 12:54:02 +0000 Original-Received: (at 50202) by debbugs.gnu.org; 25 Aug 2022 12:53:05 +0000 Original-Received: from localhost ([127.0.0.1]:49353 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oRCM5-00073j-7r for submit@debbugs.gnu.org; Thu, 25 Aug 2022 08:53:05 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:16821) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oRCM4-00073B-4p for 50202@debbugs.gnu.org; Thu, 25 Aug 2022 08:53:04 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id B5218441003; Thu, 25 Aug 2022 08:52:58 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 60DA9440FFE; Thu, 25 Aug 2022 08:52:57 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1661431977; bh=nJxbdYBK43pOQbdMp9t9moa7FPNcYVe+t416VE0p1J8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=RNUkNqwfM55LQLYDS/CzfD3+6YYvHyLlqsQVLZ72aI/nmB5f74JLicNGYw6CLc7iY wePx6k+DtRziRoCVbO/s+xtxwfIdMP8rEKsXgUbbejodDeSwmtB5JwJaVGX7bxbxmd hrzBEQrV9kMux5CL/7Rxvn2KV/QgpOh3SIy94OX852tsz8dJlTBIV00hxyhL+WM707 DbRbRf+1Y7HNI76PXP2Yt5iHlxR49wlkYjgOwlxOHERgz8T4WeE00HEVNrMzgfeHwO Goro/oqO3CLqoh2KSpl8ftcCwc8W3VoOnqfMmMF2u7TbI8Oeuht4iUy7apO7lHA0gg 55PDtS4ORI1Gg== Original-Received: from pastel (unknown [45.72.195.111]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 228DC120230; Thu, 25 Aug 2022 08:52:57 -0400 (EDT) In-Reply-To: <87zgftqbam.fsf@gnu.org> (Roland Winkler's message of "Wed, 24 Aug 2022 21:58:25 -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:240704 Archived-At: >>> - 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