From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#65470: 29.1.50; js-ts-mode: regex pattern can cause incorrect parenthesis matching Date: Sat, 16 Sep 2023 23:05:35 +0300 Message-ID: <476cebcf-68d9-254d-816c-54476046cf5e@gutov.dev> References: <127B5BEA-A24B-48A3-9827-85B7CDB67D10@secure.kjonigsen.net> <5f823f8f-d249-f4a1-71e6-083e47d0d123@gutov.dev> <83jztbeeh2.fsf@gnu.org> <03415a27-f082-b204-cece-19a9859e178d@gutov.dev> <8334zze5l4.fsf@gnu.org> <1363c54f-5109-f000-3333-78d291b2096d@gutov.dev> <2D516F0C-D7A8-49D2-8009-F911EFC55C78@secure.kjonigsen.net> <2f525ebe-74e5-dcbe-4403-5e9ae001795c@gutov.dev> <5e57b91b-2967-d82d-eca5-65dc206887cf@gutov.dev> <16E4F60E-5216-457F-A79F-F8FBB5A01D61@secure.kjonigsen.net> <6638462f-89fe-97c4-f008-27e1e2415d2b@gutov.dev> <835y4ak6hz.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23988"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Cc: casouri@gmail.com, 65470@debbugs.gnu.org, theo@thornhill.no, jostein@secure.kjonigsen.net, btuin@mailo.com, jostein@kjonigsen.net To: Stefan Monnier , Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Sep 16 22:06:05 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 1qhbYJ-0005yJ-W6 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 16 Sep 2023 22:06:05 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qhbYE-0008TO-6d; Sat, 16 Sep 2023 16:05:58 -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 1qhbYB-0008RY-K5 for bug-gnu-emacs@gnu.org; Sat, 16 Sep 2023 16:05:55 -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 1qhbYB-0007Xl-BX for bug-gnu-emacs@gnu.org; Sat, 16 Sep 2023 16:05:55 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qhbYI-0000kl-6z for bug-gnu-emacs@gnu.org; Sat, 16 Sep 2023 16:06:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 16 Sep 2023 20:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65470 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 65470-submit@debbugs.gnu.org id=B65470.16948947572881 (code B ref 65470); Sat, 16 Sep 2023 20:06:02 +0000 Original-Received: (at 65470) by debbugs.gnu.org; 16 Sep 2023 20:05:57 +0000 Original-Received: from localhost ([127.0.0.1]:48575 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qhbYC-0000kP-RP for submit@debbugs.gnu.org; Sat, 16 Sep 2023 16:05:57 -0400 Original-Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:50515) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qhbY9-0000k9-50 for 65470@debbugs.gnu.org; Sat, 16 Sep 2023 16:05:56 -0400 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 69DAE32001FC; Sat, 16 Sep 2023 16:05:39 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sat, 16 Sep 2023 16:05:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1694894738; x=1694981138; bh=g3BR7dEC0xx97a/JI2AoNtoQ+fyn/4oyA+R AEy//7yI=; b=cc9kD7Vgfrp1XZXJ8bSf9xQykT7F2s9VwNrS+HxCaW+5nZEnoTX JucsMpg614yCDUvcVKWa85AylFimHKW2Pq8ht05qoR0KqMt2tSf/NsgoB7Ga9QHz xqkh/oqxpv4zm9TQDX/x6sObO1nZATThl+ZGYdcgyOh8BsQlL5fmh9QcOV97pfRB zmWvlsvZGwveAXSQ0Vv+qC7QfRlDkMo/D/9fwBE9BoX2ut69+FtCcDAzQ+pZZ2nu GaXcYd5/sZhOpXHrPmxCKdb6YTxJejo1gVG05uvNeR2VuIs86qrd4levuqFEVDnW ER7Ikwuhq1ydwIOu+GNo4sGpDiinbBlM/EQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1694894738; x=1694981138; bh=g3BR7dEC0xx97a/JI2AoNtoQ+fyn/4oyA+R AEy//7yI=; b=fikyuJgzvljrBntxLlICrWK/RkfHTmHuvICdpHbOp3RDtmc87XH nrcRD6mPKF9p9NFfrDJRZ6tFt/uf2ZmvZ55ZPQnUsHXofOsHk5pb+SxrJ+rln4QL +ecru31f53W+WS5QSZH5SQ8Zb/kgKSCTRJZ3bA3sDq106TBFcn45IDXztqrTKuUq O99sWSKh+vSkyZwwG36YIJPbBZLGJusl6qClCK+vgUy4P3GVFfDoGapsnsPlcyM5 ERz0C3rOAlWjYDuoQMK+gGMlfQWQZBN1o6AWma4IoueqTPUKxjuFSqtaAOK2ullq rVuy+4GaeiWX5roJhbJIK9U5LwjlSdUkd8Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudejgedgudegfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefkffggfgfuvfevfhfhjggtgfesthejredttdefjeenucfhrhhomhepffhm ihhtrhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrg htthgvrhhnpeeigfetveehveevffehledtueekieeikeeufeegudfgfeeghfdulefgfeev ledvveenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe gumhhithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 16 Sep 2023 16:05:36 -0400 (EDT) Content-Language: en-US In-Reply-To: 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:270647 Archived-At: On 16/09/2023 16:59, Stefan Monnier wrote: >>> No problem, pushed that to emacs-29, thanks. >> This seems to cause: >> >> INFO Scraping files for loaddefs...85% >> typescript-ts-mode:0: Warning: Not registering prefix "ts". Affects: ("tsx-ts-mode--indent-compatibility-b893426" "tsx-ts-mode--font-lock-compatibility-bb1f97b" "tsx-ts--s-p-query" "tsx-ts--syntax-propertize" "ts-ts--s-p-query" "ts-ts--syntax-propertize" "ts-ts--syntax-propertize-captures") >> >> Stefan, what do we usually do with such warnings? > We usually ignored them? > [ They only affect the features controlled by > `help-enable-(completion-)autoload`. ] > > A better option, is to try and use fewer namespace prefixes. > e.g. make sure all the definitions start with `ts-`, `ts-ts-`, > `tsts-`, or somesuch (except for the autoloaded ones which can break > that rule). > > Maybe rename `typescript-ts-mode-*` to `ts-ts-mode-*` (and > make `typescript-ts-mode` an alias of `ts-ts-mode`). Thanks. I haven't seen the warnings myself, but I sorted the new addition into two existing prefixes in that file: typescript-ts and tsx-ts. > diff --git a/lisp/progmodes/typescript-ts-mode.el b/lisp/progmodes/typescript-ts-mode.el > index 7c85a7b6fe9..8c50b55535b 100644 > --- a/lisp/progmodes/typescript-ts-mode.el > +++ b/lisp/progmodes/typescript-ts-mode.el > @@ -87,7 +87,7 @@ tsx-ts-mode--indent-compatibility-b893426 > (progn (treesit-query-capture 'tsx '((jsx_fragment) @capture)) > `(((match "<" "jsx_fragment") parent 0) > ((parent-is "jsx_fragment") parent typescript-ts-mode-indent-offset))) > - (error > + (error ;; FIXME: Use more precise error name. > `(((match "<" "jsx_text") parent 0) > ((parent-is "jsx_text") parent typescript-ts-mode-indent-offset))))) > > @@ -414,8 +414,11 @@ typescript-ts-mode--sexp-nodes > "Nodes that designate sexps in TypeScript. > See `treesit-thing-settings' for more information.") > > +;; FIXME: Do we really need to autoload this? > ;;;###autoload Don't think so. Though I'm not sure if we should change that in emacs-29. > (define-derived-mode typescript-ts-base-mode prog-mode "TypeScript" > + ;; FIXME: This is the same docstring as `typescript-ts-mode', > + ;; we should document the difference here! > "Major mode for editing TypeScript." > :group 'typescript > :syntax-table typescript-ts-mode--syntax-table > Fixed two other things on the release branch, seemed safe enough.