]> git.eshelyaron.com Git - emacs.git/commitdiff
bibtex-braced-string-syntax-table: fix bug #68477
authorRoland Winkler <winkler@gnu.org>
Tue, 7 Jan 2025 17:56:48 +0000 (11:56 -0600)
committerEshel Yaron <me@eshelyaron.com>
Wed, 8 Jan 2025 08:58:02 +0000 (09:58 +0100)
* lisp/textmodes/bibtex.el (bibtex-braced-string-syntax-table):
Give all parentheses the syntax punctuation so that we do not
choke because of unbalanced parentheses other than braces (bug

(cherry picked from commit 1ef7deb2f723f9129135e8676366d79eee83e870)

lisp/textmodes/bibtex.el

index 0ea72e3abe9bdceefaa04800ebacf32a88da88a7..a8f803f7313dde3fe7776dbcca2036d13f043b32 100644 (file)
@@ -1880,12 +1880,15 @@ BibTeX field as necessary."
 
 (defconst bibtex-braced-string-syntax-table
   (let ((st (make-syntax-table)))
+    ;; Give all parentheses the syntax punctuation so that we do not choke
+    ;; because of unbalanced parentheses other than braces (bug #68477).
+    (map-char-table
+     (lambda (key value)
+       (if (memq (car value) '(4 5)) ; 4 = open parenthesis, 5 = close
+           (modify-syntax-entry key "." st)))
+     st)
     (modify-syntax-entry ?\{ "(}" st)
     (modify-syntax-entry ?\} "){" st)
-    (modify-syntax-entry ?\[ "." st)
-    (modify-syntax-entry ?\] "." st)
-    (modify-syntax-entry ?\( "." st)
-    (modify-syntax-entry ?\) "." st)
     (modify-syntax-entry ?\\ "." st)
     (modify-syntax-entry ?\" "." st)
     st)