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#69266: 30.0.50; bibtex-parse-entry misreads escaped \} Date: Fri, 23 Feb 2024 09:25:52 -0600 Message-ID: <87a5nr9p8f.fsf@gnu.org> References: <87cysshl3j.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14529"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Ihor Radchenko , 69266@debbugs.gnu.org To: Arash Esbati Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Feb 23 16:38:17 2024 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 1rdXcv-0003Y6-Na for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 23 Feb 2024 16:38:17 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rdXcI-0002Yc-AN; Fri, 23 Feb 2024 10:37:38 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rdXRf-00087Z-02 for bug-gnu-emacs@gnu.org; Fri, 23 Feb 2024 10:26:39 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rdXRe-0003Ky-ND for bug-gnu-emacs@gnu.org; Fri, 23 Feb 2024 10:26:38 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rdXS2-0000yJ-6W for bug-gnu-emacs@gnu.org; Fri, 23 Feb 2024 10:27:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Roland Winkler Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 23 Feb 2024 15:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69266 X-GNU-PR-Package: emacs Original-Received: via spool by 69266-submit@debbugs.gnu.org id=B69266.17087019893652 (code B ref 69266); Fri, 23 Feb 2024 15:27:02 +0000 Original-Received: (at 69266) by debbugs.gnu.org; 23 Feb 2024 15:26:29 +0000 Original-Received: from localhost ([127.0.0.1]:47851 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rdXRT-0000wn-C3 for submit@debbugs.gnu.org; Fri, 23 Feb 2024 10:26:29 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:46660) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rdXRP-0000wJ-EE for 69266@debbugs.gnu.org; Fri, 23 Feb 2024 10:26:25 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rdXQv-0003Au-Qt; Fri, 23 Feb 2024 10:25:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=lOJ4EO9yKmTVDC0mR2qNrirflozj++WmyyP4jlPqoi0=; b=a+lG81HvJi5xj2yOfZRS +5CoNpslf+NU51/FfZPwuV5tvESXqE0p/b05oEdgpTCAwl1m/9J6iosDTEQHwSrAVIgYsD8UTI4dn /JMlhBPhfpVrG1SNqxdt9zKL8BUImIu1CJ3KU2kYJqmDiMSGjwS2427/hwm1TnEpDraSJ0CxY06re qTb6NRIlJnw3YA3HIhOqivnQMj0NtCOH4OiCXym+isJJ69RIPfjLIGNWhcloIEXa4adkzn01s4Kii DjNeJRvIInKsz7FNkCw9wRvaaZif02KVZVySi+WShLd4Qy/e7zqAAV1LsH4sOQTSqLr3QkXnTDQAQ hByeMtZGW+TyDA==; In-Reply-To: (Arash Esbati's message of "Fri, 23 Feb 2024 13:07:51 +0100") 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:280499 Archived-At: Ihor Radchenko writes: > According to https://www.bibtex.org/SpecialSymbols/, characters that > conflict with Bibtex format description can be \-escaped. I believe the above webpage is incorrect. If I put something like \} into a BibTeX field, BibTeX complains about unbalanced braces. This is with BibTeX, Version 0.99d (TeX Live 2022/Debian). The parsing algoritm used by BibTeX is very simple. Generally, BibTeX fields should contain valid LaTeX code. So something like title = "$\}$tex", should work with BibTeX, but it gives the same error message "unbalanced braces". Emacs bibtex mode follows the capabilities of BibTeX itself. I believe it would not make sense to try to be smarter than that if, in the end, this is not compatible anymore with BibTeX itself. I guess one could submit here a bug report / feature request for BibTeX. But BibTeX has been around for many decades with this limited feature set. Nowadays, there is also biblatex. It's intended as a successor for BibTeX. But it is something I know little to nothing about because in my world (physics), everyone I know still uses BibTeX. Essentially, biblatex entries still use the same format as BibTeX entries. I do not know whether biblatex would deal with something like the above in a smarter way. These BibTeX fields should contain valid LaTeX code. But from (La)TeX's perspective, in the string "$\}$" the backslash is not an escape character for what follows, but \} is a macro that's defined inside TeX math mode. Also, the meaning of the statement "valid LaTeX code" can be heavily redefined within (La)TeX. Take a look at texinfo files that TeX can digest. So a smart BibTeX parser would require (La)TeX itself working in the background. In practical terms (for many years) I have never experienced this to be a constraint when working with BibTeX. So changing / improving this may have a low priority among BibTeX / biblatex maintainers.