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

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: wishlist; Reported by: Siyuan Chen <chansey97@HIDDEN>; dated Fri, 12 Jul 2024 05:04:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Severity set to 'wishlist' from 'normal' Request was from Stefan Kangas <stefankangas@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 72068 <at> debbugs.gnu.org:


Received: (at 72068) by debbugs.gnu.org; 24 Jul 2024 20:12:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jul 24 16:12:52 2024
Received: from localhost ([127.0.0.1]:34557 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sWiM0-0001l5-Fy
	for submit <at> debbugs.gnu.org; Wed, 24 Jul 2024 16:12:52 -0400
Received: from mail-ed1-f49.google.com ([209.85.208.49]:49357)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stefankangas@HIDDEN>) id 1sWiLx-0001kj-QA
 for 72068 <at> debbugs.gnu.org; Wed, 24 Jul 2024 16:12:50 -0400
Received: by mail-ed1-f49.google.com with SMTP id
 4fb4d7f45d1cf-5ab2baf13d9so249319a12.2
 for <72068 <at> debbugs.gnu.org>; Wed, 24 Jul 2024 13:12:43 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1721851898; x=1722456698; darn=debbugs.gnu.org;
 h=cc:to:subject:message-id:date:mime-version:references:in-reply-to
 :from:from:to:cc:subject:date:message-id:reply-to;
 bh=0DRnb9ueSLnLIeiM8Dyfx25OQ3/23ALVZ0DckRl53Jw=;
 b=EekMtJDrop9DEp1YBnH7r0Uh/b9UQQNxrDPIs7tu1sEOrRCAE9kInPqwVQggmy7+1x
 FJJFohORM6uahjwtZXhBsXJbV/D+xNCV5LHYWJXoKvs9x9WCzvctZhjGH/8+UjRzmoos
 i/HrnAHa+fjWEYM5wgpnmfjOhv2zucs+6oiypUKunt4lmC6g7st0FpFq1N4O6VKuwHNE
 zzxkG5x8V9GMey+29+uAgAhkvBpDj98fvBoQYioLwRpnQCndl1HdpImo4bCFay/rGRRX
 c5Ff3cIv0vte5JLVXvYugk8xo8kosRUvGa/QhHqT4exIq67lHTScDVsGa/ML7ilYCuUd
 ZhDw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1721851898; x=1722456698;
 h=cc:to:subject:message-id:date:mime-version:references:in-reply-to
 :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=0DRnb9ueSLnLIeiM8Dyfx25OQ3/23ALVZ0DckRl53Jw=;
 b=bOnDPIdCijwQwAs/cMejMkmbtmX/TwefBl6l8QzkDoQM5yQKXbFVltUJzqYoTWQg5E
 s72XvAmmiHJ/LLik4f5iKXdko4ElocfuWJyLuBb3OFOkotP9AHLgLduC06FOREkzcgmx
 05AGNjYgASQRBjokIl312YyEtYTyRAkFpEQ5s5yVmQY94vbOnEpl19PIUixLSxFe5NGp
 L1rzdZkOiIDt0i8aLQhXHuavKf0r3NCCwIdraWsUUfruRAeFB5pey0Q4rIcVsX7UtnUn
 1N8bjA01lLmk1TiPh4sAdXf5xiS20AUfb9Tr6bwAHOX3efWaaCWgtvk4GW0GeoF/xY91
 GKTA==
X-Gm-Message-State: AOJu0Yya9hB7jiYKh6TXQWk3AceAAMiWYayiRi8NEpsjMi0Opqto7K9/
 3m8pwhI4DSJr5GvSd881bzes+ENlozutt8/e7D0j5cNPwRRumJPrLds3Z5ieNHj441pHQVncc4a
 yta3kUC73PIE6O5bCFyAv0YQ+opg=
