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: Thu, 27 Oct 2005 09:17:55 +0300
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

> 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.

How do you think `scan_lists' should treat a character quote?
I think that when point is after it, then `scan_lists' should work
as if point was before it, and to skip it and the following character
as characters without their normal syntactic meaning.

It seems after this change your patch for paren.el may be needed too,
because `scan_lists' still will not find a matching paren when it will
skip it without errors.

The current situation with escape characters is still not clear for me.
I don't understand why `scan_lists' can't match escaped parens in strings
in emacs-lisp mode?  In strings "(" and "\(" have exactly the same meaning.
So why to not treat them equally?

There are many escaped opening parens in strings in source files
(because parens in column zero should be escaped), but `scan_lists'
fails on them.  Treating "\(" as "(" inside strings would help list
movement commands as well as show-paren-mode to work normally on them.

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





reply via email to

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