From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" 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 09:59:11 -0400 Message-ID: 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> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34712"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: casouri@gmail.com, 65470@debbugs.gnu.org, theo@thornhill.no, Dmitry Gutov , jostein@secure.kjonigsen.net, btuin@mailo.com, jostein@kjonigsen.net To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Sep 16 16:00: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 1qhVqW-0008od-4B for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 16 Sep 2023 16:00:28 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qhVq3-0007Tc-GK; Sat, 16 Sep 2023 09:59:59 -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 1qhVq1-0007Ju-7n for bug-gnu-emacs@gnu.org; Sat, 16 Sep 2023 09:59:57 -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 1qhVq0-0003y8-Sm for bug-gnu-emacs@gnu.org; Sat, 16 Sep 2023 09:59:56 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qhVq6-0004R9-UZ for bug-gnu-emacs@gnu.org; Sat, 16 Sep 2023 10:00:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 16 Sep 2023 14:00: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.169487277516985 (code B ref 65470); Sat, 16 Sep 2023 14:00:02 +0000 Original-Received: (at 65470) by debbugs.gnu.org; 16 Sep 2023 13:59:35 +0000 Original-Received: from localhost ([127.0.0.1]:48191 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qhVpe-0004Ps-Vz for submit@debbugs.gnu.org; Sat, 16 Sep 2023 09:59:35 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:53976) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qhVpc-0004Pe-SF for 65470@debbugs.gnu.org; Sat, 16 Sep 2023 09:59:33 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 254F01000A3; Sat, 16 Sep 2023 09:59:20 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1694872758; bh=3nbpWZ5D13cNeoTcjjrB+r2h3O8UgHUPccYTjNuml6M=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=FAs223AzFvDLAfLU6nrgiymDWP6o+Yiaz76gIhD54aCBa58tLdqGry+Cte7DzUDms vN/yVAnw/5394qe8m8utyeaKh1F+1JwpRZrjGtlnJXXIWJ4I0h7ZIKSAjj677lbgtL 7OfG9b+BV61oPpTNkvihk2Tcug1US7cb1g4CKT8tsn869QhaG8dIs+2btuw5yeh9Ww M/wP2NUJphlTWjjneurcKZzQJKYCHpIuYsBocpnpGjuBpfVbZAQerbPaWefjEZLVR0 z1v4pX4aRXd8HXf56hNtbucH8F+9/I/jS0hlqnLkkQjDeGG9Q7stquiBA1DHIfsWcC MxJCj2aun8IOg== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id DA738100046; Sat, 16 Sep 2023 09:59:18 -0400 (EDT) Original-Received: from pastel (unknown [104.247.237.102]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 98DEC120302; Sat, 16 Sep 2023 09:59:18 -0400 (EDT) In-Reply-To: <835y4ak6hz.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 16 Sep 2023 08:54:32 +0300") 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:270618 Archived-At: >> 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`). Stefan 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 (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