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#60983: 29.0.60; Tree-sitter user-level control Date: Mon, 23 Jan 2023 15:55:30 -0800 Message-ID: References: <83tu0kkuqo.fsf@gnu.org> <87tu0k3y6t.fsf@thornhill.no> <83mt6ckqts.fsf@gnu.org> <87zgacgiwe.fsf@thornhill.no> <834jshhvjh.fsf@gnu.org> <806A8560-A675-423F-9CFC-67D50D14E304@thornhill.no> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.300.101.1.3\)) 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="12774"; mail-complaints-to="usenet@ciao.gmane.io" Cc: eliz@gnu.org, 60983@debbugs.gnu.org To: Theodor Thornhill Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jan 24 00:56:24 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 1pK6fo-00037A-Cu for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 24 Jan 2023 00:56:24 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pK6fU-0005jo-Ok; Mon, 23 Jan 2023 18:56: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 1pK6fS-0005iv-U9 for bug-gnu-emacs@gnu.org; Mon, 23 Jan 2023 18:56:02 -0500 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 1pK6fS-0000ws-MS for bug-gnu-emacs@gnu.org; Mon, 23 Jan 2023 18:56:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pK6fS-0005nq-2S for bug-gnu-emacs@gnu.org; Mon, 23 Jan 2023 18:56:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 23 Jan 2023 23:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60983 X-GNU-PR-Package: emacs X-Debbugs-Original-Cc: Eli Zaretskii , Bug Report Emacs Original-Received: via spool by submit@debbugs.gnu.org id=B.167451815522294 (code B ref -1); Mon, 23 Jan 2023 23:56:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 23 Jan 2023 23:55:55 +0000 Original-Received: from localhost ([127.0.0.1]:55594 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pK6fK-0005nV-JM for submit@debbugs.gnu.org; Mon, 23 Jan 2023 18:55:54 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:53428) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pK6fI-0005nM-6c for submit@debbugs.gnu.org; Mon, 23 Jan 2023 18:55:52 -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 1pK6fG-0005hW-Ls for bug-gnu-emacs@gnu.org; Mon, 23 Jan 2023 18:55:51 -0500 Original-Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pK6fB-0000vY-1S; Mon, 23 Jan 2023 18:55:50 -0500 Original-Received: by mail-pg1-x529.google.com with SMTP id e10so10225909pgc.9; Mon, 23 Jan 2023 15:55:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=LxXmLlyOukANVuQWcdtQZ3CxVW+L3pthtwpVOpKS8bg=; b=BtI8GOOlr/ctDr7VS+KLk0R+0FYUOrKBGfSZKMplUxWHWmvAnCUzTtX+pS76KJA9fx lDGbKwOSuBZInlsckFoo16Iw/GhH5c6hSaQHgbBt0UKIcbM7NIjHxZN6BvWixL8TGte8 o2vJPn6/gI7EA5/kgd58O52VpH72BBBWUwnI1TCx6D9DNQ6kgOIk4daw7PnD5ohLixld SHExfjEGvh480NFwQFAvu5gFOFPrTSH7TOqQEyNxrMNRGngK6uwby3a++V2qcvZkjNGY 4vdcWqw9PYbnz3xv/tY16KFURbR+AYQVcJ9Z9l2vIOxwQ7TNuDRoY3lirfIufSDdjCMU feFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=LxXmLlyOukANVuQWcdtQZ3CxVW+L3pthtwpVOpKS8bg=; b=TW1s5dL4iLeYnUwgQxYHxA+nKjg1EkHhEpSBqZrpnoOjORhUTn5rgqE+hfZrQJ3mGU eFYsW90eHwRHPepdoxFPDKq44DjXpohRde6jrqbDwORCyRu9M00+xcj3vcUepjSpuhTB HNslgaV81KEdmn2QNZZRmnM6FtvNxuN/xOIbXLgMvsCxuEmoBCfCCsRpF4y9XHfA7SoC eO90uQzGFQffP1wLVyXdMJ5h93ZkL0FCU/6XQY7IaB5PP1t6jUgjrO8ov1EG6w4jelsX erjEOLm3JDq0wPNyjygAomMgvGTqszaoUubokxyXb17ZBa7SsKdPDBq7xtBVFvpcXSxJ Ll/A== X-Gm-Message-State: AFqh2kqSD28mb/dK3bVxuGHVhAEPE1CZ6MG3sm1VoeDWiy7SLyGJgGR/ JTa58mT84xPvhVJ30LVvT8mZt1mamaE= X-Google-Smtp-Source: AMrXdXvRMRXYYXTfnrHX73JhnLXiOPUXHBYbZWC/thBaR0NIOxj9f86CCkamj7F8PNkxAbWMzdjBcA== X-Received: by 2002:a62:154f:0:b0:581:3557:f75b with SMTP id 76-20020a62154f000000b005813557f75bmr51537686pfv.5.1674518142709; Mon, 23 Jan 2023 15:55:42 -0800 (PST) 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 q13-20020a056a0002ad00b00587304cbd3fsm147628pfs.181.2023.01.23.15.55.42 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Jan 2023 15:55:42 -0800 (PST) In-Reply-To: <806A8560-A675-423F-9CFC-67D50D14E304@thornhill.no> X-Mailer: Apple Mail (2.3731.300.101.1.3) Received-SPF: pass client-ip=2607:f8b0:4864:20::529; envelope-from=casouri@gmail.com; helo=mail-pg1-x529.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:254033 Archived-At: > On Jan 23, 2023, at 1:08 PM, Theodor Thornhill = wrote: >=20 >=20 >=20 > On 23 January 2023 20:59:14 CET, Eli Zaretskii wrote: >>> From: Yuan Fu >>> Date: Mon, 23 Jan 2023 11:37:24 -0800 >>> Cc: Eli Zaretskii , >>> Bug Report Emacs >>>=20 >>> Sorry for the delay, overall I agree with your changes. >>=20 >> Thanks. What about the questions I asked regarding indentation >> features, and specifically about c-ts-mode-indent-style? >=20 > I am working on that, but I hit some issues where I cannot make = treesit recognize the new settings before the whole = treesit-major-mode-setup reruns. Just setting the symbol doesn't work, = and reenabling the mode inside of the :set function isn't the best idea = maybe? >=20 > I'd love some pointers to how other modes do similar stuff, but I = didn't really find anything. One common approach is to iterate over all live buffer and reset the = variable (in this case treesit-simple-indent-rules) on applicate buffers = (in this case c/c++-ts-mode buffers). It would be nice to also have a command c-ts-mode-set-style (like = c-set-style) that takes a style symbol and sets = treesit-simple-indent-rules accordingly. And in major-mode setup, ie, = c-ts-mode=E2=80=99s body, you call it with c-ts-mode-indent-style. Yuan