GNU bug report logs -
#9461
24.0.50; Weird behaviour in "show-paren-mode"
Previous Next
Reported by: Dani Moncayo <dmoncayo <at> gmail.com>
Date: Wed, 7 Sep 2011 17:26:01 UTC
Severity: normal
Found in version 24.0.50
Done: Juri Linkov <juri <at> jurta.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
On Thu, Sep 8, 2011 at 01:59, Juri Linkov <juri <at> jurta.org> wrote:
>> 1. Create a new buffer: C-x b tmp <RET>
>> 2. Turn "show-paren-mode" on: M-x show-paren-mode <RET>
>> 3. Write "\(hello\)".
>> The resulting buffer appearance is shown in the attached file.
>> Why is Emacs trying to match the first "\" with the last ")"?
>
> It highlights with the face `show-paren-mismatch', not `show-paren-match'.
Yes, I know...
I didn't write the expected behavior because I thought it was obvious.
But well, here we go:
As I see it, if I write "abc(def]", "(" and "]" are _both_ highlighted
with the mismatch font, which is logical, because there is a mismatch
on _both_ characters: the "(" should have a ")" after it (without any
"]" in between), and likely for the "]".
But if I write "abc\(def\)", there is a "(" that matches the ")", so I
don't understand why "a" and ")" are highlighted with the mismatch
font. TRT would be to highlight both parentheses with the "match"
font. Even if the ")" didn't have a matching "(", the "a" should
_never_ be highlighted, because that character doesn't expect any
other to match it (at least in fundamental mode, which is the current
one).
Also, one could think that the "close delimiter" meaning of ")" is
cancelled by the previous escape ("\"), but then I would expect that
no highlighting took place at all, because both parentheses are
escaped.
So, definitely something is wrong here, IMO.
--
Dani Moncayo
This bug report was last modified 13 years and 315 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.