unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Siyuan Chen <chansey97@gmail.com>
To: 72068@debbugs.gnu.org
Subject: bug#72068: show-paren-mode does not match Chinese parentheses correctly
Date: Fri, 12 Jul 2024 13:03:42 +0800	[thread overview]
Message-ID: <CAHWTsYmK1a16ZHUzzbcGvwyXGW_BTJ5otaXqCypwJNNF3qVJ_Q@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1059 bytes --]

 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

[-- Attachment #2: Type: text/html, Size: 3853 bytes --]

             reply	other threads:[~2024-07-12  5:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-12  5:03 Siyuan Chen [this message]
2024-07-12  6:02 ` bug#72068: show-paren-mode does not match Chinese parentheses correctly Eli Zaretskii
2024-07-12 12:45   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-24 20:11     ` Stefan Kangas
2024-07-25  5:20       ` Eli Zaretskii
2024-07-25 11:34         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-01  1:10           ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHWTsYmK1a16ZHUzzbcGvwyXGW_BTJ5otaXqCypwJNNF3qVJ_Q@mail.gmail.com \
    --to=chansey97@gmail.com \
    --cc=72068@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).