From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.bugs Subject: bug#73978: 31.0.50; Text syntax applied on too many things in tsx-ts-mode Date: Tue, 24 Dec 2024 00:52:24 -0800 Message-ID: <9C416A93-5E86-4FE5-ADFB-092365169F09@gmail.com> References: <1A3DAA8F-F00A-4984-AC0F-E62F021A690B@gmail.com> <87r05xmr24.fsf@mail.linkov.net> <87jzbpmqhm.fsf@mail.linkov.net> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51\)) 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="40896"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Dmitry Gutov , Theodor Thornhill , 73978@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Dec 24 09:54:16 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 1tQ0gB-000ATT-CN for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 24 Dec 2024 09:54:15 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tQ0fz-0004VV-Pl; Tue, 24 Dec 2024 03:54:04 -0500 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 1tQ0fy-0004V5-Fk for bug-gnu-emacs@gnu.org; Tue, 24 Dec 2024 03:54:02 -0500 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 1tQ0fy-0003w9-7o for bug-gnu-emacs@gnu.org; Tue, 24 Dec 2024 03:54:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:Date:In-Reply-To:From:Mime-Version:To:Subject; bh=NR9pvEgC8Fc+geWV9TFMUuQu7XGBKecbTuNg9Jg0+6M=; b=OAJBJiC54nQSpDn7FZR2I350DzzsH/br+/iiY70xTjfH9oQwFFFz928ZqjLHkBeuUKdkgqbeQKZf2iSPQABDfKLzzPv0Y5Z6ujibs1Bvx47dphUJJrXKQhVNQx8g34yR4bgRRC9wLtUXqTBPjtpnt26MaDw5YmOe1VE6zc7TsYGfw4TaAYCAhqsGTf6bSqmpleiywWEOO7m+fE/23OWefmpZ5EwMeJCPBEyR/KMcQb052KF/ud1jX+EQWWzmEl2Rz4b0qTv2TRLH1yKNPvux+yO6s16UlvHbOOldYq/JCRY+BDR0feejwlEPw+66e1TtosavHBARgvHCZf5veJz/Wg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tQ0fx-00038Q-PP for bug-gnu-emacs@gnu.org; Tue, 24 Dec 2024 03:54:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 24 Dec 2024 08:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73978 X-GNU-PR-Package: emacs Original-Received: via spool by 73978-submit@debbugs.gnu.org id=B73978.173503042212019 (code B ref 73978); Tue, 24 Dec 2024 08:54:01 +0000 Original-Received: (at 73978) by debbugs.gnu.org; 24 Dec 2024 08:53:42 +0000 Original-Received: from localhost ([127.0.0.1]:59279 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tQ0fe-00037m-0o for submit@debbugs.gnu.org; Tue, 24 Dec 2024 03:53:42 -0500 Original-Received: from mail-pl1-f181.google.com ([209.85.214.181]:57350) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tQ0fZ-00037b-Ri for 73978@debbugs.gnu.org; Tue, 24 Dec 2024 03:53:40 -0500 Original-Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-2156e078563so45738385ad.2 for <73978@debbugs.gnu.org>; Tue, 24 Dec 2024 00:53:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735030357; x=1735635157; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=NR9pvEgC8Fc+geWV9TFMUuQu7XGBKecbTuNg9Jg0+6M=; b=HRKtjAJ2hR7CXWsZiIczBBSZGuC66uK129pd/RB82WpNZ4KFAZ0P9G+1e9lu7lN7RL ftILBS+6yZYj9M9JoE3xizQLj++CEm1EPfpKD1+EkEwQb2kEyDKx/dKn/LmcoiGlbCcT XvrjFMVUFZvHvA1UKdvWMfPfuVgdgOvTQM6pd6LU09dcMYpROatkx579M3MeOoIQa/NT 3DpaKKzhqJ2vD2gednb5KjDFefA/q2qq2YX28DzgcVnQezjM9KpGNNuSfrGQGLSYW5GW mkkn+6TELDuxr/UsY+hleq/dD5085NoTCMthg3BYVHRpCNMxn94AkWBE6zCIJHQqxZMq QtCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735030357; x=1735635157; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NR9pvEgC8Fc+geWV9TFMUuQu7XGBKecbTuNg9Jg0+6M=; b=bMss+3IfVVrPESE9qR8tMSMqIoCqkdIhnkMTXURmVdaJV1rAe9DfbKzhZP8FTYdnyb AU9kjsBFr5i1TTseOmtQ2NdFt9fvVOyhlkTF6UK3y4B0JCtaARA3llQlHv++1T4gWj0x enbIDHMc11p3MNs1t1a/Epk6+e9vw3kpRyOgIfAc4hCGZu725J8evshHGGDgbECf4IPO gPTUyQBTxHCEflzTQJCecN4oQepT2/jVKaoMnW+HtoA5oX9nfwGW/V3Sa2M9sMMpL0Zy jku2tVFEmwWgQE5LI3Nfn0Nu9CJjpaC2vErnPAanXzhTTheTZiJe/ApcM1/1jF6uGfFn vrow== X-Forwarded-Encrypted: i=1; AJvYcCVqNXbGj4ok4Z+6kKZHes0Z/wmkibXEEJ70VJUpZSpNbogUZHuGkhsWLN0TQBY0MHgg5f/sDA==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yzf7ApH/9RRNQsFdKMLXTLtL5+T2eZyJWoUNGY2SmUoJIM6Da/K skppArDAAvs0E5H1scyZ6AuyGGGEQtB5ESxgcZyhRtMuQ1qlCylo X-Gm-Gg: ASbGncv418IMAZGOzbTs/alzW9l2qgCLTJsMbXLXCuGGI8SvK1i+G6S25G505PaaAhk 3tosjptGBDFDo6Fg4TNCj8UnKlOAMVbh1tejvthzNerN5kFkNTzq8nPujDOwZN8JnJ7/BbV964g wTn8uGgicpVA0sIlcdFdUj+rXbxxgd0xsOjxUq/Kc9Q1jOHJgXsOXfu09RbRZtQ0f0p8BpMKVy1 Q7sZLlxmNW43w4J6e00mRxtkmJNSzQj6EYnMgaLuWSb7RaTi0ArKpW8p3hzVtuckd/4u1pmnkKj Upo3 X-Google-Smtp-Source: AGHT+IFjaBTyGDWvVPj//HWpN3aNGaYN/9+dGnFCIUbMfLDKAytWbeD28h5zLTLn+uN765hspAgzlQ== X-Received: by 2002:a05:6a21:3189:b0:1e1:ab8b:dda1 with SMTP id adf61e73a8af0-1e5e080c4a2mr28782513637.35.1735030356852; Tue, 24 Dec 2024 00:52:36 -0800 (PST) Original-Received: from smtpclient.apple ([2601:646:8f81:6120:1d98:6810:9846:b152]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8dbbf6sm9239934b3a.111.2024.12.24.00.52.35 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Dec 2024 00:52:36 -0800 (PST) In-Reply-To: <87jzbpmqhm.fsf@mail.linkov.net> X-Mailer: Apple Mail (2.3776.700.51) 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:297691 Archived-At: > On Dec 24, 2024, at 12:31=E2=80=AFAM, Juri Linkov = wrote: >=20 >> While testing forward-sexp in tsx-ts-mode I noticed that >> this line in 'tsx-ts--s-p-query': >>=20 >> ((jsx_text) @jsx) >>=20 >> disrupts syntax-based navigation for = forward-sentence-default-function. >=20 > With this patch everything works perfectly: >=20 > diff --git a/lisp/progmodes/typescript-ts-mode.el = b/lisp/progmodes/typescript-ts-mode.el > index 5c3c9a24ff4..01dd8297996 100644 > --- a/lisp/progmodes/typescript-ts-mode.el > +++ b/lisp/progmodes/typescript-ts-mode.el > @@ -630,7 +640,8 @@ tsx-ts--s-p-query > (when (treesit-available-p) > (treesit-query-compile 'tsx > '(((regex pattern: (regex_pattern) = @regexp)) > - ((jsx_text) @jsx))))) > + ((jsx_opening_element) @jsx) > + ((jsx_closing_element) @jsx))))) >=20 > (defun typescript-ts--syntax-propertize (beg end) > (let ((captures (treesit-query-capture 'typescript = typescript-ts--s-p-query beg end))) Thanks for looking into this! But what=E2=80=99s the intention of this = change? In a snippet like this: Only the =E2=80=9CText=E2=80=9D part should be marked as string. With = the change you proposed, the part would = be marked as string. We must mark text as strings because they could include /(/) etc and = mess with syntax-ppss.=20 Yuan=