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#62086: 29.0.60; ruby-ts-mode regressions Date: Wed, 12 Apr 2023 00:05:41 -0700 Message-ID: References: <86y1o5op2v.fsf@mail.linkov.net> <5abcf765-f8ce-9563-63aa-20c558409898@yandex.ru> <86cz4l7zjk.fsf@mail.linkov.net> <86ttxww12o.fsf@mail.linkov.net> <865yaakfs7.fsf@mail.linkov.net> <0bd5f2b8-6f0b-09d6-6240-38c742eca19f@yandex.ru> <861qkyfg8l.fsf@mail.linkov.net> <9ceb589f-9325-1607-d1b5-5fd56cb8c3ec@yandex.ru> <86y1myxsrq.fsf@mail.linkov.net> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.500.231\)) 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="11871"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 62086@debbugs.gnu.org, Theodor Thornhill , Juri Linkov To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Apr 12 09:07:28 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 1pmUZk-0002uf-4E for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 12 Apr 2023 09:07:28 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pmUZX-0003h6-VF; Wed, 12 Apr 2023 03:07:15 -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 1pmUZL-0003ci-9Z for bug-gnu-emacs@gnu.org; Wed, 12 Apr 2023 03:07: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 1pmUZK-0000Sz-Py for bug-gnu-emacs@gnu.org; Wed, 12 Apr 2023 03:07:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pmUZK-0001CJ-L0 for bug-gnu-emacs@gnu.org; Wed, 12 Apr 2023 03:07:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 12 Apr 2023 07:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62086 X-GNU-PR-Package: emacs Original-Received: via spool by 62086-submit@debbugs.gnu.org id=B62086.16812831624528 (code B ref 62086); Wed, 12 Apr 2023 07:07:02 +0000 Original-Received: (at 62086) by debbugs.gnu.org; 12 Apr 2023 07:06:02 +0000 Original-Received: from localhost ([127.0.0.1]:38839 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pmUYM-0001Ax-Cl for submit@debbugs.gnu.org; Wed, 12 Apr 2023 03:06:02 -0400 Original-Received: from mail-pl1-f174.google.com ([209.85.214.174]:40925) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pmUYJ-0001AS-O7 for 62086@debbugs.gnu.org; Wed, 12 Apr 2023 03:06:01 -0400 Original-Received: by mail-pl1-f174.google.com with SMTP id q2so15306794pll.7 for <62086@debbugs.gnu.org>; Wed, 12 Apr 2023 00:05:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681283153; 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=m0gn+CU7Va/TqP8rnH80Gry1se3MLaywFNKQZ7xlDhc=; b=KuB9mgUTAZ+ECfjK7UV4nvqjW4hPbLepKLsMfNVjTsih/sfYAVXo6VjJa1k8JUuTlL XcvVP9YnmMyaEm3SGV8G2jdo/T0RVED9Y32hoHcp3bYGsIxGhSp8n5V77GgIIZQ4bDtM p6BxHN4rwkXjxTAq8zmvM/Z7okHgHmnAKDWfgMRQcYuJQA3+aOZlP7kCeMPXR6yqk4a/ K/O8anTxGK4G6H45Weuiyd8UtanDt2NxPg67HYsGNERogAbYxEb7OE+rOlZDhH/rX10J bfz1ogKIDu7mKcUsjQkrD7NgRNWejUf4dMDZYYD+FDxAUEKpx7qfnR4Cy7rnZDPp1urL QiKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681283153; 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=m0gn+CU7Va/TqP8rnH80Gry1se3MLaywFNKQZ7xlDhc=; b=Sn+6xgdclCe7fIUuNMYNDB+NP4mPlqH0aH32SLf+6/rZb10evJj4DgTY7hHKikVAY5 3jC2pV5pRuAX26QjDb1MpZhNQJ2i+kj0JsezbKTy+RZccPSFVr7HTji1zxRcVN7Dpu5c gi1lC5+s3BsXDOhMkK2ll7K4PcZ/HB871BoMKo81v3jmB5unfOKvp1uABWpI3+jq5Bfq vMblzhv97BXm36kK0R1RqeCGh1p27VgfNY4mRnBS2p5BN55aXRYo9b+SQgWdlzrXOXjR z7lb7/3/xck9qwwXwN5b/b2KDZIGO5afuur7BXOpk2eJRlME/LhHNgjBK6uoWRsOjTIS J3Pw== X-Gm-Message-State: AAQBX9cnEaMK9ex3MXI75o+SL1KfPb8P32MNMPBT+xG4E+sb1bFpYk9Z aaE9wNFZvyab85eZa0pZrvs= X-Google-Smtp-Source: AKy350Y/nRmrw2rh2ooXbQWQuphrAsbSOFUsuiaWFUKRsYUIFqoGHv1sDvpfJuqTHBLYkR9T5muZ8w== X-Received: by 2002:a05:6a20:8048:b0:dd:c64a:5417 with SMTP id f8-20020a056a20804800b000ddc64a5417mr13185492pza.18.1681283153565; Wed, 12 Apr 2023 00:05:53 -0700 (PDT) Original-Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id h26-20020a62b41a000000b0062dd1c0cbe7sm10915943pfn.71.2023.04.12.00.05.52 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Apr 2023 00:05:53 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.3731.500.231) 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:259696 Archived-At: > On Apr 11, 2023, at 4:30 PM, Dmitry Gutov wrote: >=20 > On 11/04/2023 19:53, Juri Linkov wrote: >> I don't know if opening a new bug report is needed. >> Actually I'm doing the same thing for more ts-modes - >> trying to find a set of node names that match parens/brackets. >> So maybe this patch makes sense too: >=20 > These look sensible to me. >=20 > I think we should give a chance to the authors to chime in, though. >=20 >> treesit-sexp-type-regexp.patch >> diff --git a/lisp/progmodes/c-ts-mode.el = b/lisp/progmodes/c-ts-mode.el >> index d773b4a41f4..e55d26177af 100644 >> --- a/lisp/progmodes/c-ts-mode.el >> +++ b/lisp/progmodes/c-ts-mode.el >> @@ -927,7 +927,9 @@ c-ts-base-mode >> "qualifier" >> "type" >> "parameter" >> - "expression" >> + ;; "expression" >> + "argument_list" >> + "identifier" >> "literal" >> "string"))) >> diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el >> index f68ecb6fa6c..3876a5b54f1 100644 >> --- a/lisp/progmodes/js.el >> +++ b/lisp/progmodes/js.el >> @@ -3827,7 +3827,9 @@ js--treesit-sentence-nodes >> "See `treesit-sentence-type-regexp' for more information.") >> (defvar js--treesit-sexp-nodes >> - '("expression" >> + '("expression" ;; SHOULD NOT MATCH "expression_statement", BUT = SHOULD MATCH "parenthesized_expression" >> + "parenthesized_expression" >> + "formal_parameters" >> "pattern" >> "array" >> "function" >> @@ -3845,7 +3847,13 @@ js--treesit-sexp-nodes >> "undefined" >> "arguments" >> "pair" >> - "jsx") >> + "jsx" >> + "statement_block" >> + "object" >> + "object_pattern" >> + "named_imports" >> + "class_body" >> + ) >> "Nodes that designate sexps in JavaScript. >> See `treesit-sexp-type-regexp' for more information.") >> @@ -3893,7 +3901,7 @@ js-ts-mode >> (regexp-opt js--treesit-sentence-nodes)) >> (setq-local treesit-sexp-type-regexp >> - (regexp-opt js--treesit-sexp-nodes)) >> + (rx-to-string `(seq bol (or = ,@js--treesit-sexp-nodes) eol))) >> ;; Fontification. >> (setq-local treesit-font-lock-settings = js--treesit-font-lock-settings) >=20 Actually, would it make sense to define sexp as =E2=80=9Canything but = some very small punctuation and delimiters=E2=80=9D? I changed the = definition of c-ts-mode-sexp-type-regexp to that (see bug#62302). It = seems to work just fine. Of course, if there are problems we can revert = back. Yuan=