emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: show-paren-mode indicates mismatch for escaped parentheses


From: Juri Linkov
Subject: Re: show-paren-mode indicates mismatch for escaped parentheses
Date: Tue, 25 Oct 2005 23:28:59 +0300
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

> In LaTeX escaped parentheses like \(a^2+b^2=c^2\) are used for marking
> inline math.  `show-paren-mode' indicates mismatches when moving point
> over the opening or closing parentheses.  In order to prevent this, I
> think, it should not try to match an escaped paren in the first place.
> The following patch achieves this by performing the search for a
> matching paren only if an even number of escape chars or none is found
> before the character in question:

Your patch doesn't look right.  I think it is correct that
`show-paren-mode' indicates mismatches on escaped parentheses in
latex-mode, because according to the syntax table of latex-mode,
these parentheses are not matched.  So when you type in latex-mode,
for example, C-M-f (forward-sexp) on them, you will get the error
"Unbalanced parentheses".  `show-paren-mode' just indicates the same
fact in a more visible way.

So you rather may try to change the syntax table of latex-mode
to allow it matching such parentheses.

-- 
Juri Linkov
http://www.jurta.org/emacs/





reply via email to

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