X-Google-Smtp-Source: AGHT+IFIhtI472AdrhRSzV8RCT1UYDiTkLaZoAPk9NeyPElEPdsO9OzzFxj+G/eTZQMp06af4ChpZpPwOmejLhwjKNo=
X-Received: by 2002:a05:6402:26ce:b0:5a0:c709:aa0b with SMTP id
 4fb4d7f45d1cf-5ac2c1c441bmr335953a12.24.1721851897438; Wed, 24 Jul 2024
 13:11:37 -0700 (PDT)
Received: from 753933720722 named unknown by gmailapi.google.com with
 HTTPREST; Wed, 24 Jul 2024 13:11:37 -0700
From: Stefan Kangas <stefankangas@HIDDEN>
In-Reply-To: <jwvy1664w6w.fsf-monnier+emacs@HIDDEN>
References: <CAHWTsYmK1a16ZHUzzbcGvwyXGW_BTJ5otaXqCypwJNNF3qVJ_Q@HIDDEN>
 <86y167kv06.fsf@HIDDEN> <jwvy1664w6w.fsf-monnier+emacs@HIDDEN>
MIME-Version: 1.0
Date: Wed, 24 Jul 2024 13:11:37 -0700
Message-ID: <CADwFkmkyV+8PiQAtVNAv_BAG7VokxY4H0c3LzeZ0pQ96oYKZaw@HIDDEN>
Subject: Re: bug#72068: show-paren-mode does not match Chinese parentheses
 correctly
To: Stefan Monnier <monnier@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 72068
Cc: 72068 <at> debbugs.gnu.org, Siyuan Chen <chansey97@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

severity 72068 wishlist
thanks

Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs@HIDDEN> writes:

> Eli Zaretskii [2024-07-12 09:02:49] wrote:
>> 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?
>
> I think that's the idea, indeed.  Of course, we don't have to obey the
> Emacs Lisp syntax, but I think it makes sense to do so.
> Admittedly, it would be nice to allow the use of other syntax rules inside
> comments and string for these kinds of situations.

I'm not sure if this should be closed as notabug or not, but I'm tagging
it as wishlist at least.  Feel free to close if that makes more sense.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#72068; Package emacs. Full text available.

Message received at 72068 <at> debbugs.gnu.org:


Received: (at 72068) by debbugs.gnu.org; 12 Jul 2024 12:45:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 12 08:45:40 2024
Received: from localhost ([127.0.0.1]:53456 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sSFed-00087v-Q4
	for submit <at> debbugs.gnu.org; Fri, 12 Jul 2024 08:45:40 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:5351)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1sSFeb-00087g-A8
 for 72068 <at> debbugs.gnu.org; Fri, 12 Jul 2024 08:45:38 -0400
Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 20E6B808A4;
 Fri, 12 Jul 2024 08:45:30 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1720788328;
 bh=6T+LyD4Bnd0ZX/rNMWiz394/ho3/5Iy81SYhg6/yOCo=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=KyY1TilQmZki5VuUqw3t0sk1a5pnHQIy2sG5nBGJv4issInWfSITFsKXkD1HjpmuS
 nvIWMrbj5Lx+ohJVM7S7YxiFblcn494aqUo2gvK9YjFPdKTdyEv4svhZ3/ctU9+LZ3
 JTVvjHFKZ3HR1Ze3YOCFnB2rbhxB48xq+sXMH7s9tFO0yBYghcJMOKYzQfAuFQFzhf
 6BSLQnO4cW/OlAVOITGJQEDCoZ2qWWmDlnQG0OYnK3ifJRiZ0UmAOav6bKoIRRDJJe
 4epHM2oVF5HKg50I0jzdlKjmFT7Az6q712NnnYd5V8KjNFRS62Rax1RGlyiP2F1mhb
 A0E0Yb0HEyakQ==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 4ED2C8001C;
 Fri, 12 Jul 2024 08:45:28 -0400 (EDT)
