From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Theodor Thornhill via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#60983: 29.0.60; Tree-sitter user-level control Date: Sat, 21 Jan 2023 12:48:58 +0100 Message-ID: <87tu0k3y6t.fsf@thornhill.no> References: <83tu0kkuqo.fsf@gnu.org> Reply-To: Theodor Thornhill Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8565"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Yuan Fu To: eliz@gnu.org, 60983@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 21 12:50:10 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 1pJCNt-00021T-Kz for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 21 Jan 2023 12:50:09 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pJCNp-0006nv-Ci; Sat, 21 Jan 2023 06:50:05 -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 1pJCNn-0006nh-6a for bug-gnu-emacs@gnu.org; Sat, 21 Jan 2023 06:50:03 -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 1pJCNm-0001N1-Up for bug-gnu-emacs@gnu.org; Sat, 21 Jan 2023 06:50:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pJCNm-0001x1-JV for bug-gnu-emacs@gnu.org; Sat, 21 Jan 2023 06:50:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Theodor Thornhill Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Jan 2023 11:50: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-To: Eli Zaretskii , bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16743017557441 (code B ref -1); Sat, 21 Jan 2023 11:50:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 21 Jan 2023 11:49:15 +0000 Original-Received: from localhost ([127.0.0.1]:48195 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pJCN0-0001vx-U2 for submit@debbugs.gnu.org; Sat, 21 Jan 2023 06:49:15 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:37432) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pJCMy-0001vo-A5 for submit@debbugs.gnu.org; Sat, 21 Jan 2023 06:49:13 -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 1pJCMy-0006HL-0O for bug-gnu-emacs@gnu.org; Sat, 21 Jan 2023 06:49:12 -0500 Original-Received: from out0.migadu.com ([2001:41d0:2:267::]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pJCMu-0000oI-JN; Sat, 21 Jan 2023 06:49:11 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1674301742; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=wpLeYoVwPIihEM8XKDMIAIdgAjdydqlHircI3K5JCRI=; b=bv7iFy99+yCHcq2r6Qi7a8j1+IFV5HwIDX1/3XLmuJnxO2esDFKkz6z01IuHivEZOVJ4Rb ydHAZJI9xZDCWd9rlBINuAomMXDXwBTvNh3SxTnY2hdIq5myr/eYj5CjJWzrFu7OMmGpst IJK8GXyI8I8qPcMYLPrSPfQI36P+uDZ3jj+VIFS1VOaQFIJnrkHBbVWuIO0Q/43MlD6Uzo d0/26Hj5/ygq9pzAdKeMIfMyTT4OMiargYjgPCfKXGvCw9pDUqEySbBfNiGiZHUiroD4Iq CFmZjdZSVIU7BdVByE6w8WwNtdgFO5io5GnsEOlCehxVZ8sp48WOza+O9mP2qg== In-Reply-To: <83tu0kkuqo.fsf@gnu.org> X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=2001:41d0:2:267::; envelope-from=theo@thornhill.no; helo=out0.migadu.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-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:253854 Archived-At: Eli Zaretskii writes: > I started looking into providing user-level documentation for > tree-sitter based modes, and bumped into some issues: > > . How does one use treesit-font-lock-level? > > - It is not a customizable user option (unlike > font-lock-maximum-decoration), so it cannot be set via > customize-variable. Is there a reason not to make it a > defcustom? > - It automatically becomes buffer-local when set, and OTOH setting > it in a buffer does not produce fontifications according to the > level, and neither does setting it in a mode hook. So the only > way to change its value is by using setq-default, which I don't > think is the intent? > - Should we make the variable a defcustom? > - Should it be possible to customize it separately for each mode? > - Should we allow to change the level and then call some function > to re-fontify the current buffer according to the new level? I struggled with this too. I ended up setting it with setq-default, assuming I was just missing something very simple. I'm in favor for either a defcustom or honoring the font-lock-maximum-decoration values, specifically these settings: ``` If t, use the maximum decoration available. If a number, use that level of decoration (or if not available the maximum). ``` > > . How does one change the indentation style in c-ts-mode? > > - There is a defcustom c-ts-mode-indent-style, but I don't think I > see any difference in indentation of new code when I change the > value. What am I missing? > (setq c-ts-mode-indent-style 'bsd) then revert-buffer fixes it for me. It seems you need to reload the file to enable the new style. Should I add a command that can be set explicitly as in c-mode? 'c-ts-mode-set-style'? However, going over it I see there are lots of regressions after the new bracket-counting code added recently, effectively making the indent styles pretty broken right now... For example with bsd style: Previously: int main() { if (x) { } else { } } now: int main() { if (x) { } else { } } > . What commands are affected by treesit-defun-tactic? 'treesit--navigate-thing' uses it, so 'beginning-of-defun', 'forward-sentence' etc uses it through 'treesit-beginning-of-thing'. Theo