GNU bug report logs - #72068
show-paren-mode does not match Chinese parentheses correctly

Previous Next

Package: emacs;

Reported by: Siyuan Chen <chansey97 <at> gmail.com>

Date: Fri, 12 Jul 2024 05:04:02 UTC

Severity: wishlist

Full log


Message #8 received at 72068 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Siyuan Chen <chansey97 <at> gmail.com>,
 Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 72068 <at> debbugs.gnu.org
Subject: Re: bug#72068: show-paren-mode does not match Chinese parentheses
 correctly
Date: Fri, 12 Jul 2024 09:02:49 +0300
> From: Siyuan Chen <chansey97 <at> gmail.com>
> Date: Fri, 12 Jul 2024 13:03:42 +0800
> 
> Reproduce steps:
> 
> 1. Emacs -Q
> 
> 2. M-x eval-expression
> 
> ```
> (progn
>   (setq cursor-type 'bar)
>   (show-paren-mode 1))
> ```
> 
> 3. Paste the following text in any .el file
> ```
> (英文括号)
> (英文 括号)
> (中文括号)
> (中文 括号)
> ```
> 
> 4. Place the cursor at the first position (or last position) of each line.
> 
> The expected behavior: All of the four lines above match and highlight correctly
> 
> The actual behavior: The 4th line mismatched. Note the middle SPC character.
> 
> P.s.
> 
> 1. This issue only occurs in lisp-like modes. It is OK in c-mode and python-mode.
> 
> 2. 【】「」『』have the same problem. They are also commonly used in lisp comment. 
> 
> 3.  A simple investigation found that it may be related to `scan-sexps` or syntax-table, because  `(scan-sexps
> outside dir)` in the `show-paren--default` returns the wrong value in the 4th case.
> 
> 4. More screenshots and test code can be found in https://emacs-china.org/t/show-paren-mode/15160 
> 
> Emacs 29.3 on Windows.

I'm not sure this is a bug, since I think Lisp allows those characters
to be treated as symbol-constituent.  Stefan, am I right?




This bug report was last modified 324 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.