[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: show-paren-mode indicates mismatch for escaped parentheses
From: |
Ralf Angeli |
Subject: |
Re: show-paren-mode indicates mismatch for escaped parentheses |
Date: |
Wed, 26 Oct 2005 03:02:41 +0200 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
* Juri Linkov (2005-10-25) writes:
> 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.
You are right, if there is a bug, `show-paren-mode' is not the right
place to fix it.
> So you rather may try to change the syntax table of latex-mode
> to allow it matching such parentheses.
I still think that it would make more sense to not regard opening or
closing parens as start or end of sexps respectively if they are
escaped. The description of the syntax class `/' used for backslashes
in LaTeX mode suggests this as well (from the Elisp manual):
-- Syntax class: character quote
A "character quote character" (designated by `/') quotes the
following character so that it loses its normal syntactic meaning.
This differs from an escape character in that only the character
immediately following is ever affected.
To me it looks like the syntax table is fine, but `forward-sexp'
(i.e. `scan_lists') is disregarding it.
--
Ralf