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 #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Siyuan Chen <chansey97 <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: show-paren-mode does not match Chinese parentheses correctly
Date: Fri, 12 Jul 2024 13:03:42 +0800
[Message part 1 (text/plain, inline)]
 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.

Thanks.

Best regards
Siyuan Chen
[Message part 2 (text/html, inline)]

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.