Received: from asado (syn-072-043-125-136.biz.spectrum.com [72.43.125.136])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 2DFC2120495;
 Fri, 12 Jul 2024 08:45:28 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#72068: show-paren-mode does not match Chinese parentheses
 correctly
In-Reply-To: <86y167kv06.fsf@HIDDEN> (Eli Zaretskii's message of "Fri, 12 Jul
 2024 09:02:49 +0300")
Message-ID: <jwvy1664w6w.fsf-monnier+emacs@HIDDEN>
References: <CAHWTsYmK1a16ZHUzzbcGvwyXGW_BTJ5otaXqCypwJNNF3qVJ_Q@HIDDEN>
 <86y167kv06.fsf@HIDDEN>
Date: Fri, 12 Jul 2024 08:45:22 -0400
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 72068
Cc: 72068 <at> debbugs.gnu.org, Siyuan Chen <chansey97@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Eli Zaretskii [2024-07-12 09:02:49] wrote:
> 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?

I think that's the idea, indeed.  Of course, we don't have to obey the
Emacs Lisp syntax, but I think it makes sense to do so.
Admittedly, it would be nice to allow the use of other syntax rules inside
comments and string for these kinds of situations.


        Stefan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#72068; Package emacs. Full text available.

Message received at 72068 <at> debbugs.gnu.org:


Received: (at 72068) by debbugs.gnu.org; 12 Jul 2024 06:02:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 12 02:02:58 2024
Received: from localhost ([127.0.0.1]:53013 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sS9Mw-0000gL-HA
	for submit <at> debbugs.gnu.org; Fri, 12 Jul 2024 02:02:58 -0400
Received: from eggs.gnu.org ([209.51.188.92]:36836)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1sS9Mu-0000g9-Gz
 for 72068 <at> debbugs.gnu.org; Fri, 12 Jul 2024 02:02:57 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1sS9Mp-000619-4G; Fri, 12 Jul 2024 02:02:51 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=owZKVDtiMs6HVwuwGQQ5DeWx70PdCcAC7Hlmsxx4V0A=; b=qUZEbJir93t70KiqQBnl
 nXfwi65DLsdEmyNlXms82Omkvy2KmN5F9CT1VmetYiHAc6f1VLZ3mSpsRGBHnT5WcQC4ZR0luYIyL
 BOhHeJWirPmPVtcumrPBGnjyvKKl9AAX0z58FEVU27JduZwPgXlUA5MApvSXzPp7t6hYKcJU/8cmD
 AKHVEAYKG6JmL0l1vLQfganCvfJqehqKMlg6pW/2mUQVl6+j3eD/AFR+S0RfZc1/wQeCYoo8v1dWS
 uk32bYijswMLfwLHOiWeVCt4Us1GOB4DNvRonHFR0u7Z1ZptYvun5fcZ7S8W7NXgFqnhRRduOcHJR
 i7yxE5pMmkUWNg==;
Date: Fri, 12 Jul 2024 09:02:49 +0300
Message-Id: <86y167kv06.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Siyuan Chen <chansey97@HIDDEN>,
 Stefan Monnier <monnier@HIDDEN>
In-Reply-To: <CAHWTsYmK1a16ZHUzzbcGvwyXGW_BTJ5otaXqCypwJNNF3qVJ_Q@HIDDEN>
 (message from Siyuan Chen on Fri, 12 Jul 2024 13:03:42 +0800)
Subject: Re: bug#72068: show-paren-mode does not match Chinese parentheses
 correctly
References: <CAHWTsYmK1a16ZHUzzbcGvwyXGW_BTJ5otaXqCypwJNNF3qVJ_Q@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 72068
Cc: 72068 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Siyuan Chen <chansey97@HIDDEN>
> 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?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#72068; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 12 Jul 2024 05:03:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 12 01:03:39 2024
Received: from localhost ([127.0.0.1]:52957 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sS8RX-0007MH-4l
	for submit <at> debbugs.gnu.org; Fri, 12 Jul 2024 01:03:39 -0400
Received: from lists.gnu.org ([209.51.188.17]:34974)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <chansey97@HIDDEN>) id 1sS8RV-0007M7-Hm
 for submit <at> debbugs.gnu.org; Fri, 12 Jul 2024 01:03:38 -0400
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 <chansey97@HIDDEN>)
 id 1sS8RV-0004DP-5y
 for bug-gnu-emacs@HIDDEN; Fri, 12 Jul 2024 01:03:37 -0400
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 <chansey97@HIDDEN>)
 id 1sS8RT-0002LJ-FK
 for bug-gnu-emacs@HIDDEN; Fri, 12 Jul 2024 01:03:36 -0400
