[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#62997: 13.1.10; LaTeX-xparse-macro-parse in xparse.el fails when ope

From: Arash Esbati
Subject: bug#62997: 13.1.10; LaTeX-xparse-macro-parse in xparse.el fails when opening a LaTeX file
Date: Fri, 21 Apr 2023 20:28:43 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

Yuki Nishida <nishida@rsworks.jp> writes:

> In a particular environment, opening a LaTeX file for the first time
> fails with the *Backtrace* buffer that says LaTeX-xparse-macro-parse
> fails with (scan-error “Unbalanced parentheses” ...)
> It seems to be caused by an xparse macro definition containing '(' as
> a token in an argument's specification like:
> \NewDocumentCommand\FOO{>{\SplitArgument{1}{(}}m}
> I suspect the implementation interprets '(}' as balanced parentheses
> and causes the scan-error.

Thanks for the report.  Can you please apply this patch to xparse.el and
report back if it solves the issue?

--8<---------------cut here---------------start------------->8---
diff --git a/style/xparse.el b/style/xparse.el
index 397a0c4b..ca70fd68 100644
--- a/style/xparse.el
+++ b/style/xparse.el
@@ -128,7 +128,8 @@ TYPE is one of the symbols mac or env."
                 ;; over [>=] and a balanced {}
                 ((looking-at-p "[>=]")
                  (forward-char 1)
-                 (forward-sexp))
+                 (with-syntax-table (TeX-search-syntax-table ?\{ ?\})
+                   (forward-sexp)))
                 ;; Mandatory arguments:
                 ;; m: Ask for input with "Text" as prompt
                 ((looking-at-p "m")
--8<---------------cut here---------------end--------------->8---

TIA.  Best, Arash

reply via email to

[Prev in Thread] Current Thread [Next in Thread]