From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Siyuan Chen Newsgroups: gmane.emacs.bugs Subject: bug#72068: show-paren-mode does not match Chinese parentheses correctly Date: Fri, 12 Jul 2024 13:03:42 +0800 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000231583061d05cdbf" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36179"; mail-complaints-to="usenet@ciao.gmane.io" To: 72068@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 12 07:04:27 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sS8SJ-0009Df-9i for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 12 Jul 2024 07:04:27 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sS8Rw-0004GX-4b; Fri, 12 Jul 2024 01:04:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sS8Ru-0004GE-OW for bug-gnu-emacs@gnu.org; Fri, 12 Jul 2024 01:04:02 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sS8Ru-0002Q8-BI for bug-gnu-emacs@gnu.org; Fri, 12 Jul 2024 01:04:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sS8Ru-0007N2-AE for bug-gnu-emacs@gnu.org; Fri, 12 Jul 2024 01:04:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Siyuan Chen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 12 Jul 2024 05:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 72068 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.172076061928293 (code B ref -1); Fri, 12 Jul 2024 05:04:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 12 Jul 2024 05:03:39 +0000 Original-Received: from localhost ([127.0.0.1]:52957 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sS8RX-0007MH-4l for submit@debbugs.gnu.org; Fri, 12 Jul 2024 01:03:39 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:34974) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sS8RV-0007M7-Hm for submit@debbugs.gnu.org; Fri, 12 Jul 2024 01:03:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sS8RV-0004DP-5y for bug-gnu-emacs@gnu.org; Fri, 12 Jul 2024 01:03:37 -0400 Original-Received: from mail-yb1-xb2f.google.com ([2607:f8b0:4864:20::b2f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sS8RT-0002LJ-FK for bug-gnu-emacs@gnu.org; Fri, 12 Jul 2024 01:03:36 -0400 Original-Received: by mail-yb1-xb2f.google.com with SMTP id 3f1490d57ef6-e03c6892e31so1690717276.1 for ; Thu, 11 Jul 2024 22:03:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720760614; x=1721365414; darn=gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=knUV1hwAREbf4l0g0hVlQW7LGBT1bq42hEqAME+Q2l8=; b=CWLK2ZshldIeIPlothrDknt4MHm0L52uerKILH91dVc5MWS+vlFyseY9L2QiggLpQX vd+yOT023du+FRyBqihFnf97X909nt5szjpT+1br10hTQmd3Q5lgK5g1Fq5brTwqdtud RI3LmxzQqNirk/gGxX5iKpJy+wEoJlRNeSQlp+4KO4cNhlavuZkmbhf8+uneYG81J5GB cSh1Al4Ecb4YFi1zA2VixeIkLgMT0fcVJjxgeOX06FIOk0Ar8IUHKUoJ/QQGm7h2KK1y J9UojhmIC2SxCPtRhJOTHry94Y27w/kQp7e71xocj7zo3qyqny03PrYByx05Wd5HpwCz aerg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720760614; x=1721365414; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=knUV1hwAREbf4l0g0hVlQW7LGBT1bq42hEqAME+Q2l8=; b=v15gpVPFekuWJy2H7e/HOhXDZScC5MAv+7/e7+F3qp5LsbnDwC4g8figNVPOGuWSVz qXryhyi4vR2N6zFF2cpP+ZgGccwyOhqW4aw3b4brWxa5IMvmSls8pbA5FgOK1OAzV9I8 jieGvR8LeKpS3dRqSAdAy8m0IVcpxx4hq1sOhTNJQ0UxU/PxJmyXeeDvnh6yq4JwR1Wv dTe2tX05QhoByucpe7WoSlmYXVYOMaY5CeWD4eX/lYiEkw8dlRPzRDmv6iHXiv2ezXgf 1KT0i1Q+vb3JTHpjj+iOifPkH3K4S1vBJXw2K7IvrVUHmv/adbqy+94/BskJdYhViaMv HLgg== X-Gm-Message-State: AOJu0YxhixoJxmQJNKx+RPWm9EsbL5zDUxwXqmFRRVTXI1UkH60h1a40 VYhVNIC8W8zKxMjlUwq9OxQeSmf3y+okP1YHbek0A0SmbpiiA1POSSv3gsbkh2BoquokLty0Rp4 MmRO4MmkEuJ0HbLpBgFsLkpbuEXAyes3mHqN1dA== X-Google-Smtp-Source: AGHT+IHqLC3vwDJrNB/h49S/SUEREhZQbOWvFTTF6E/YTUlV4ut/0lnieAjycsAll8fT5l7Ym3GqwbLhLp9woAGWIM8= X-Received: by 2002:a25:b10a:0:b0:e05:679f:4812 with SMTP id 3f1490d57ef6-e05679f4ac0mr6915476276.30.1720760613931; Thu, 11 Jul 2024 22:03:33 -0700 (PDT) Received-SPF: pass client-ip=2607:f8b0:4864:20::b2f; envelope-from=chansey97@gmail.com; helo=mail-yb1-xb2f.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:288752 Archived-At: --000000000000231583061d05cdbf Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 ``` (=E8=8B=B1=E6=96=87=E6=8B=AC=E5=8F=B7) (=E8=8B=B1=E6=96=87 =E6=8B=AC=E5=8F=B7) =EF=BC=88=E4=B8=AD=E6=96=87=E6=8B=AC=E5=8F=B7=EF=BC=89 =EF=BC=88=E4=B8=AD=E6=96=87 =E6=8B=AC=E5=8F=B7=EF=BC=89 ``` 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. =E3=80=90=E3=80=91=E3=80=8C=E3=80=8D=E3=80=8E=E3=80=8Fhave the same prob= lem. 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 --000000000000231583061d05cdbf Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Reproduce steps:

1. Emacs -Q
<= br>
2. M-x eval-expression

```
=
(progn
=C2=A0 (setq cursor-type 'bar)
=C2=A0 (show-paren-mod= e 1))
```

3. Paste the following text in= any .el file
```
(=E8=8B=B1=E6=96=87=E6=8B=AC=E5=8F=B7= )
(=E8=8B=B1=E6=96=87 =E6=8B=AC=E5=8F=B7)
=EF=BC=88=E4=B8=AD=E6=96=87= =E6=8B=AC=E5=8F=B7=EF=BC=89
=EF=BC=88=E4=B8=AD=E6=96=87 =E6=8B=AC=E5=8F= =B7=EF=BC=89
```

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

=
Th= e actual behavior: The 4th line mismatched. Note the middle= SPC character.

P.s.

1. This issue only occurs in lisp-like m= odes. It is OK in c-mode and python-mode.

2. =E3=80=90=E3=80=91=E3= =80=8C=E3=80=8D=E3=80=8E=E3=80=8Fhave the same problem.=20 They are also commonly used= in lisp comment.

3.=C2=A0 A simple investigation found that it may be related to `sc= an-sexps` or syntax-table, because=C2=A0 `(scan-sexps outside dir)` in the = `show-paren--default` returns the wrong value in the=20 4th ca= se.

4. More screenshots and test code can be f= ound in=20 https://emacs-c= hina.org/t/show-paren-mode/15160

Emacs 2= 9.3 on Windows.

Thanks.

<= /div>
Best regards
= Siyuan Chen



--000000000000231583061d05cdbf--