Received: by mail-yb1-xb2f.google.com with SMTP id
 3f1490d57ef6-e03c6892e31so1690717276.1
 for <bug-gnu-emacs@HIDDEN>; 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)
MIME-Version: 1.0
From: Siyuan Chen <chansey97@HIDDEN>
Date: Fri, 12 Jul 2024 13:03:42 +0800
Message-ID: <CAHWTsYmK1a16ZHUzzbcGvwyXGW_BTJ5otaXqCypwJNNF3qVJ_Q@HIDDEN>
Subject: show-paren-mode does not match Chinese parentheses correctly
To: bug-gnu-emacs@HIDDEN
Content-Type: multipart/alternative; boundary="000000000000231583061d05cdbf"
Received-SPF: pass client-ip=2607:f8b0:4864:20::b2f;
 envelope-from=chansey97@HIDDEN; 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-Spam-Score: -1.1 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.1 (--)

--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

<div dir=3D"ltr">
<div><span lang=3D"en"><span><span>Reproduce steps:</span></span><br></span=
></div><div><span lang=3D"en"><br></span></div><div>1. Emacs -Q</div><div><=
br></div><div>2. M-x eval-expression</div><div><br></div><div>```<br></div>=
<div>(progn<br>=C2=A0 (setq cursor-type &#39;bar)<br>=C2=A0 (show-paren-mod=
e 1))</div><div>```</div><div><br></div><div>3. Paste the following text in=
 any .el file</div><div>```</div><div>(=E8=8B=B1=E6=96=87=E6=8B=AC=E5=8F=B7=
)<br>(=E8=8B=B1=E6=96=87 =E6=8B=AC=E5=8F=B7)<br>=EF=BC=88=E4=B8=AD=E6=96=87=
=E6=8B=AC=E5=8F=B7=EF=BC=89<br>=EF=BC=88=E4=B8=AD=E6=96=87 =E6=8B=AC=E5=8F=
=B7=EF=BC=89<br></div><div>```</div><div><br></div><div>4. Place the cursor=
 at the first position (or last position) of each line.</div><div><br></div=
><div>The expected behavior: <span class=3D"gmail-HwtZe" lang=3D"en"><span =
class=3D"gmail-jCAhz gmail-JxVs2d gmail-ChMk0b"><span class=3D"gmail-ryNqvb=
">All of the four lines above match and highlight correctly</span></span></=
span></div><div><span class=3D"gmail-HwtZe" lang=3D"en"><span class=3D"gmai=
l-jCAhz gmail-JxVs2d gmail-ChMk0b"><span class=3D"gmail-ryNqvb"><br></span>=
</span></span></div><div><span class=3D"gmail-HwtZe" lang=3D"en"><span clas=
s=3D"gmail-jCAhz gmail-JxVs2d gmail-ChMk0b"><span class=3D"gmail-ryNqvb">Th=
e actual behavior: The 4th line mismatched. Note the </span></span></span>
<span class=3D"gmail-HwtZe" lang=3D"en"><span class=3D"gmail-jCAhz gmail-Jx=
Vs2d gmail-ChMk0b"><span class=3D"gmail-ryNqvb">middle</span></span></span>=
 <span class=3D"gmail-HwtZe" lang=3D"en"><span class=3D"gmail-jCAhz gmail-J=
