From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Randy Taylor Newsgroups: gmane.emacs.bugs Subject: bug#63708: 29.0.60; rust-ts-mode not properly handling apostrophe Date: Mon, 29 May 2023 13:34:46 +0000 Message-ID: References: <83pm6pm0yz.fsf@gnu.org> <2MdRTHLlZtWDlCx6Ky-LFtla6-aBBs4PlNgTuatIC-h4OIuKdPmsmWsIokUQ9LBMHNvH_ooIvMUlQH8F8XOjNrEUUdC9FtR1l_e6RZSy7xU=@rjt.dev> <837cswmu5a.fsf@gnu.org> <8T8C4l5XryyVmB2cBTnmhGMnoELwHA2y1u1ZeMlg1WaQKzrPeOoe6L5hOQq3JPdsnG9r-puSlQfNZ091qBCGpVco-mC6ruhsQs0SvaPjkjQ=@proton.me> <_LWjNGLzmmtpm2gEwOaBZlTVCwvU9yxUyJzIl3yo3ol48dKWbMabBOpLzZ2UhWJ2_yPjVT-j2Jb-oUP8nLaju6ztGjFTNq-2PZqgTjv5gSM=@proton.me> <83wn0rgz0h.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1521"; mail-complaints-to="usenet@ciao.gmane.io" Cc: =?UTF-8?Q?=D0=99=D0=BE=D1=80=D0=B4=D0=B0=D0=BD_?= =?UTF-8?Q?=D0=9C=D0=B8=D0=BB=D0=B0=D0=B4=D0=B8=D0=BD=D0=BE=D0=B2?= , casouri@gmail.com, 63708@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon May 29 15:35:29 2023 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 1q3d20-0000C3-TT for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 29 May 2023 15:35:29 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q3d1d-00061e-A0; Mon, 29 May 2023 09:35:06 -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 1q3d1a-00060C-C3 for bug-gnu-emacs@gnu.org; Mon, 29 May 2023 09:35:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q3d1a-0002jb-34 for bug-gnu-emacs@gnu.org; Mon, 29 May 2023 09:35:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q3d1Z-0007Od-Hq for bug-gnu-emacs@gnu.org; Mon, 29 May 2023 09:35:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Randy Taylor Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 29 May 2023 13:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63708 X-GNU-PR-Package: emacs Original-Received: via spool by 63708-submit@debbugs.gnu.org id=B63708.168536730028421 (code B ref 63708); Mon, 29 May 2023 13:35:01 +0000 Original-Received: (at 63708) by debbugs.gnu.org; 29 May 2023 13:35:00 +0000 Original-Received: from localhost ([127.0.0.1]:57367 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q3d1Y-0007OL-E3 for submit@debbugs.gnu.org; Mon, 29 May 2023 09:35:00 -0400 Original-Received: from mail-4323.proton.ch ([185.70.43.23]:63575) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q3d1W-0007Nt-Ev for 63708@debbugs.gnu.org; Mon, 29 May 2023 09:34:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rjt.dev; s=protonmail3; t=1685367291; x=1685626491; bh=D+LzmWaj44UGQeLwxFcuxZR+1F/u62A4bGgLc6wgP8Q=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=Q5/dvPZdCTt1+Dx0SDtVOrldy7RIXXAtDUhlIH4FXhujPDMpzp0zNES5zU+RBr4eO EtUA4GeBaF3bkR/hfGe/AQNV9CPQDvQpxr+LU5GzA0gOcxjjInjhfUNZLrFwRZ+Bqs yhQAZ3PYny5OJhxOHhf3kVgLwN2y+7h5+fWV9qz8Y86VrH0l/pCmFUOTO1iVDDTYJI RFQHdJCAuUaKuXuTL8nsuF4W6QRW9mhmB9sXJerawrZEWnsw06qcdf25B1momYS9WQ /eLStuBsJwpGVTLO8Ou36a2hYw6B/qRKGvXQusJwdkU+ENAjcIJRwQY+EBiAGHcoQq oNM0xdQjWccqg== In-Reply-To: <83wn0rgz0h.fsf@gnu.org> Feedback-ID: 44397038:user:proton 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:262574 Archived-At: On Monday, May 29th, 2023 at 07:25, Eli Zaretskii wrote: > > Date: Sun, 28 May 2023 19:52:38 +0000 >=20 > > From: =D0=99=D0=BE=D1=80=D0=B4=D0=B0=D0=BD =D0=9C=D0=B8=D0=BB=D0=B0= =D0=B4=D0=B8=D0=BD=D0=BE=D0=B2 yordanm@proton.me > > Cc: Eli Zaretskii eliz@gnu.org, 63708@debbugs.gnu.org, casouri@gmail.co= m > > (while (re-search-forward (rx (or "<" ">")) end t) > > - (pcase (treesit-node-type > > - (treesit-node-parent > > - (treesit-node-at (match-beginning 0)))) > > - ("type_arguments" > > - (put-text-property (match-beginning 0) > > - (match-end 0) > > - 'syntax-table > > - (pcase (char-before) > > - (?< '(4 . ?>)) > > - (?> '(5 . ?<)))))))) > > + (let ((parent-type (treesit-node-type > > + (treesit-node-parent > > + (treesit-node-at (match-beginning 0)))))) > > + (when (or (string-equal parent-type "type_arguments") > > + (string-equal parent-type "type_parameters")) > > + (put-text-property (match-beginning 0) > > + (match-end 0) > > + 'syntax-table > > + (pcase (char-before) > > + (?< '(4 . ?>)) > > + (?> '(5 . ?<)))))))) >=20 >=20 > Here, AFAIU you needed to add a single line, but instead you rewrote a > 'pcase' as a 'when', and got a much larger change. Was that really > needed? >=20 I think keeping the existing loop as is but making a slight modification: - ("type_arguments" + ((or "type_arguments" "type_parameters") should be enough? > I also don't understand how a bug for go-ts-mode led to a change that > also affects rust-ts-mode. Can you explain? >=20 The go-ts-mode change does not affect rust-ts-mode. The same bug is present= in go-ts-mode.