xVs2d gmail-ChMk0b"><span class=3D"gmail-ryNqvb">SPC character.</span></spa=
n></span></div><div><span class=3D"gmail-HwtZe" lang=3D"en"><span class=3D"=
gmail-jCAhz gmail-JxVs2d gmail-ChMk0b"><span class=3D"gmail-ryNqvb"><br></s=
pan></span></span></div><div><span class=3D"gmail-HwtZe" lang=3D"en"><span =
class=3D"gmail-jCAhz gmail-JxVs2d gmail-ChMk0b"><span class=3D"gmail-ryNqvb=
">P.s.</span></span></span><br><br>1. This issue only occurs in lisp-like m=
odes. It is OK in c-mode and python-mode.<br><br>2. =E3=80=90=E3=80=91=E3=
=80=8C=E3=80=8D=E3=80=8E=E3=80=8Fhave the same problem.=20
<span class=3D"gmail-HwtZe" lang=3D"en"><span class=3D"gmail-jCAhz gmail-Jx=
Vs2d gmail-ChMk0b"><span class=3D"gmail-ryNqvb">They are also commonly used=
 in lisp comment.</span></span></span>

<br><br>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
<span class=3D"gmail-HwtZe" lang=3D"en"><span class=3D"gmail-jCAhz gmail-Jx=
Vs2d gmail-ChMk0b"><span class=3D"gmail-ryNqvb">4th</span></span></span> ca=
se.<br></div><div><br></div><div>4. More screenshots and test code can be f=
ound in=20
<a href=3D"https://emacs-china.org/t/show-paren-mode/15160">https://emacs-c=
hina.org/t/show-paren-mode/15160</a>

</div><div><span class=3D"gmail-HwtZe" lang=3D"en"><span class=3D"gmail-jCA=
hz gmail-JxVs2d gmail-ChMk0b"><span class=3D"gmail-ryNqvb"><br></span></spa=
n></span></div><div><span class=3D"gmail-HwtZe" lang=3D"en"><span class=3D"=
gmail-jCAhz gmail-JxVs2d gmail-ChMk0b"><span class=3D"gmail-ryNqvb">Emacs 2=
9.3 on Windows.<br></span></span></span></div><div><span class=3D"gmail-Hwt=
Ze" lang=3D"en"><span class=3D"gmail-jCAhz gmail-JxVs2d gmail-ChMk0b"><span=
 class=3D"gmail-ryNqvb"><br></span></span></span></div><div><span class=3D"=
gmail-HwtZe" lang=3D"en"><span class=3D"gmail-jCAhz gmail-JxVs2d gmail-ChMk=
0b"><span class=3D"gmail-ryNqvb">Thanks.<br></span></span></span></div><div=
><span class=3D"gmail-HwtZe" lang=3D"en"><span class=3D"gmail-jCAhz gmail-J=
xVs2d gmail-ChMk0b"><span class=3D"gmail-ryNqvb"><br></span></span></span><=
/div><div><span class=3D"gmail-HwtZe" lang=3D"en"><span class=3D"gmail-jCAh=
z gmail-JxVs2d gmail-ChMk0b"><span class=3D"gmail-ryNqvb">Best regards</spa=
n></span></span></div><div><span class=3D"gmail-HwtZe" lang=3D"en"><span cl=
ass=3D"gmail-jCAhz gmail-JxVs2d gmail-ChMk0b"><span class=3D"gmail-ryNqvb">=
Siyuan Chen<br></span></span></span>

</div><div><br></div>

<div><div><br></div><div><br></div></div></div>

--000000000000231583061d05cdbf--




Acknowledgement sent to Siyuan Chen <chansey97@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#72068; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Wed, 24 Jul 2024 20:15:01 UTC

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