GNU bug report logs - #60961
29.0.60; Compiling emacs-29 without treesitter outputs warnings

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Robert Pluim <rpluim@HIDDEN>; dated Fri, 20 Jan 2023 10:31:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
bug Marked as fixed in versions 30.1. Request was from Theodor Thornhill <theo@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 60961 <at> debbugs.gnu.org:


Received: (at 60961) by debbugs.gnu.org; 21 Jan 2023 12:46:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 21 07:46:54 2023
Received: from localhost ([127.0.0.1]:48284 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pJDGo-0005l2-Ay
	for submit <at> debbugs.gnu.org; Sat, 21 Jan 2023 07:46:54 -0500
Received: from out-248.mta0.migadu.com ([91.218.175.248]:16732)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <theo@HIDDEN>) id 1pJDGl-0005ku-WD
 for 60961 <at> debbugs.gnu.org; Sat, 21 Jan 2023 07:46:53 -0500
X-Report-Abuse: Please report any abuse attempt to abuse@HIDDEN and
 include these headers.
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no;
 s=key1; t=1674305211;
 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=Fasy/tlOEyRRKyY1HSovQSm2jGAs80X2g9nNLq2AGdA=;
 b=RtGHr3soFL2G9UElB/sr5YhVDfSIfixTItDlEF2Mmn0eUPVCfI543vuKng4occESj5IWU9
 b5oWJ8JQlDyI1Nq8isS6u5daAnoTbMwIM+Dk8bN9Y0zV6Uwc/sGijdtrDbAuEdf0uAgFf8
 puIuX4cbfq2vJXiHsq9HeKoQ5sZz0f25AS9QJk9LL6PXlE/DcoTfA++V2ejv/UzLWbA7C2
 2WnfoB0s0Sdpkmvti7phQU23GET6RMBwbl1a385VFO21/EBp4jiwu/06K8L4Wt8FaXjQid
 NR/5L9ARdqn7sSkE3hfvwMhQ7nK0tvrnFuwK9fV6LNzqbevfqTjbNTE221MjQQ==
From: Theodor Thornhill <theo@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#60961: 29.0.60; Compiling emacs-29 without treesitter
 outputs warnings
In-Reply-To: <83lelwkqpz.fsf@HIDDEN>
References: <878rhx1os6.fsf@HIDDEN> <831qnpnx9g.fsf@HIDDEN>
 <87o7qtuxgh.fsf@HIDDEN> <83tu0lmgv6.fsf@HIDDEN>
 <87h6wll10q.fsf@HIDDEN> <83r0vpme0t.fsf@HIDDEN>
 <8A47E6B6-BE4F-44F4-9BC5-55B6051CDCD4@HIDDEN>
 <CEC5A327-07CF-4621-BB52-1D1C6AFF51F4@HIDDEN> <83edromses.fsf@HIDDEN>
 <87edrohy8j.fsf@HIDDEN> <83lelwkqpz.fsf@HIDDEN>
Date: Sat, 21 Jan 2023 13:46:49 +0100
Message-ID: <87r0vogime.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Migadu-Flow: FLOW_OUT
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 60961
Cc: casouri@HIDDEN, rpluim@HIDDEN, 60961 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: Theodor Thornhill <theo@HIDDEN>
>> Cc: rpluim@HIDDEN, 60961 <at> debbugs.gnu.org
>> Date: Sat, 21 Jan 2023 13:24:12 +0100
>> 
>> > c-ts-common.el SGTM, thanks.
>> 
>> Something like this?  I get no warnings on tree-sitter-less build on
>> emacs-29 now.
>
> Yes, thanks.
>

No problem.

>> Do we need anything in NEWS or anywhere else?
>
> No, this is an internal implementation issue.

Ok, installing it later today, then, unless anyone else objects.

Thanks,

Theo





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#60961; Package emacs. Full text available.

Message received at 60961 <at> debbugs.gnu.org:


Received: (at 60961) by debbugs.gnu.org; 21 Jan 2023 12:38:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 21 07:38:21 2023
Received: from localhost ([127.0.0.1]:48247 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pJD8X-0005Vi-83
	for submit <at> debbugs.gnu.org; Sat, 21 Jan 2023 07:38:21 -0500
Received: from eggs.gnu.org ([209.51.188.92]:48016)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1pJD8V-0005VU-Vv
 for 60961 <at> debbugs.gnu.org; Sat, 21 Jan 2023 07:38:20 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pJD8Q-00023o-Kk; Sat, 21 Jan 2023 07:38:14 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=nMiihmYmBMR6NPl16C4VpQn57cKHB8idmtNs/QDlEDQ=; b=JyVlZYckXjZQ
 4r8ZCLSiCcw9EUUefVqao4VUjFKX+yHqLd7826hLXarhWxrzsTa2JUxv8wO9Y5x0D2reNjlyGrBpf
 UG+Wo1B5unJaTe44WkqEvD/GlpKKyVPVcrm613E82E/9AnYEk++dH4EKLUJ8Q4NiOAXRE2WXNVDKa
 zpkTq2Ipm0FAu4D4hiSu1sXh0sfVyBx4QmgkipLKaGMRLsPXgnSJ8H+YJmXKkUrogdSqNeDB908DT
 EQM27JSJwKKPgHtypkdB+HePe+XicBTsg1oUzKRGb6SmFW9SkJUW9Ib55kaj0cm8iwJCypqWQkRQk
 8Fera3MkgIx7mxlAgOzsNA==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pJD8P-0007K2-Ql; Sat, 21 Jan 2023 07:38:14 -0500
Date: Sat, 21 Jan 2023 14:38:16 +0200
Message-Id: <83lelwkqpz.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Theodor Thornhill <theo@HIDDEN>
In-Reply-To: <87edrohy8j.fsf@HIDDEN> (message from Theodor Thornhill on
 Sat, 21 Jan 2023 13:24:12 +0100)
Subject: Re: bug#60961: 29.0.60; Compiling emacs-29 without treesitter
 outputs warnings
References: <878rhx1os6.fsf@HIDDEN> <831qnpnx9g.fsf@HIDDEN>
 <87o7qtuxgh.fsf@HIDDEN> <83tu0lmgv6.fsf@HIDDEN>
 <87h6wll10q.fsf@HIDDEN> <83r0vpme0t.fsf@HIDDEN>
 <8A47E6B6-BE4F-44F4-9BC5-55B6051CDCD4@HIDDEN>
 <CEC5A327-07CF-4621-BB52-1D1C6AFF51F4@HIDDEN> <83edromses.fsf@HIDDEN>
 <87edrohy8j.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 60961
Cc: casouri@HIDDEN, rpluim@HIDDEN, 60961 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Theodor Thornhill <theo@HIDDEN>
> Cc: rpluim@HIDDEN, 60961 <at> debbugs.gnu.org
> Date: Sat, 21 Jan 2023 13:24:12 +0100
> 
> > c-ts-common.el SGTM, thanks.
> 
> Something like this?  I get no warnings on tree-sitter-less build on
> emacs-29 now.

Yes, thanks.

> Do we need anything in NEWS or anywhere else?

No, this is an internal implementation issue.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#60961; Package emacs. Full text available.

Message received at 60961 <at> debbugs.gnu.org:


Received: (at 60961) by debbugs.gnu.org; 21 Jan 2023 12:24:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 21 07:24:23 2023
Received: from localhost ([127.0.0.1]:48228 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pJCuz-0002pw-Jw
	for submit <at> debbugs.gnu.org; Sat, 21 Jan 2023 07:24:23 -0500
Received: from out2.migadu.com ([188.165.223.204]:39926)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <theo@HIDDEN>) id 1pJCuw-0002pl-Ll
 for 60961 <at> debbugs.gnu.org; Sat, 21 Jan 2023 07:24:21 -0500
X-Report-Abuse: Please report any abuse attempt to abuse@HIDDEN and
 include these headers.
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no;
 s=key1; t=1674303856;
 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=pimPxQDfIdGKSpUIEzUKc12/mSQZyigawWqXKDWuf00=;
 b=0rrIdj+P491z3B1ra+RRtGjJv2KAk+vRKVdM619+WsvRVxWFXqvgRtCCDlf2IbikCc7Wui
 alnolhMp6bAFPFjGNQZr/+16M9s1LKVCtwz4uIRZejNI4XM3KW+jTsN0nnLGDtNWGJ6CYz
 BFnjJN7y12jd09MNEEGn8uaWE+d5DFeZWfpiaD/Wdss96RVYk8kTC8+r8vlivlPaU2tmt/
 F9syyL63iipBlwcMaLtA93MXcBw6veeFQ2e07GVS/bmk538mBkgfhQarIvj6XfOhKRdH6n
 qtaMC7qHFZpqZm5ZohGhh7HP41f6Rf20OF6ssKABN1QiFK32QKEUoQz1nHiHJQ==
From: Theodor Thornhill <theo@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>, Yuan Fu <casouri@HIDDEN>
Subject: Re: bug#60961: 29.0.60; Compiling emacs-29 without treesitter
 outputs warnings
In-Reply-To: <83edromses.fsf@HIDDEN>
References: <878rhx1os6.fsf@HIDDEN> <831qnpnx9g.fsf@HIDDEN>
 <87o7qtuxgh.fsf@HIDDEN> <83tu0lmgv6.fsf@HIDDEN>
 <87h6wll10q.fsf@HIDDEN> <83r0vpme0t.fsf@HIDDEN>
 <8A47E6B6-BE4F-44F4-9BC5-55B6051CDCD4@HIDDEN>
 <CEC5A327-07CF-4621-BB52-1D1C6AFF51F4@HIDDEN> <83edromses.fsf@HIDDEN>
Date: Sat, 21 Jan 2023 13:24:12 +0100
Message-ID: <87edrohy8j.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Migadu-Flow: FLOW_OUT
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 60961
Cc: rpluim@HIDDEN, 60961 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: Yuan Fu <casouri@HIDDEN>
>> Date: Fri, 20 Jan 2023 14:11:44 -0800
>> Cc: Eli Zaretskii <eliz@HIDDEN>,
>>  rpluim@HIDDEN,
>>  60961 <at> debbugs.gnu.org
>>=20
>> I=E2=80=99d prefer c-ts-common.el over treesit.el, since they only apply=
 to C-like languages. There is no harm putting them in a separate file, rig=
ht? I wrote some commentary in c-ts-mode, which notes all the shared functi=
ons and variables.=20
>
> c-ts-common.el SGTM, thanks.

Something like this?  I get no warnings on tree-sitter-less build on
emacs-29 now.
Do we need anything in NEWS or anywhere else?

Theo


--=-=-=
Content-Type: text/x-patch; charset=utf-8
Content-Disposition: attachment;
 filename=0001-Move-c-like-common-utils-into-own-library-bug-60961.patch
Content-Transfer-Encoding: quoted-printable

From b7f7b135cf42d9de73c83ba953e3e149dde19f0f Mon Sep 17 00:00:00 2001
From: Theodor Thornhill <theo@HIDDEN>
Date: Sat, 21 Jan 2023 12:24:55 +0100
Subject: [PATCH] Move c-like common utils into own library (bug#60961)

* lisp/progmodes/c-ts-common.el: New file.
* lisp/progmodes/c-ts-mode.el (treesit-induce-sparse-tree): Remove
unused declaration.
(c-ts-mode--indent-styles): Refer to the new library.
(c-ts-mode--looking-at-star,
c-ts-mode--comment-start-after-first-star,
c-ts-mode--comment-2nd-line-matcher,
c-ts-mode--comment-2nd-line-anchor, c-ts-mode--comment-regexp,
c-ts-mode--fill-paragraph, c-ts-mode--fill-block-comment): Move to
c-ts-common and expose as public.
(c-ts-mode-comment-setup): Move to c-ts-common.
* lisp/progmodes/csharp-mode.el (c-ts-common): Require new library.
(csharp-ts-mode--indent-rules): Refer to the new symbols.
(csharp-ts-mode): Use new function.
* lisp/progmodes/java-ts-mode.el (c-ts-common): Require new library.
(java-ts-mode--indent-rules): Refer to the new symbols.
(java-ts-mode): Use new function.
* lisp/progmodes/js.el (c-ts-common): Require new library.
(js--treesit-indent-rules): Refer to the new symbols.
(js-ts-mode): Use new function.
* lisp/progmodes/rust-ts-mode.el (c-ts-common): Require new library.
(rust-ts-mode--indent-rules): Refer to the new symbols.
(rust-ts-mode): Use new function.
* lisp/progmodes/typescript-ts-mode.el (c-ts-common): Require new
library.
(typescript-ts-mode--indent-rules): Refer to the new symbols.
(typescript-ts-base-mode): Use new function.
---
 lisp/progmodes/c-ts-common.el        | 247 +++++++++++++++++++++++++++
 lisp/progmodes/c-ts-mode.el          | 228 +------------------------
 lisp/progmodes/csharp-mode.el        |   8 +-
 lisp/progmodes/java-ts-mode.el       |   8 +-
 lisp/progmodes/js.el                 |   8 +-
 lisp/progmodes/rust-ts-mode.el       |   8 +-
 lisp/progmodes/typescript-ts-mode.el |   8 +-
 7 files changed, 275 insertions(+), 240 deletions(-)
 create mode 100644 lisp/progmodes/c-ts-common.el

diff --git a/lisp/progmodes/c-ts-common.el b/lisp/progmodes/c-ts-common.el
new file mode 100644
index 0000000000..6671d4be5b
--- /dev/null
+++ b/lisp/progmodes/c-ts-common.el
@@ -0,0 +1,247 @@
+;;; c-ts-common.el --- Utilities for C like Languages  -*- lexical-binding=
: t; -*-
+
+;; Copyright (C) 2023 Free Software Foundation, Inc.
+
+;; Author     : =E4=BB=98=E7=A6=B9=E5=AE=89 (Yuan Fu) <casouri@HIDDEN>
+;; Keywords   : c c++ java javascript rust languages tree-sitter
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;;
+;; For C-like language major modes:
+;;
+;; - Use `c-ts-common-comment-setup' to setup comment variables and
+;;   filling.
+;;
+;; - Use simple-indent matcher `c-ts-common-looking-at-star' and
+;;   anchor `c-ts-common-comment-start-after-first-star' for indenting
+;;   block comments.  See `c-ts-mode--indent-styles' for example.
+
+;;; Code:
+
+(require 'treesit)
+(eval-when-compile (require 'rx))
+
+(declare-function treesit-node-start "treesit.c")
+(declare-function treesit-node-end "treesit.c")
+(declare-function treesit-node-type "treesit.c")
+
+(defun c-ts-common-looking-at-star (_n _p bol &rest _)
+  "A tree-sitter simple indent matcher.
+Matches if there is a \"*\" after BOL."
+  (eq (char-after bol) ?*))
+
+(defun c-ts-common-comment-start-after-first-star (_n parent &rest _)
+  "A tree-sitter simple indent anchor.
+Finds the \"/*\" and returns the point after the \"*\".
+Assumes PARENT is a comment node."
+  (save-excursion
+    (goto-char (treesit-node-start parent))
+    (if (looking-at (rx "/*"))
+        (match-end 0)
+      (point))))
+
+(defun c-ts-common-comment-2nd-line-matcher (_n parent &rest _)
+  "Matches if point is at the second line of a block comment.
+PARENT should be a comment node."
+  (and (equal (treesit-node-type parent) "comment")
+       (save-excursion
+         (forward-line -1)
+         (back-to-indentation)
+         (eq (point) (treesit-node-start parent)))))
+
+(defun c-ts-common-comment-2nd-line-anchor (_n _p bol &rest _)
+  "Return appropriate anchor for the second line of a comment.
+
+If the first line is /* alone, return the position right after
+the star; if the first line is /* followed by some text, return
+the position right before the text minus 1.
+
+Use an offset of 1 with this anchor.  BOL is the beginning of
+non-whitespace characters of the current line."
+  (save-excursion
+    (forward-line -1)
+    (back-to-indentation)
+    (when (looking-at comment-start-skip)
+      (goto-char (match-end 0))
+      (if (looking-at (rx (* (or " " "\t")) eol))
+          ;; Only /* at the first line.
+          (progn (skip-chars-backward " \t")
+                 (if (save-excursion
+                       (goto-char bol)
+                       (looking-at (rx "*")))
+                     ;; The common case.  Checked by "Multiline Block
+                     ;; Comments 4".
+                     (point)
+                   ;; The "Multiline Block Comments 2" test in
+                   ;; c-ts-common-resources/indent.erts checks this.
+                   (1- (point))))
+        ;; There is something after /* at the first line.  The
+        ;; "Multiline Block Comments 3" test checks this.
+        (1- (point))))))
+
+(defvar c-ts-common--comment-regexp
+  ;; These covers C/C++, Java, JavaScript, TypeScript, Rust, C#.
+  (rx (or "comment" "line_comment" "block_comment"))
+  "Regexp pattern that matches a comment in C-like languages.")
+
+(defun c-ts-common--fill-paragraph (&optional arg)
+  "Fillling function for `c-ts-common'.
+ARG is passed to `fill-paragraph'."
+  (interactive "*P")
+  (save-restriction
+    (widen)
+    (let ((node (treesit-node-at (point))))
+      (when (string-match-p c-ts-common--comment-regexp
+                            (treesit-node-type node))
+        (if (save-excursion
+              (goto-char (treesit-node-start node))
+              (looking-at "//"))
+            (fill-comment-paragraph arg)
+          (c-ts-common--fill-block-comment arg)))
+      ;; Return t so `fill-paragraph' doesn't attempt to fill by
+      ;; itself.
+      t)))
+
+(defun c-ts-common--fill-block-comment (&optional arg)
+  "Fillling function for block comments.
+ARG is passed to `fill-paragraph'.  Assume point is in a block
+comment."
+  (let* ((node (treesit-node-at (point)))
+         (start (treesit-node-start node))
+         (end (treesit-node-end node))
+         ;; Bind to nil to avoid infinite recursion.
+         (fill-paragraph-function nil)
+         (orig-point (point-marker))
+         (start-marker (point-marker))
+         (end-marker nil)
+         (end-len 0))
+    (move-marker start-marker start)
+    ;; We mask "/*" and the space before "*/" like
+    ;; `c-fill-paragraph' does.
+    (atomic-change-group
+      ;; Mask "/*".
+      (goto-char start)
+      (when (looking-at (rx (* (syntax whitespace))
+                            (group "/") "*"))
+        (goto-char (match-beginning 1))
+        (move-marker start-marker (point))
+        (replace-match " " nil nil nil 1))
+      ;; Include whitespaces before /*.
+      (goto-char start)
+      (beginning-of-line)
+      (setq start (point))
+      ;; Mask spaces before "*/" if it is attached at the end
+      ;; of a sentence rather than on its own line.
+      (goto-char end)
+      (when (looking-back (rx (not (syntax whitespace))
+                              (group (+ (syntax whitespace)))
+                              "*/")
+                          (line-beginning-position))
+        (goto-char (match-beginning 1))
+        (setq end-marker (point-marker))
+        (setq end-len (- (match-end 1) (match-beginning 1)))
+        (replace-match (make-string end-len ?x)
+                       nil nil nil 1))
+      ;; If "*/" is on its own line, don't included it in the
+      ;; filling region.
+      (when (not end-marker)
+        (goto-char end)
+        (when (looking-back (rx "*/") 2)
+          (backward-char 2)
+          (skip-syntax-backward "-")
+          (setq end (point))))
+      ;; Let `fill-paragraph' do its thing.
+      (goto-char orig-point)
+      (narrow-to-region start end)
+      ;; We don't want to fill the region between START and
+      ;; START-MARKER, otherwise the filling function might delete
+      ;; some spaces there.
+      (fill-region start-marker end arg)
+      ;; Unmask.
+      (when start-marker
+        (goto-char start-marker)
+        (delete-char 1)
+        (insert "/"))
+      (when end-marker
+        (goto-char end-marker)
+        (delete-region (point) (+ end-len (point)))
+        (insert (make-string end-len ?\s))))))
+
+(defun c-ts-common-comment-setup ()
+  "Set up local variables for C-like comment.
+
+Set up:
+ - `comment-start'
+ - `comment-end'
+ - `comment-start-skip'
+ - `comment-end-skip'
+ - `adaptive-fill-mode'
+ - `adaptive-fill-first-line-regexp'
+ - `paragraph-start'
+ - `paragraph-separate'
+ - `fill-paragraph-function'"
+  (setq-local comment-start "// ")
+  (setq-local comment-end "")
+  (setq-local comment-start-skip (rx (or (seq "/" (+ "/"))
+                                         (seq "/" (+ "*")))
+                                     (* (syntax whitespace))))
+  (setq-local comment-end-skip
+              (rx (* (syntax whitespace))
+                  (group (or (syntax comment-end)
+                             (seq (+ "*") "/")))))
+  (setq-local adaptive-fill-mode t)
+  ;; This matches (1) empty spaces (the default), (2) "//", (3) "*",
+  ;; but do not match "/*", because we don't want to use "/*" as
+  ;; prefix when filling.  (Actually, it doesn't matter, because
+  ;; `comment-start-skip' matches "/*" which will cause
+  ;; `fill-context-prefix' to use "/*" as a prefix for filling, that's
+  ;; why we mask the "/*" in `c-ts-common--fill-paragraph'.)
+  (setq-local adaptive-fill-regexp
+              (concat (rx (* (syntax whitespace))
+                          (group (or (seq "/" (+ "/")) (* "*"))))
+                      adaptive-fill-regexp))
+  ;; Note the missing * comparing to `adaptive-fill-regexp'.  The
+  ;; reason for its absence is a bit convoluted to explain.  Suffice
+  ;; to say that without it, filling a single line paragraph that
+  ;; starts with /* doesn't insert * at the beginning of each
+  ;; following line, and filling a multi-line paragraph whose first
+  ;; two lines start with * does insert * at the beginning of each
+  ;; following line.  If you know how does adaptive filling works, you
+  ;; know what I mean.
+  (setq-local adaptive-fill-first-line-regexp
+              (rx bos
+                  (seq (* (syntax whitespace))
+                       (group (seq "/" (+ "/")))
+                       (* (syntax whitespace)))
+                  eos))
+  ;; Same as `adaptive-fill-regexp'.
+  (setq-local paragraph-start
+              (rx (or (seq (* (syntax whitespace))
+                           (group (or (seq "/" (+ "/")) (* "*")))
+                           (* (syntax whitespace))
+                           ;; Add this eol so that in
+                           ;; `fill-context-prefix', `paragraph-start'
+                           ;; doesn't match the prefix.
+                           eol)
+                      "\f")))
+  (setq-local paragraph-separate paragraph-start)
+  (setq-local fill-paragraph-function #'c-ts-common--fill-paragraph))
+
+(provide 'c-ts-common)
+
+;;; c-ts-common.el ends here
diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el
index 8ddd622a05..03793d61ba 100644
--- a/lisp/progmodes/c-ts-mode.el
+++ b/lisp/progmodes/c-ts-mode.el
@@ -64,26 +64,18 @@
 ;; files, provided that you have the corresponding parser grammar
 ;; libraries installed.
 ;;
-;; For C-like language major modes:
-;;
-;; - Use `c-ts-mode-comment-setup' to setup comment variables and
-;;   filling.
-;;
-;; - Use simple-indent matcher `c-ts-mode--looking-at-star' and anchor
-;;   `c-ts-mode--comment-start-after-first-star' for indenting block
-;;   comments.  See `c-ts-mode--indent-styles' for example.
-;;
 ;; - Use variable `c-ts-mode-indent-block-type-regexp' with indent
 ;;   offset c-ts-mode--statement-offset for indenting statements.
 ;;   Again, see `c-ts-mode--indent-styles' for example.
+;;
=20
 ;;; Code:
=20
 (require 'treesit)
+(require 'c-ts-common)
 (eval-when-compile (require 'rx))
=20
 (declare-function treesit-parser-create "treesit.c")
-(declare-function treesit-induce-sparse-tree "treesit.c")
 (declare-function treesit-node-parent "treesit.c")
 (declare-function treesit-node-start "treesit.c")
 (declare-function treesit-node-end "treesit.c")
@@ -173,12 +165,12 @@ c-ts-mode--indent-styles
            ((node-is "else") parent-bol 0)
            ((node-is "case") parent-bol 0)
            ((node-is "preproc_arg") no-indent)
-           ;; `c-ts-mode--looking-at-star' has to come before
-           ;; `c-ts-mode--comment-2nd-line-matcher'.
+           ;; `c-ts-common-looking-at-star' has to come before
+           ;; `c-ts-common-comment-2nd-line-matcher'.
            ((and (parent-is "comment") c-ts-mode--looking-at-star)
-            c-ts-mode--comment-start-after-first-star -1)
-           (c-ts-mode--comment-2nd-line-matcher
-            c-ts-mode--comment-2nd-line-anchor
+            c-ts-common-comment-start-after-first-star -1)
+           (c-ts-common-comment-2nd-line-matcher
+            c-ts-common-comment-2nd-line-anchor
             1)
            ((parent-is "comment") prev-adaptive-prefix 0)
=20
@@ -333,60 +325,6 @@ c-ts-mode--close-bracket-offset
   (- (c-ts-mode--statement-offset node parent)
      c-ts-mode-indent-offset))
=20
-(defun c-ts-mode--looking-at-star (_n _p bol &rest _)
-  "A tree-sitter simple indent matcher.
-Matches if there is a \"*\" after BOL."
-  (eq (char-after bol) ?*))
-
-(defun c-ts-mode--comment-start-after-first-star (_n parent &rest _)
-  "A tree-sitter simple indent anchor.
-Finds the \"/*\" and returns the point after the \"*\".
-Assumes PARENT is a comment node."
-  (save-excursion
-    (goto-char (treesit-node-start parent))
-    (if (looking-at (rx "/*"))
-        (match-end 0)
-      (point))))
-
-(defun c-ts-mode--comment-2nd-line-matcher (_n parent &rest _)
-  "Matches if point is at the second line of a block comment.
-PARENT should be a comment node."
-  (and (equal (treesit-node-type parent) "comment")
-       (save-excursion
-         (forward-line -1)
-         (back-to-indentation)
-         (eq (point) (treesit-node-start parent)))))
-
-(defun c-ts-mode--comment-2nd-line-anchor (_n _p bol &rest _)
-  "Return appropriate anchor for the second line of a comment.
-
-If the first line is /* alone, return the position right after
-the star; if the first line is /* followed by some text, return
-the position right before the text minus 1.
-
-Use an offset of 1 with this anchor.  BOL is the beginning of
-non-whitespace characters of the current line."
-  (save-excursion
-    (forward-line -1)
-    (back-to-indentation)
-    (when (looking-at comment-start-skip)
-      (goto-char (match-end 0))
-      (if (looking-at (rx (* (or " " "\t")) eol))
-          ;; Only /* at the first line.
-          (progn (skip-chars-backward " \t")
-                 (if (save-excursion
-                       (goto-char bol)
-                       (looking-at (rx "*")))
-                     ;; The common case.  Checked by "Multiline Block
-                     ;; Comments 4".
-                     (point)
-                   ;; The "Multiline Block Comments 2" test in
-                   ;; c-ts-mode-resources/indent.erts checks this.
-                   (1- (point))))
-        ;; There is something after /* at the first line.  The
-        ;; "Multiline Block Comments 3" test checks this.
-        (1- (point))))))
-
 ;;; Font-lock
=20
 (defvar c-ts-mode--preproc-keywords
@@ -782,156 +720,6 @@ c-ts-mode-indent-defun
                    (treesit-node-end node))
     (goto-char orig-point)))
=20
-;;; Filling
-
-(defvar c-ts-mode--comment-regexp
-  ;; These covers C/C++, Java, JavaScript, TypeScript, Rust, C#.
-  (rx (or "comment" "line_comment" "block_comment"))
-  "Regexp pattern that matches a comment in C-like languages.")
-
-(defun c-ts-mode--fill-paragraph (&optional arg)
-  "Fillling function for `c-ts-mode'.
-ARG is passed to `fill-paragraph'."
-  (interactive "*P")
-  (save-restriction
-    (widen)
-    (let ((node (treesit-node-at (point))))
-      (when (string-match-p c-ts-mode--comment-regexp
-                            (treesit-node-type node))
-        (if (save-excursion
-              (goto-char (treesit-node-start node))
-              (looking-at "//"))
-            (fill-comment-paragraph arg)
-          (c-ts-mode--fill-block-comment arg)))
-      ;; Return t so `fill-paragraph' doesn't attempt to fill by
-      ;; itself.
-      t)))
-
-(defun c-ts-mode--fill-block-comment (&optional arg)
-  "Fillling function for block comments.
-ARG is passed to `fill-paragraph'.  Assume point is in a block
-comment."
-  (let* ((node (treesit-node-at (point)))
-         (start (treesit-node-start node))
-         (end (treesit-node-end node))
-         ;; Bind to nil to avoid infinite recursion.
-         (fill-paragraph-function nil)
-         (orig-point (point-marker))
-         (start-marker (point-marker))
-         (end-marker nil)
-         (end-len 0))
-    (move-marker start-marker start)
-    ;; We mask "/*" and the space before "*/" like
-    ;; `c-fill-paragraph' does.
-    (atomic-change-group
-      ;; Mask "/*".
-      (goto-char start)
-      (when (looking-at (rx (* (syntax whitespace))
-                            (group "/") "*"))
-        (goto-char (match-beginning 1))
-        (move-marker start-marker (point))
-        (replace-match " " nil nil nil 1))
-      ;; Include whitespaces before /*.
-      (goto-char start)
-      (beginning-of-line)
-      (setq start (point))
-      ;; Mask spaces before "*/" if it is attached at the end
-      ;; of a sentence rather than on its own line.
-      (goto-char end)
-      (when (looking-back (rx (not (syntax whitespace))
-                              (group (+ (syntax whitespace)))
-                              "*/")
-                          (line-beginning-position))
-        (goto-char (match-beginning 1))
-        (setq end-marker (point-marker))
-        (setq end-len (- (match-end 1) (match-beginning 1)))
-        (replace-match (make-string end-len ?x)
-                       nil nil nil 1))
-      ;; If "*/" is on its own line, don't included it in the
-      ;; filling region.
-      (when (not end-marker)
-        (goto-char end)
-        (when (looking-back (rx "*/") 2)
-          (backward-char 2)
-          (skip-syntax-backward "-")
-          (setq end (point))))
-      ;; Let `fill-paragraph' do its thing.
-      (goto-char orig-point)
-      (narrow-to-region start end)
-      ;; We don't want to fill the region between START and
-      ;; START-MARKER, otherwise the filling function might delete
-      ;; some spaces there.
-      (fill-region start-marker end arg)
-      ;; Unmask.
-      (when start-marker
-        (goto-char start-marker)
-        (delete-char 1)
-        (insert "/"))
-      (when end-marker
-        (goto-char end-marker)
-        (delete-region (point) (+ end-len (point)))
-        (insert (make-string end-len ?\s))))))
-
-(defun c-ts-mode-comment-setup ()
-  "Set up local variables for C-like comment.
-
-Set up:
- - `comment-start'
- - `comment-end'
- - `comment-start-skip'
- - `comment-end-skip'
- - `adaptive-fill-mode'
- - `adaptive-fill-first-line-regexp'
- - `paragraph-start'
- - `paragraph-separate'
- - `fill-paragraph-function'"
-  (setq-local comment-start "// ")
-  (setq-local comment-end "")
-  (setq-local comment-start-skip (rx (or (seq "/" (+ "/"))
-                                         (seq "/" (+ "*")))
-                                     (* (syntax whitespace))))
-  (setq-local comment-end-skip
-              (rx (* (syntax whitespace))
-                  (group (or (syntax comment-end)
-                             (seq (+ "*") "/")))))
-  (setq-local adaptive-fill-mode t)
-  ;; This matches (1) empty spaces (the default), (2) "//", (3) "*",
-  ;; but do not match "/*", because we don't want to use "/*" as
-  ;; prefix when filling.  (Actually, it doesn't matter, because
-  ;; `comment-start-skip' matches "/*" which will cause
-  ;; `fill-context-prefix' to use "/*" as a prefix for filling, that's
-  ;; why we mask the "/*" in `c-ts-mode--fill-paragraph'.)
-  (setq-local adaptive-fill-regexp
-              (concat (rx (* (syntax whitespace))
-                          (group (or (seq "/" (+ "/")) (* "*"))))
-                      adaptive-fill-regexp))
-  ;; Note the missing * comparing to `adaptive-fill-regexp'.  The
-  ;; reason for its absence is a bit convoluted to explain.  Suffice
-  ;; to say that without it, filling a single line paragraph that
-  ;; starts with /* doesn't insert * at the beginning of each
-  ;; following line, and filling a multi-line paragraph whose first
-  ;; two lines start with * does insert * at the beginning of each
-  ;; following line.  If you know how does adaptive filling works, you
-  ;; know what I mean.
-  (setq-local adaptive-fill-first-line-regexp
-              (rx bos
-                  (seq (* (syntax whitespace))
-                       (group (seq "/" (+ "/")))
-                       (* (syntax whitespace)))
-                  eos))
-  ;; Same as `adaptive-fill-regexp'.
-  (setq-local paragraph-start
-              (rx (or (seq (* (syntax whitespace))
-                           (group (or (seq "/" (+ "/")) (* "*")))
-                           (* (syntax whitespace))
-                           ;; Add this eol so that in
-                           ;; `fill-context-prefix', `paragraph-start'
-                           ;; doesn't match the prefix.
-                           eol)
-                      "\f")))
-  (setq-local paragraph-separate paragraph-start)
-  (setq-local fill-paragraph-function #'c-ts-mode--fill-paragraph))
-
 ;;; Modes
=20
 (defvar-keymap c-ts-mode-map
@@ -968,7 +756,7 @@ c-ts-base-mode
     (setq-local indent-tabs-mode t))
=20
   ;; Comment
-  (c-ts-mode-comment-setup)
+  (c-ts-common-comment-setup)
=20
   ;; Electric
   (setq-local electric-indent-chars
diff --git a/lisp/progmodes/csharp-mode.el b/lisp/progmodes/csharp-mode.el
index 04f7f22236..852e893dc2 100644
--- a/lisp/progmodes/csharp-mode.el
+++ b/lisp/progmodes/csharp-mode.el
@@ -34,7 +34,7 @@
 (require 'cc-mode)
 (require 'cc-langs)
 (require 'treesit)
-(require 'c-ts-mode) ; For comment indenting and filling.
+(require 'c-ts-common) ; For comment indenting and filling.
=20
 (eval-when-compile
   (require 'cc-fonts)
@@ -634,8 +634,8 @@ csharp-ts-mode--indent-rules
      ((node-is "}") parent-bol 0)
      ((node-is ")") parent-bol 0)
      ((node-is "]") parent-bol 0)
-     ((and (parent-is "comment") c-ts-mode--looking-at-star)
-      c-ts-mode--comment-start-after-first-star -1)
+     ((and (parent-is "comment") c-ts-common-looking-at-star)
+      c-ts-common-comment-start-after-first-star -1)
      ((parent-is "comment") prev-adaptive-prefix 0)
      ((parent-is "namespace_declaration") parent-bol 0)
      ((parent-is "class_declaration") parent-bol 0)
@@ -908,7 +908,7 @@ csharp-ts-mode
   (treesit-parser-create 'c-sharp)
=20
   ;; Comments.
-  (c-ts-mode-comment-setup)
+  (c-ts-common-comment-setup)
=20
   ;; Indent.
   (setq-local treesit-simple-indent-rules csharp-ts-mode--indent-rules)
diff --git a/lisp/progmodes/java-ts-mode.el b/lisp/progmodes/java-ts-mode.el
index 8251d9603c..af2b0c1fa8 100644
--- a/lisp/progmodes/java-ts-mode.el
+++ b/lisp/progmodes/java-ts-mode.el
@@ -29,7 +29,7 @@
=20
 (require 'treesit)
 (eval-when-compile (require 'rx))
-(require 'c-ts-mode) ; For comment indent and filling.
+(require 'c-ts-common) ; For comment indent and filling.
=20
 (declare-function treesit-parser-create "treesit.c")
 (declare-function treesit-induce-sparse-tree "treesit.c")
@@ -73,8 +73,8 @@ java-ts-mode--indent-rules
      ((node-is "}") (and parent parent-bol) 0)
      ((node-is ")") parent-bol 0)
      ((node-is "]") parent-bol 0)
-     ((and (parent-is "comment") c-ts-mode--looking-at-star)
-      c-ts-mode--comment-start-after-first-star -1)
+     ((and (parent-is "comment") c-ts-common-looking-at-star)
+      c-ts-common-comment-start-after-first-star -1)
      ((parent-is "comment") prev-adaptive-prefix 0)
      ((parent-is "text_block") no-indent)
      ((parent-is "class_body") parent-bol java-ts-mode-indent-offset)
@@ -293,7 +293,7 @@ java-ts-mode
   (treesit-parser-create 'java)
=20
   ;; Comments.
-  (c-ts-mode-comment-setup)
+  (c-ts-common-comment-setup)
=20
   ;; Indent.
   (setq-local treesit-simple-indent-rules java-ts-mode--indent-rules)
diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index 176024863f..b5c912b8b0 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -54,7 +54,7 @@
 (require 'json)
 (require 'prog-mode)
 (require 'treesit)
-(require 'c-ts-mode) ; For comment indent and filling.
+(require 'c-ts-common) ; For comment indent and filling.
=20
 (eval-when-compile
   (require 'cl-lib)
@@ -3428,8 +3428,8 @@ js--treesit-indent-rules
        ((node-is ")") parent-bol 0)
        ((node-is "]") parent-bol 0)
        ((node-is ">") parent-bol 0)
-       ((and (parent-is "comment") c-ts-mode--looking-at-star)
-        c-ts-mode--comment-start-after-first-star -1)
+       ((and (parent-is "comment") c-ts-common-looking-at-star)
+        c-ts-common-comment-start-after-first-star -1)
        ((parent-is "comment") prev-adaptive-prefix 0)
        ((parent-is "ternary_expression") parent-bol js-indent-level)
        ((parent-is "member_expression") parent-bol js-indent-level)
@@ -3806,7 +3806,7 @@ js-ts-mode
     ;; Which-func.
     (setq-local which-func-imenu-joiner-function #'js--which-func-joiner)
     ;; Comment.
-    (c-ts-mode-comment-setup)
+    (c-ts-common-comment-setup)
     (setq-local comment-multi-line t)
     ;; Electric-indent.
     (setq-local electric-indent-chars
diff --git a/lisp/progmodes/rust-ts-mode.el b/lisp/progmodes/rust-ts-mode.el
index 08590ae6a8..3a6cb61b71 100644
--- a/lisp/progmodes/rust-ts-mode.el
+++ b/lisp/progmodes/rust-ts-mode.el
@@ -29,7 +29,7 @@
=20
 (require 'treesit)
 (eval-when-compile (require 'rx))
-(require 'c-ts-mode) ; For comment indent and filling.
+(require 'c-ts-common) ; For comment indent and filling.
=20
 (declare-function treesit-parser-create "treesit.c")
 (declare-function treesit-induce-sparse-tree "treesit.c")
@@ -71,8 +71,8 @@ rust-ts-mode--indent-rules
      ((node-is ")") parent-bol 0)
      ((node-is "]") parent-bol 0)
      ((node-is "}") (and parent parent-bol) 0)
-     ((and (parent-is "comment") c-ts-mode--looking-at-star)
-      c-ts-mode--comment-start-after-first-star -1)
+     ((and (parent-is "comment") c-ts-common-looking-at-star)
+      c-ts-common-comment-start-after-first-star -1)
      ((parent-is "comment") prev-adaptive-prefix 0)
      ((parent-is "arguments") parent-bol rust-ts-mode-indent-offset)
      ((parent-is "await_expression") parent-bol rust-ts-mode-indent-offset)
@@ -285,7 +285,7 @@ rust-ts-mode
     (treesit-parser-create 'rust)
=20
     ;; Comments.
-    (c-ts-mode-comment-setup)
+    (c-ts-common-comment-setup)
=20
     ;; Font-lock.
     (setq-local treesit-font-lock-settings rust-ts-mode--font-lock-setting=
s)
diff --git a/lisp/progmodes/typescript-ts-mode.el b/lisp/progmodes/typescri=
pt-ts-mode.el
index 903be93422..3403096880 100644
--- a/lisp/progmodes/typescript-ts-mode.el
+++ b/lisp/progmodes/typescript-ts-mode.el
@@ -30,7 +30,7 @@
 (require 'treesit)
 (require 'js)
 (eval-when-compile (require 'rx))
-(require 'c-ts-mode) ; For comment indent and filling.
+(require 'c-ts-common) ; For comment indent and filling.
=20
 (declare-function treesit-parser-create "treesit.c")
=20
@@ -74,8 +74,8 @@ typescript-ts-mode--indent-rules
      ((node-is ")") parent-bol 0)
      ((node-is "]") parent-bol 0)
      ((node-is ">") parent-bol 0)
-     ((and (parent-is "comment") c-ts-mode--looking-at-star)
-      c-ts-mode--comment-start-after-first-star -1)
+     ((and (parent-is "comment") c-ts-common-looking-at-star)
+      c-ts-common-comment-start-after-first-star -1)
      ((parent-is "comment") prev-adaptive-prefix 0)
      ((parent-is "ternary_expression") parent-bol typescript-ts-mode-inden=
t-offset)
      ((parent-is "member_expression") parent-bol typescript-ts-mode-indent=
-offset)
@@ -321,7 +321,7 @@ typescript-ts-base-mode
   :syntax-table typescript-ts-mode--syntax-table
=20
   ;; Comments.
-  (c-ts-mode-comment-setup)
+  (c-ts-common-comment-setup)
=20
   ;; Electric
   (setq-local electric-indent-chars
--=20
2.34.1


--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#60961; Package emacs. Full text available.

Message received at 60961 <at> debbugs.gnu.org:


Received: (at 60961) by debbugs.gnu.org; 21 Jan 2023 04:18:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 20 23:18:58 2023
Received: from localhost ([127.0.0.1]:47704 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pJ5LF-0004a5-Qo
	for submit <at> debbugs.gnu.org; Fri, 20 Jan 2023 23:18:58 -0500
Received: from eggs.gnu.org ([209.51.188.92]:33760)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1pJ5LE-0004Zs-4c
 for 60961 <at> debbugs.gnu.org; Fri, 20 Jan 2023 23:18:56 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pJ5L7-0008CJ-O8; Fri, 20 Jan 2023 23:18:49 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=Yrg7dpwsDJ8oR+2IyrZtvHil7e8C24wwvzOmh9E3KIM=; b=VXA2y3evzGSEhDZiHVDr
 NwKAsHw/63xEW0dDnI4HuCbqp3iE/SC6hclkDQO7d43uxFm+5wxVJZ7F8bHkjxBx5orOENAeJFkIS
 jKAKmPC4CZyF134KIJR4q5uRrSM3FegT3ECysIe0I8fiiwHx+vEg4FdLR4uHGit3Lm9eRMiZ3tLbN
 wBqEs0Rr1Xjkr9lh8491tyq2OnGxWmWarVclCfCeb7NfHJ4BQW1H/oHslxpUqBeRiSTtGuktlTZK+
 7wlGSj4Qpj5NMedCmiD+UBxfjfFT20nypAM92w9C/faN9kYHp/C4/3jcEOqrsOz1O4yBjyeXl2+vW
 dLA/VOvlOS6BNw==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pJ5L7-0004S0-2C; Fri, 20 Jan 2023 23:18:49 -0500
Date: Sat, 21 Jan 2023 06:18:51 +0200
Message-Id: <83edromses.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <CEC5A327-07CF-4621-BB52-1D1C6AFF51F4@HIDDEN> (message from
 Yuan Fu on Fri, 20 Jan 2023 14:11:44 -0800)
Subject: Re: bug#60961: 29.0.60; Compiling emacs-29 without treesitter outputs
 warnings
References: <878rhx1os6.fsf@HIDDEN> <831qnpnx9g.fsf@HIDDEN>
 <87o7qtuxgh.fsf@HIDDEN> <83tu0lmgv6.fsf@HIDDEN>
 <87h6wll10q.fsf@HIDDEN> <83r0vpme0t.fsf@HIDDEN>
 <8A47E6B6-BE4F-44F4-9BC5-55B6051CDCD4@HIDDEN>
 <CEC5A327-07CF-4621-BB52-1D1C6AFF51F4@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 60961
Cc: rpluim@HIDDEN, theo@HIDDEN, 60961 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Yuan Fu <casouri@HIDDEN>
> Date: Fri, 20 Jan 2023 14:11:44 -0800
> Cc: Eli Zaretskii <eliz@HIDDEN>,
>  rpluim@HIDDEN,
>  60961 <at> debbugs.gnu.org
> 
> I’d prefer c-ts-common.el over treesit.el, since they only apply to C-like languages. There is no harm putting them in a separate file, right? I wrote some commentary in c-ts-mode, which notes all the shared functions and variables. 

c-ts-common.el SGTM, thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#60961; Package emacs. Full text available.

Message received at 60961 <at> debbugs.gnu.org:


Received: (at 60961) by debbugs.gnu.org; 20 Jan 2023 22:36:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 20 17:36:20 2023
Received: from localhost ([127.0.0.1]:47439 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pIzzg-0003kh-HL
	for submit <at> debbugs.gnu.org; Fri, 20 Jan 2023 17:36:20 -0500
Received: from mail-pj1-f53.google.com ([209.85.216.53]:56056)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <casouri@HIDDEN>) id 1pIzze-0003kR-BJ
 for 60961 <at> debbugs.gnu.org; Fri, 20 Jan 2023 17:36:18 -0500
Received: by mail-pj1-f53.google.com with SMTP id dw9so6898104pjb.5
 for <60961 <at> debbugs.gnu.org>; Fri, 20 Jan 2023 14:36:18 -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=VsksJKGRvEuoi/j8y5PPs/U8jW6aStcCUSLwAWjvoJw=;
 b=gSYn47Q0QQB0AJ0+5TiqNLhDHNjniqCEz9RH9p108046PLBGGhJ61vziH83+8RXTKQ
 YTNMB0GixOwcBsaqRUdmFOdZNDWOZ4HGZ+8kxZ+tJ/d6yrLkcUlzkzZum5WjX4yVbZ7C
 f4EWhJGj/RFdEH/wG7TZhRxc+NgmrQ74fQUj50HMRyxktdmzqzjJgWWgwt+4vsydAGNw
 2QXTKqX45hx0QTPsOxKPZDXGoe1OH5SFbstwXk0f9ETH5VAc3ogh6bxY8+lYxbdQUzCQ
 r8VwG94l/LWkQDqSsTpkjA689HeklvwUJDzNvqDdFI8pnvcoODFjggaIFvNzhErTWHBX
 ChLw==
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=VsksJKGRvEuoi/j8y5PPs/U8jW6aStcCUSLwAWjvoJw=;
 b=D+FVfIX/LRxwAgmVOZmT/EXdObVQpbFNPpUYQywcoBdkqh0hSqcnAS2SYNAnK3gO/x
 mr6H/6MmNeX1i7Npbr+fy8VQDDWcGWa+c8tLsiHpkDFLXc0SeVo17MebOGd9FDtpYK4L
 QnpJNpgEYH3O08WiZp/WGe72pypI3sO1MvOpenAFx45BHLj6Sl+D6+HWvVYPfbzF92pu
 usJl4gfcOdm+LEx+YwGqRHTvnCL5YlfKfJmlrg/Ol2GItlIX8ipCXYyBHfHQOemQSlVW
 +Nx0yUcwfUYWX9xqf97Q4gRpwdzoI1uxX6giVIgOc4eqaq6JtD3GSaELGsPBZNhrmqAM
 Qg0w==
X-Gm-Message-State: AFqh2koAMwPzPIcZYwXeYlhAZTGNif99lRiUiBxaRorKnfQtb2veRhqO
 m8P9XwoT623DePmzbpjLCg8=
X-Google-Smtp-Source: AMrXdXvuSbF/JZ4o+u0z/FlSOe43wCZ6z7AICHsNXzAXMcjdWEfCzJrtdaOTsweDN1ojcMAIzCMFBA==
X-Received: by 2002:a17:903:2093:b0:194:67e5:3d07 with SMTP id
 d19-20020a170903209300b0019467e53d07mr14937765plc.53.1674254172480; 
 Fri, 20 Jan 2023 14:36:12 -0800 (PST)
Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com.
 [172.117.161.177]) by smtp.gmail.com with ESMTPSA id
 ja15-20020a170902efcf00b0019493c84880sm10248682plb.188.2023.01.20.14.36.11
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Fri, 20 Jan 2023 14:36:12 -0800 (PST)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.300.101.1.3\))
Subject: Re: bug#60961: 29.0.60; Compiling emacs-29 without treesitter outputs
 warnings
From: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <2025C712-7091-4971-B254-51844C0FA609@HIDDEN>
Date: Fri, 20 Jan 2023 14:36:00 -0800
Content-Transfer-Encoding: quoted-printable
Message-Id: <7824DF9F-E027-4D2C-ACCF-028D34332AE6@HIDDEN>
References: <878rhx1os6.fsf@HIDDEN> <831qnpnx9g.fsf@HIDDEN>
 <87o7qtuxgh.fsf@HIDDEN> <83tu0lmgv6.fsf@HIDDEN>
 <87h6wll10q.fsf@HIDDEN> <83r0vpme0t.fsf@HIDDEN>
 <8A47E6B6-BE4F-44F4-9BC5-55B6051CDCD4@HIDDEN>
 <CEC5A327-07CF-4621-BB52-1D1C6AFF51F4@HIDDEN>
 <2025C712-7091-4971-B254-51844C0FA609@HIDDEN>
To: Theodor Thornhill <theo@HIDDEN>
X-Mailer: Apple Mail (2.3731.300.101.1.3)
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 60961
Cc: Eli Zaretskii <eliz@HIDDEN>, Robert Pluim <rpluim@HIDDEN>,
 60961 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)



> On Jan 20, 2023, at 2:30 PM, Theodor Thornhill <theo@HIDDEN> =
wrote:
>=20
>=20
>=20
> On 20 January 2023 23:11:44 CET, Yuan Fu <casouri@HIDDEN> wrote:
>>=20
>>=20
>>> On Jan 20, 2023, at 8:07 AM, Theodor Thornhill <theo@HIDDEN> =
wrote:
>>>=20
>>>=20
>>>=20
>>> On 20 January 2023 16:17:22 CET, Eli Zaretskii <eliz@HIDDEN> wrote:
>>>>> From: Theodor Thornhill <theo@HIDDEN>
>>>>> Cc: rpluim@HIDDEN, casouri@HIDDEN, 60961 <at> debbugs.gnu.org
>>>>> Date: Fri, 20 Jan 2023 15:43:33 +0100
>>>>>=20
>>>>> Eli Zaretskii <eliz@HIDDEN> writes:
>>>>>=20
>>>>>>> So I can either just make sure that no modes require across =
modes, or
>>>>>>> make that "lib" right now.  What do you think?
>>>>>>=20
>>>>>> I tend to the "lib" method.  Mostly because several modes, =
including
>>>>>> some that are unrelated to C, want the code which was written for
>>>>>> C/C++, and so it is possible that there's some general feature =
here
>>>>>> waiting for us to refactor the code -- in which case perhaps the =
code
>>>>>> should be in treesit.el?
>>>>>>=20
>>>>>> IOW, how come JS, Rust, and Typescript all want comment-related =
setup
>>>>>> that was written for C?
>>=20
>> Because they all have C-like syntax, so they have the same setup for =
indenting and filling block comments, for example.
>>=20
>>>>>> If this is just a coincidence, then perhaps
>>>>>> duplicating the code is a better idea, but if there's some =
underlying
>>>>>> commonality, we should have common code in treesit.el, or maybe =
in
>>>>>> some c-ts-common.el?
>>=20
>> c-ts-common.el sounds good to me.
>>=20
>>>>>=20
>>>>> I can start by moving it into treesit.el, then we can maybe =
extract
>>>>> something out later.  Sounds good?  I can do it tonight, unless =
any of
>>>>> you object :)
>>>>=20
>>>> SGTM, but let's hear from Yuan before you start working on this.
>>>>=20
>>>> Thanks.
>>>=20
>>> Thumbs up
>>=20
>> I=E2=80=99d prefer c-ts-common.el over treesit.el, since they only =
apply to C-like languages. There is no harm putting them in a separate =
file, right? I wrote some commentary in c-ts-mode, which notes all the =
shared functions and variables.=20
>>=20
>> Yuan
>>=20
>=20
> Ok, should I do it or you? :)
>=20
> Theo

The honor is yours :-)

Yuan=




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#60961; Package emacs. Full text available.

Message received at 60961 <at> debbugs.gnu.org:


Received: (at 60961) by debbugs.gnu.org; 20 Jan 2023 22:30:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 20 17:30:47 2023
Received: from localhost ([127.0.0.1]:47429 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pIzuJ-0003aw-Ag
	for submit <at> debbugs.gnu.org; Fri, 20 Jan 2023 17:30:47 -0500
Received: from out-12.mta0.migadu.com ([91.218.175.12]:45236)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <theo@HIDDEN>) id 1pIzuI-0003an-0N
 for 60961 <at> debbugs.gnu.org; Fri, 20 Jan 2023 17:30:46 -0500
Date: Fri, 20 Jan 2023 23:30:41 +0100
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no;
 s=key1; t=1674253844;
 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:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=B8yuhylkbTfDKWLRlbN3vveo8vCW8K39aTi4v6DHawY=;
 b=TWAtPoFKBUGUEEF+Es07Q4NQdGQ8mQCoQVSDxneu18r6TXyBYSf7MPhFHYGdq2iPamiqPB
 OLEMfCyX7ltN6uNlyAMYIVObynyMnP6WAM0UvJizb+tAXRG/5uoHMxrI/T4gu0oKkO4jSN
 OTuDa9khy9fzaOfaEc/7CE8QWQn1Xen4mfd67DoUDJhN8qC1I3XQzbRFf3gnqQmNCcqfIX
 vuCRG5jwxRKTIlT84nsA/Lit+9//NQQQ+oguK0OX3jlXwGaaZOm8FsXVr05JF5cnEAfyfq
 2lQ7JvOJhvRLeUqTu8Gwul3vZZL3HCtA2Sw/FDgcgUzlW3lCD7DAzGnwefuEOQ==
X-Report-Abuse: Please report any abuse attempt to abuse@HIDDEN and
 include these headers.
From: Theodor Thornhill <theo@HIDDEN>
To: Yuan Fu <casouri@HIDDEN>
Subject: =?US-ASCII?Q?Re=3A_bug=2360961=3A_29=2E0=2E60=3B_Compiling_emacs?=
 =?US-ASCII?Q?-29_without_treesitter_outputs_warnings?=
In-Reply-To: <CEC5A327-07CF-4621-BB52-1D1C6AFF51F4@HIDDEN>
References: <878rhx1os6.fsf@HIDDEN> <831qnpnx9g.fsf@HIDDEN>
 <87o7qtuxgh.fsf@HIDDEN> <83tu0lmgv6.fsf@HIDDEN>
 <87h6wll10q.fsf@HIDDEN> <83r0vpme0t.fsf@HIDDEN>
 <8A47E6B6-BE4F-44F4-9BC5-55B6051CDCD4@HIDDEN>
 <CEC5A327-07CF-4621-BB52-1D1C6AFF51F4@HIDDEN>
Message-ID: <2025C712-7091-4971-B254-51844C0FA609@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain;
 charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Migadu-Flow: FLOW_OUT
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 60961
Cc: Eli Zaretskii <eliz@HIDDEN>, rpluim@HIDDEN, 60961 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)



On 20 January 2023 23:11:44 CET, Yuan Fu <casouri@gmail=2Ecom> wrote:
>
>
>> On Jan 20, 2023, at 8:07 AM, Theodor Thornhill <theo@thornhill=2Eno> wr=
ote:
>>=20
>>=20
>>=20
>> On 20 January 2023 16:17:22 CET, Eli Zaretskii <eliz@gnu=2Eorg> wrote:
>>>> From: Theodor Thornhill <theo@thornhill=2Eno>
>>>> Cc: rpluim@gmail=2Ecom, casouri@gmail=2Ecom, 60961@debbugs=2Egnu=2Eor=
g
>>>> Date: Fri, 20 Jan 2023 15:43:33 +0100
>>>>=20
>>>> Eli Zaretskii <eliz@gnu=2Eorg> writes:
>>>>=20
>>>>>> So I can either just make sure that no modes require across modes, =
or
>>>>>> make that "lib" right now=2E  What do you think?
>>>>>=20
>>>>> I tend to the "lib" method=2E  Mostly because several modes, includi=
ng
>>>>> some that are unrelated to C, want the code which was written for
>>>>> C/C++, and so it is possible that there's some general feature here
>>>>> waiting for us to refactor the code -- in which case perhaps the cod=
e
>>>>> should be in treesit=2Eel?
>>>>>=20
>>>>> IOW, how come JS, Rust, and Typescript all want comment-related setu=
p
>>>>> that was written for C?
>
>Because they all have C-like syntax, so they have the same setup for inde=
nting and filling block comments, for example=2E
>
>>>>>  If this is just a coincidence, then perhaps
>>>>> duplicating the code is a better idea, but if there's some underlyin=
g
>>>>> commonality, we should have common code in treesit=2Eel, or maybe in
>>>>> some c-ts-common=2Eel?
>
>c-ts-common=2Eel sounds good to me=2E
>
>>>>=20
>>>> I can start by moving it into treesit=2Eel, then we can maybe extract
>>>> something out later=2E  Sounds good?  I can do it tonight, unless any=
 of
>>>> you object :)
>>>=20
>>> SGTM, but let's hear from Yuan before you start working on this=2E
>>>=20
>>> Thanks=2E
>>=20
>> Thumbs up
>
>I=E2=80=99d prefer c-ts-common=2Eel over treesit=2Eel, since they only ap=
ply to C-like languages=2E There is no harm putting them in a separate file=
, right? I wrote some commentary in c-ts-mode, which notes all the shared f=
unctions and variables=2E=20
>
>Yuan
>

Ok, should I do it or you? :)

Theo




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#60961; Package emacs. Full text available.

Message received at 60961 <at> debbugs.gnu.org:


Received: (at 60961) by debbugs.gnu.org; 20 Jan 2023 22:12:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 20 17:12:05 2023
Received: from localhost ([127.0.0.1]:47381 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pIzcC-0002zy-Jh
	for submit <at> debbugs.gnu.org; Fri, 20 Jan 2023 17:12:04 -0500
Received: from mail-pg1-f176.google.com ([209.85.215.176]:37719)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <casouri@HIDDEN>) id 1pIzcB-0002zS-Lv
 for 60961 <at> debbugs.gnu.org; Fri, 20 Jan 2023 17:12:04 -0500
Received: by mail-pg1-f176.google.com with SMTP id v3so5191844pgh.4
 for <60961 <at> debbugs.gnu.org>; Fri, 20 Jan 2023 14:12:03 -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=jWuvlfoA80mVyHdLonLWXZCMmE7MXv9RyP6zffqD6JU=;
 b=BfUt1AO1TjaCwBHPnIxJeLXMcjkQyCUW5i20Uft/I7v11eHRoe0Lm6hl9L5K7y+1Kw
 071rJ5kY1aRT56J3Iy5KqEYuNYg24eirTV1eDJ7j8aoOjtaXwNyrXyi14qmql+qyH9jl
 jMMK25WIGE6bGA5jXn+GAW824AcayUpsiP2XdGiHwmbngEFBvMq9hv5NWV44Rdkb41+A
 D2eFIjXodwVR1lG/Qb5l7srrMNrKyRuQPAqK4cGxBYhSsaBnCdW/B+kaOsLVehHh1+jH
 nYYamm3v90gsaT53FiLjRNTaSJl7iLMsUQjaDBMqTQkXitoq5Yq/E7zicW4iJBR/HnLW
 PUpg==
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=jWuvlfoA80mVyHdLonLWXZCMmE7MXv9RyP6zffqD6JU=;
 b=Fzq2j/TfJQxH//SIDGS3BEmOXfSsvzSHSOZ+dMBbNO+x1iT6AZjK+pK66Sz7F/k2Pg
 3SQFxQgnOAeMIrCcvz3k4Hxu93vIdyjR2IFWn9XY6vRoR9OoGpU0J7Vaw8ronb09o1Nj
 yogd+mlE8UHUe3TDXUbjYcyu4cxKnCAAbRQn3uc/f8s30TF5XZqemp6QlTeGD7xA9o0Z
 jERfBpXpF/Dn1Pqv+ES5qfSSU9fOO/OXX5b6IjhjuzLPNuxxzbAMasoHEYUv1EZM+pQM
 67Vmikb4XHEWsfC+p2E9Y5ssbIUFIaM3GiMtGaYT1UM0VdTAMHjymE69tVfcwoWr70Tg
 pvMw==
X-Gm-Message-State: AFqh2kr6ffltunCFylUxP5SoEJmJ5WbqjQXu9MJDHoDTUJCwMSoqi2Qh
 rZrjltuplcmgOryL3Ub5FxY=
X-Google-Smtp-Source: AMrXdXsagSHYCcF8EcCD1yp4ah5kQFXn7t+mYWUZu+CyVBy5qXBJusA2flCJqK9zPXVyFQRbw3n1Ag==
X-Received: by 2002:a05:6a00:3691:b0:580:d409:396c with SMTP id
 dw17-20020a056a00369100b00580d409396cmr19355089pfb.6.1674252716681; 
 Fri, 20 Jan 2023 14:11:56 -0800 (PST)
Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com.
 [172.117.161.177]) by smtp.gmail.com with ESMTPSA id
 w124-20020a626282000000b005769b23260fsm27192511pfb.18.2023.01.20.14.11.55
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Fri, 20 Jan 2023 14:11:56 -0800 (PST)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.300.101.1.3\))
Subject: Re: bug#60961: 29.0.60; Compiling emacs-29 without treesitter outputs
 warnings
From: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <8A47E6B6-BE4F-44F4-9BC5-55B6051CDCD4@HIDDEN>
Date: Fri, 20 Jan 2023 14:11:44 -0800
Content-Transfer-Encoding: quoted-printable
Message-Id: <CEC5A327-07CF-4621-BB52-1D1C6AFF51F4@HIDDEN>
References: <878rhx1os6.fsf@HIDDEN> <831qnpnx9g.fsf@HIDDEN>
 <87o7qtuxgh.fsf@HIDDEN> <83tu0lmgv6.fsf@HIDDEN>
 <87h6wll10q.fsf@HIDDEN> <83r0vpme0t.fsf@HIDDEN>
 <8A47E6B6-BE4F-44F4-9BC5-55B6051CDCD4@HIDDEN>
To: Theodor Thornhill <theo@HIDDEN>
X-Mailer: Apple Mail (2.3731.300.101.1.3)
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 60961
Cc: Eli Zaretskii <eliz@HIDDEN>, rpluim@HIDDEN, 60961 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)



> On Jan 20, 2023, at 8:07 AM, Theodor Thornhill <theo@HIDDEN> =
wrote:
>=20
>=20
>=20
> On 20 January 2023 16:17:22 CET, Eli Zaretskii <eliz@HIDDEN> wrote:
>>> From: Theodor Thornhill <theo@HIDDEN>
>>> Cc: rpluim@HIDDEN, casouri@HIDDEN, 60961 <at> debbugs.gnu.org
>>> Date: Fri, 20 Jan 2023 15:43:33 +0100
>>>=20
>>> Eli Zaretskii <eliz@HIDDEN> writes:
>>>=20
>>>>> So I can either just make sure that no modes require across modes, =
or
>>>>> make that "lib" right now.  What do you think?
>>>>=20
>>>> I tend to the "lib" method.  Mostly because several modes, =
including
>>>> some that are unrelated to C, want the code which was written for
>>>> C/C++, and so it is possible that there's some general feature here
>>>> waiting for us to refactor the code -- in which case perhaps the =
code
>>>> should be in treesit.el?
>>>>=20
>>>> IOW, how come JS, Rust, and Typescript all want comment-related =
setup
>>>> that was written for C?

Because they all have C-like syntax, so they have the same setup for =
indenting and filling block comments, for example.

>>>>  If this is just a coincidence, then perhaps
>>>> duplicating the code is a better idea, but if there's some =
underlying
>>>> commonality, we should have common code in treesit.el, or maybe in
>>>> some c-ts-common.el?

c-ts-common.el sounds good to me.

>>>=20
>>> I can start by moving it into treesit.el, then we can maybe extract
>>> something out later.  Sounds good?  I can do it tonight, unless any =
of
>>> you object :)
>>=20
>> SGTM, but let's hear from Yuan before you start working on this.
>>=20
>> Thanks.
>=20
> Thumbs up

I=E2=80=99d prefer c-ts-common.el over treesit.el, since they only apply =
to C-like languages. There is no harm putting them in a separate file, =
right? I wrote some commentary in c-ts-mode, which notes all the shared =
functions and variables.=20

Yuan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#60961; Package emacs. Full text available.

Message received at 60961 <at> debbugs.gnu.org:


Received: (at 60961) by debbugs.gnu.org; 20 Jan 2023 16:08:55 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 20 11:08:55 2023
Received: from localhost ([127.0.0.1]:46937 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pItwk-00073B-QO
	for submit <at> debbugs.gnu.org; Fri, 20 Jan 2023 11:08:55 -0500
Received: from out0.migadu.com ([94.23.1.103]:63152)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <theo@HIDDEN>) id 1pItwi-000732-W1
 for 60961 <at> debbugs.gnu.org; Fri, 20 Jan 2023 11:08:53 -0500
Date: Fri, 20 Jan 2023 17:07:28 +0100
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no;
 s=key1; t=1674230930;
 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:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=3H+YWvTFPahc/ZFQtR/uHKmEfTlPfwUfoRITLRokK8A=;
 b=rZscHL0G75mbKf3IUkMGYCzbbvn3czhGHLtUnQiqkejmAwF80Uc2aQ55WQCAkbcS63b/Bx
 bgLUe2dDjmzX9kdvN3H9c0Xke54FE2VzK6QIYiodTvjk8A0DdHnY1Z6159ZcvNOWHCvpMt
 q04bmxWuEm3yQSN2163HC8FRHwTHYcx2M6k0HiZT8/5dXqVdtH4oqsHI3Gpp+j3VDkRgsh
 kGcKyWn62YVMeOCJkllfFOwqXyr/VukwOH6b80YbKBklQVroYJ/eU7h3nFTxwus7iSRpNG
 uJuvMPGACUUDGSvGcQPXqOtCe1NQMwY0Ysb4leJjEH2IPND+AAV9KF9w2UH6BQ==
X-Report-Abuse: Please report any abuse attempt to abuse@HIDDEN and
 include these headers.
From: Theodor Thornhill <theo@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: =?US-ASCII?Q?Re=3A_bug=2360961=3A_29=2E0=2E60=3B_Compiling_emacs?=
 =?US-ASCII?Q?-29_without_treesitter_outputs_warnings?=
In-Reply-To: <83r0vpme0t.fsf@HIDDEN>
References: <878rhx1os6.fsf@HIDDEN> <831qnpnx9g.fsf@HIDDEN>
 <87o7qtuxgh.fsf@HIDDEN> <83tu0lmgv6.fsf@HIDDEN>
 <87h6wll10q.fsf@HIDDEN> <83r0vpme0t.fsf@HIDDEN>
Message-ID: <8A47E6B6-BE4F-44F4-9BC5-55B6051CDCD4@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain;
 charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Migadu-Flow: FLOW_OUT
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 60961
Cc: rpluim@HIDDEN, casouri@HIDDEN, 60961 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)



On 20 January 2023 16:17:22 CET, Eli Zaretskii <eliz@gnu=2Eorg> wrote:
>> From: Theodor Thornhill <theo@thornhill=2Eno>
>> Cc: rpluim@gmail=2Ecom, casouri@gmail=2Ecom, 60961@debbugs=2Egnu=2Eorg
>> Date: Fri, 20 Jan 2023 15:43:33 +0100
>>=20
>> Eli Zaretskii <eliz@gnu=2Eorg> writes:
>>=20
>> >> So I can either just make sure that no modes require across modes, o=
r
>> >> make that "lib" right now=2E  What do you think?
>> >
>> > I tend to the "lib" method=2E  Mostly because several modes, includin=
g
>> > some that are unrelated to C, want the code which was written for
>> > C/C++, and so it is possible that there's some general feature here
>> > waiting for us to refactor the code -- in which case perhaps the code
>> > should be in treesit=2Eel?
>> >
>> > IOW, how come JS, Rust, and Typescript all want comment-related setup
>> > that was written for C?  If this is just a coincidence, then perhaps
>> > duplicating the code is a better idea, but if there's some underlying
>> > commonality, we should have common code in treesit=2Eel, or maybe in
>> > some c-ts-common=2Eel?
>>=20
>> I can start by moving it into treesit=2Eel, then we can maybe extract
>> something out later=2E  Sounds good?  I can do it tonight, unless any o=
f
>> you object :)
>
>SGTM, but let's hear from Yuan before you start working on this=2E
>
>Thanks=2E

Thumbs up




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#60961; Package emacs. Full text available.

Message received at 60961 <at> debbugs.gnu.org:


Received: (at 60961) by debbugs.gnu.org; 20 Jan 2023 15:17:30 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 20 10:17:30 2023
Received: from localhost ([127.0.0.1]:46895 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pIt90-0005gm-7H
	for submit <at> debbugs.gnu.org; Fri, 20 Jan 2023 10:17:30 -0500
Received: from eggs.gnu.org ([209.51.188.92]:48200)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1pIt8y-0005ga-Uk
 for 60961 <at> debbugs.gnu.org; Fri, 20 Jan 2023 10:17:29 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pIt8t-0007OC-7M; Fri, 20 Jan 2023 10:17:23 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=q6c4oned/RPtcEKAS22ItOpSEeJa47fOaro7B5Rk9J8=; b=doMrcqCQCei0
 fKo8PnVOVLLD8R08nEZnfIwWvzIALCbnFpJxOG2nUmneglA1hRJDLntnkqFoMwsdNIvi4g5H7+6dO
 Sj3jVVIWnRhBAQkdCdDC7xA0Q/RhbynZvFCnll6Wc2uT47oTgvX+8ri0HmgTpHr1HLoAMgN2VwfhK
 +PZ0lGCP387dt7mGDtIyAoy/MMb/AVaSuo+Sq9TpUcNWKaY3q5QB3Fr3+3QNXiOkZtEI1PeERkmUK
 E9EvRSPmjaACidCdc7fdKVC5Qg976t5Gyw7EqUMh8jqWFY0bHaTIW/t7ZgtF3oK2n7AT93nJZy4YB
 gAR4Yb3yanD8M0cUU8QUeA==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pIt8s-0007Tv-N8; Fri, 20 Jan 2023 10:17:23 -0500
Date: Fri, 20 Jan 2023 17:17:22 +0200
Message-Id: <83r0vpme0t.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Theodor Thornhill <theo@HIDDEN>
In-Reply-To: <87h6wll10q.fsf@HIDDEN> (message from Theodor Thornhill on
 Fri, 20 Jan 2023 15:43:33 +0100)
Subject: Re: bug#60961: 29.0.60; Compiling emacs-29 without treesitter
 outputs warnings
References: <878rhx1os6.fsf@HIDDEN> <831qnpnx9g.fsf@HIDDEN>
 <87o7qtuxgh.fsf@HIDDEN> <83tu0lmgv6.fsf@HIDDEN>
 <87h6wll10q.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 60961
Cc: rpluim@HIDDEN, casouri@HIDDEN, 60961 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Theodor Thornhill <theo@HIDDEN>
> Cc: rpluim@HIDDEN, casouri@HIDDEN, 60961 <at> debbugs.gnu.org
> Date: Fri, 20 Jan 2023 15:43:33 +0100
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> >> So I can either just make sure that no modes require across modes, or
> >> make that "lib" right now.  What do you think?
> >
> > I tend to the "lib" method.  Mostly because several modes, including
> > some that are unrelated to C, want the code which was written for
> > C/C++, and so it is possible that there's some general feature here
> > waiting for us to refactor the code -- in which case perhaps the code
> > should be in treesit.el?
> >
> > IOW, how come JS, Rust, and Typescript all want comment-related setup
> > that was written for C?  If this is just a coincidence, then perhaps
> > duplicating the code is a better idea, but if there's some underlying
> > commonality, we should have common code in treesit.el, or maybe in
> > some c-ts-common.el?
> 
> I can start by moving it into treesit.el, then we can maybe extract
> something out later.  Sounds good?  I can do it tonight, unless any of
> you object :)

SGTM, but let's hear from Yuan before you start working on this.

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#60961; Package emacs. Full text available.

Message received at 60961 <at> debbugs.gnu.org:


Received: (at 60961) by debbugs.gnu.org; 20 Jan 2023 14:43:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 20 09:43:40 2023
Received: from localhost ([127.0.0.1]:46015 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pIscF-0004Tk-Oj
	for submit <at> debbugs.gnu.org; Fri, 20 Jan 2023 09:43:40 -0500
Received: from out0.migadu.com ([94.23.1.103]:26449)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <theo@HIDDEN>) id 1pIscD-0004TY-Cc
 for 60961 <at> debbugs.gnu.org; Fri, 20 Jan 2023 09:43:38 -0500
X-Report-Abuse: Please report any abuse attempt to abuse@HIDDEN and
 include these headers.
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no;
 s=key1; t=1674225815;
 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=OyzN/PsoZ9KdpNmqPP02aO0+fYA9oDwfAfj/1zxUwc0=;
 b=EhR3TsxPCVPeabvD9AtEvYWUuM/HI4AEIi6JyalXORHoXDl07PSrm3wty3fqIpTc240fIr
 ykGSkMnB3PPLLyposO8/UjCEFbYB+CKBL4AkSVVn6erg/rvAI1APt6FqnakdIoJ1fSavwO
 UnfNHsbZ1HcK/+S67tOKKymvEgcAggnKGPF7+C3RcCBkpUtEg80oHgnILh2FzYJNju6BF3
 R/g7egnm8aSvB4TKz+Sh+81kPm2kn0aOreuphT2dXLEHoaFgdYutUzAiCW4XwR3GQ5EyqG
 FIFaeh18afbi05FFt306xmSJCaPgfIB6JIzZuEO6Ezdp7bcU3/jPPix0zdW0IA==
From: Theodor Thornhill <theo@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#60961: 29.0.60; Compiling emacs-29 without treesitter
 outputs warnings
In-Reply-To: <83tu0lmgv6.fsf@HIDDEN>
References: <878rhx1os6.fsf@HIDDEN> <831qnpnx9g.fsf@HIDDEN>
 <87o7qtuxgh.fsf@HIDDEN> <83tu0lmgv6.fsf@HIDDEN>
Date: Fri, 20 Jan 2023 15:43:33 +0100
Message-ID: <87h6wll10q.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Migadu-Flow: FLOW_OUT
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 60961
Cc: rpluim@HIDDEN, casouri@HIDDEN, 60961 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: Theodor Thornhill <theo@HIDDEN>
>> Cc: 60961 <at> debbugs.gnu.org
>> Date: Fri, 20 Jan 2023 14:50:22 +0100
>> 
>> Eli Zaretskii <eliz@HIDDEN> writes:
>> 
>> > Yes, I've seen these as well.  The reason is that some modes 'require'
>> > c-ts-mode, because they want to use their comment-related functions.
>> > But the changes I made recently call treesit-ready-p when c-ts-mode is
>> > being loaded, and that emits the warning.  I can shut up the warning
>> > by calling treesit-ready-p with a non-nil QUIET argument, but then the
>> > warning will not be emitted if users load c-ts-mode from their init
>> > files or manually, which is not good.  I tried several other
>> > solutions, but they either didn't work or were not clean enough for my
>> > palate.
>> >
>> > Yuan/Theo, please find a solution for this.  If no better idea comes
>> > up, I think the c-ts-mode functions that other modes want to use
>> > should be moved to a separate file, and that file that can be
>> > 'require'd by all those which want it, including by c-ts-mode.el.
>> >
>> 
>> Yeah, I was hoping to actually just allowing some duplication of code,
>> until some "best practice" emerges the coming months, and we can make a
>> treesit-common-lib.el or something like that.
>> 
>> So I can either just make sure that no modes require across modes, or
>> make that "lib" right now.  What do you think?
>
> I tend to the "lib" method.  Mostly because several modes, including
> some that are unrelated to C, want the code which was written for
> C/C++, and so it is possible that there's some general feature here
> waiting for us to refactor the code -- in which case perhaps the code
> should be in treesit.el?
>
> IOW, how come JS, Rust, and Typescript all want comment-related setup
> that was written for C?  If this is just a coincidence, then perhaps
> duplicating the code is a better idea, but if there's some underlying
> commonality, we should have common code in treesit.el, or maybe in
> some c-ts-common.el?

I can start by moving it into treesit.el, then we can maybe extract
something out later.  Sounds good?  I can do it tonight, unless any of
you object :)

Theo




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#60961; Package emacs. Full text available.

Message received at 60961 <at> debbugs.gnu.org:


Received: (at 60961) by debbugs.gnu.org; 20 Jan 2023 14:16:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 20 09:16:16 2023
Received: from localhost ([127.0.0.1]:45976 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pIsBj-0001SY-Rd
	for submit <at> debbugs.gnu.org; Fri, 20 Jan 2023 09:16:16 -0500
Received: from eggs.gnu.org ([209.51.188.92]:50748)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1pIsBi-0001SJ-LE
 for 60961 <at> debbugs.gnu.org; Fri, 20 Jan 2023 09:16:15 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pIsBd-00054e-4i; Fri, 20 Jan 2023 09:16:09 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=tmTMrJudkoOSU/P+wDfrpuSHLyG+OYBZJZ2AIC7G6jo=; b=b+6LlN5kn9AC
 hUjZ8/zitKeo37uFbQIyvRFpsNhFCH4byST4RZpFnjwOddPocLTBm4riKl2Vv/TD1f7hTph6PGseK
 PyJp1SPYvRQr+0oItVnlqx9tAsXN+RC8Mr4ThDXifC8R+fklsh6ieM2f8xRGZY4TLFg6vxBj18Fhr
 WeHQl5yS+hW1CF0ywPpExNZ86edI/pR+2zYJCuKM8J+QCu6n2sduu5MAqo+PwAfAATeRy9JZMSTNI
 oSw/7h4d7xswX2iE5paxWZsSXwul71vlFxV5xXa1VIgIyzEEvw5iIOUqU1RRqFi7Y0UQRZXDs7pxs
 OzcBVAvLxqjBaCqJCaILDQ==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pIsBR-0001H4-Ql; Fri, 20 Jan 2023 09:16:08 -0500
Date: Fri, 20 Jan 2023 16:15:57 +0200
Message-Id: <83tu0lmgv6.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Theodor Thornhill <theo@HIDDEN>
In-Reply-To: <87o7qtuxgh.fsf@HIDDEN> (message from Theodor Thornhill on
 Fri, 20 Jan 2023 14:50:22 +0100)
Subject: Re: bug#60961: 29.0.60; Compiling emacs-29 without treesitter
 outputs warnings
References: <878rhx1os6.fsf@HIDDEN> <831qnpnx9g.fsf@HIDDEN>
 <87o7qtuxgh.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 60961
Cc: rpluim@HIDDEN, casouri@HIDDEN, 60961 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Theodor Thornhill <theo@HIDDEN>
> Cc: 60961 <at> debbugs.gnu.org
> Date: Fri, 20 Jan 2023 14:50:22 +0100
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> > Yes, I've seen these as well.  The reason is that some modes 'require'
> > c-ts-mode, because they want to use their comment-related functions.
> > But the changes I made recently call treesit-ready-p when c-ts-mode is
> > being loaded, and that emits the warning.  I can shut up the warning
> > by calling treesit-ready-p with a non-nil QUIET argument, but then the
> > warning will not be emitted if users load c-ts-mode from their init
> > files or manually, which is not good.  I tried several other
> > solutions, but they either didn't work or were not clean enough for my
> > palate.
> >
> > Yuan/Theo, please find a solution for this.  If no better idea comes
> > up, I think the c-ts-mode functions that other modes want to use
> > should be moved to a separate file, and that file that can be
> > 'require'd by all those which want it, including by c-ts-mode.el.
> >
> 
> Yeah, I was hoping to actually just allowing some duplication of code,
> until some "best practice" emerges the coming months, and we can make a
> treesit-common-lib.el or something like that.
> 
> So I can either just make sure that no modes require across modes, or
> make that "lib" right now.  What do you think?

I tend to the "lib" method.  Mostly because several modes, including
some that are unrelated to C, want the code which was written for
C/C++, and so it is possible that there's some general feature here
waiting for us to refactor the code -- in which case perhaps the code
should be in treesit.el?

IOW, how come JS, Rust, and Typescript all want comment-related setup
that was written for C?  If this is just a coincidence, then perhaps
duplicating the code is a better idea, but if there's some underlying
commonality, we should have common code in treesit.el, or maybe in
some c-ts-common.el?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#60961; Package emacs. Full text available.

Message received at 60961 <at> debbugs.gnu.org:


Received: (at 60961) by debbugs.gnu.org; 20 Jan 2023 13:50:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 20 08:50:29 2023
Received: from localhost ([127.0.0.1]:45895 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pIrmm-0000kT-Na
	for submit <at> debbugs.gnu.org; Fri, 20 Jan 2023 08:50:29 -0500
Received: from out-116.mta0.migadu.com ([91.218.175.116]:14396)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <theo@HIDDEN>) id 1pIrmk-0000kK-4X
 for 60961 <at> debbugs.gnu.org; Fri, 20 Jan 2023 08:50:27 -0500
X-Report-Abuse: Please report any abuse attempt to abuse@HIDDEN and
 include these headers.
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no;
 s=key1; t=1674222623;
 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=CIHx0VFXnSiNd3NCrBei+PUSTtBDfpb0EZukQgE5Mvg=;
 b=O3m6fQNsbuQBPYzgnHpx1dFnJBYfsxE1xuqwv8Pg3WByicvMSTIUeuFc6Midlhu+4CAXFj
 wLSjL7kHn8Z/n1sg7C9qW3gftLCleMJK9yro+4PjWaS7K08IqZXJTnEqB8NP8x5ZWG6Uaf
 ttuog0C1RMhNni5js50ajLFlkMuIfdOrQu8QFRFqJ0yOOi/THSNF+TCWdkPiPX4wY2Kiio
 dg6LJshTlw07DVqaMrihVd7NxkC/hwnsw59Bx3raf8CB6VbsrjD+MOC7YPPq9X1AfNJCk9
 FjBpdXkvNAbTgF9j8HAfdVxHVhbQnDkyfu8ypHlj+KpU1IYqBnC1uX/acAF2iA==
From: Theodor Thornhill <theo@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>, Robert Pluim <rpluim@HIDDEN>, Yuan Fu
 <casouri@HIDDEN>
Subject: Re: bug#60961: 29.0.60; Compiling emacs-29 without treesitter
 outputs warnings
In-Reply-To: <831qnpnx9g.fsf@HIDDEN>
References: <878rhx1os6.fsf@HIDDEN> <831qnpnx9g.fsf@HIDDEN>
Date: Fri, 20 Jan 2023 14:50:22 +0100
Message-ID: <87o7qtuxgh.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Migadu-Flow: FLOW_OUT
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 60961
Cc: 60961 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: Robert Pluim <rpluim@HIDDEN>
>> Date: Fri, 20 Jan 2023 11:30:33 +0100
>> 
>> 
>> This is emacs-29 as of 6b2f85caa6c
>> 
>>   ELC      progmodes/csharp-mode.elc
>>   Warning (treesit): Cannot activate tree-sitter, because tree-sitter library is not compiled with Emacs
>>   Warning (treesit): Cannot activate tree-sitter, because tree-sitter library is not compiled with Emacs
>>   Warning (treesit): Cannot activate tree-sitter, because tree-sitter library is not compiled with Emacs
>>   ELC      progmodes/dockerfile-ts-mode.elc
>>   ELC      progmodes/go-ts-mode.elc
>>   ELC      progmodes/java-ts-mode.elc
>>   Warning (treesit): Cannot activate tree-sitter, because tree-sitter library is not compiled with Emacs
>>   Warning (treesit): Cannot activate tree-sitter, because tree-sitter library is not compiled with Emacs
>>   Warning (treesit): Cannot activate tree-sitter, because tree-sitter library is not compiled with Emacs
>>   ELC      progmodes/js.elc
>>   Warning (treesit): Cannot activate tree-sitter, because tree-sitter library is not compiled with Emacs
>>   Warning (treesit): Cannot activate tree-sitter, because tree-sitter library is not compiled with Emacs
>>   Warning (treesit): Cannot activate tree-sitter, because tree-sitter library is not compiled with Emacs
>>   ELC      progmodes/json-ts-mode.elc
>>   ELC      progmodes/python.elc
>>   ELC      progmodes/ruby-mode.elc
>>   ELC      progmodes/ruby-ts-mode.elc
>>   ELC      progmodes/rust-ts-mode.elc
>>   Warning (treesit): Cannot activate tree-sitter, because tree-sitter library is not compiled with Emacs
>>   Warning (treesit): Cannot activate tree-sitter, because tree-sitter library is not compiled with Emacs
>>   Warning (treesit): Cannot activate tree-sitter, because tree-sitter library is not compiled with Emacs
>>   ELC      progmodes/typescript-ts-mode.elc
>>   Warning (treesit): Cannot activate tree-sitter, because tree-sitter library is not compiled with Emacs
>>   Warning (treesit): Cannot activate tree-sitter, because tree-sitter library is not compiled with Emacs
>>   Warning (treesit): Cannot activate tree-sitter, because tree-sitter library is not compiled with Emacs
>
> Yes, I've seen these as well.  The reason is that some modes 'require'
> c-ts-mode, because they want to use their comment-related functions.
> But the changes I made recently call treesit-ready-p when c-ts-mode is
> being loaded, and that emits the warning.  I can shut up the warning
> by calling treesit-ready-p with a non-nil QUIET argument, but then the
> warning will not be emitted if users load c-ts-mode from their init
> files or manually, which is not good.  I tried several other
> solutions, but they either didn't work or were not clean enough for my
> palate.
>
> Yuan/Theo, please find a solution for this.  If no better idea comes
> up, I think the c-ts-mode functions that other modes want to use
> should be moved to a separate file, and that file that can be
> 'require'd by all those which want it, including by c-ts-mode.el.
>

Yeah, I was hoping to actually just allowing some duplication of code,
until some "best practice" emerges the coming months, and we can make a
treesit-common-lib.el or something like that.

So I can either just make sure that no modes require across modes, or
make that "lib" right now.  What do you think?

Theo




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#60961; Package emacs. Full text available.

Message received at 60961 <at> debbugs.gnu.org:


Received: (at 60961) by debbugs.gnu.org; 20 Jan 2023 13:36:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 20 08:36:42 2023
Received: from localhost ([127.0.0.1]:45865 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pIrZS-00006r-G6
	for submit <at> debbugs.gnu.org; Fri, 20 Jan 2023 08:36:42 -0500
Received: from eggs.gnu.org ([209.51.188.92]:36952)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1pIrZQ-00006b-IC
 for 60961 <at> debbugs.gnu.org; Fri, 20 Jan 2023 08:36:40 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pIrZG-0005mJ-5p; Fri, 20 Jan 2023 08:36:34 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=08BEtQ3pYvjbqVAGB6OrJVbJhvP6kVM+cuQj7BcKo30=; b=XBpyqMIGiZ6m
 ItzUGsakxew8nC7aDhORo2XOu8RBmg4wc4zGxzDOOcoh0rYF5tcRh7Wa+2HDnou+lHomwbVJ3Jp6U
 qITWQgeyNKLFW+ndcMoIHoqd4TnBrMZWxjaVkxUQEB0VbhK5TN4iAiuJgL2tEWKVGuoaWfW8noRMO
 FeKhkvbSXH+M8CUQTc0CgWm2++Gi8G1Df2KZyp69N2pMFlvkRqqjU2vVGzWAkFLeoMETW3j9Cw9aB
 0KwWuFqa6VzXKVliDY1suu2ZkyzeuodWLjKsf8VhemPv7KI8fVRGTwK/9bZmYTM3oCZeaZpyM/o1+
 whA2x+BP79xom3mQUaEFpg==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pIrZE-00017q-Lp; Fri, 20 Jan 2023 08:36:29 -0500
Date: Fri, 20 Jan 2023 15:36:27 +0200
Message-Id: <831qnpnx9g.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Robert Pluim <rpluim@HIDDEN>, Yuan Fu <casouri@HIDDEN>,
 Theodor Thornhill <theo@HIDDEN>
In-Reply-To: <878rhx1os6.fsf@HIDDEN> (message from Robert Pluim on Fri, 20
 Jan 2023 11:30:33 +0100)
Subject: Re: bug#60961: 29.0.60;
 Compiling emacs-29 without treesitter outputs warnings
References: <878rhx1os6.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 60961
Cc: 60961 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Robert Pluim <rpluim@HIDDEN>
> Date: Fri, 20 Jan 2023 11:30:33 +0100
> 
> 
> This is emacs-29 as of 6b2f85caa6c
> 
>   ELC      progmodes/csharp-mode.elc
>   Warning (treesit): Cannot activate tree-sitter, because tree-sitter library is not compiled with Emacs
>   Warning (treesit): Cannot activate tree-sitter, because tree-sitter library is not compiled with Emacs
>   Warning (treesit): Cannot activate tree-sitter, because tree-sitter library is not compiled with Emacs
>   ELC      progmodes/dockerfile-ts-mode.elc
>   ELC      progmodes/go-ts-mode.elc
>   ELC      progmodes/java-ts-mode.elc
>   Warning (treesit): Cannot activate tree-sitter, because tree-sitter library is not compiled with Emacs
>   Warning (treesit): Cannot activate tree-sitter, because tree-sitter library is not compiled with Emacs
>   Warning (treesit): Cannot activate tree-sitter, because tree-sitter library is not compiled with Emacs
>   ELC      progmodes/js.elc
>   Warning (treesit): Cannot activate tree-sitter, because tree-sitter library is not compiled with Emacs
>   Warning (treesit): Cannot activate tree-sitter, because tree-sitter library is not compiled with Emacs
>   Warning (treesit): Cannot activate tree-sitter, because tree-sitter library is not compiled with Emacs
>   ELC      progmodes/json-ts-mode.elc
>   ELC      progmodes/python.elc
>   ELC      progmodes/ruby-mode.elc
>   ELC      progmodes/ruby-ts-mode.elc
>   ELC      progmodes/rust-ts-mode.elc
>   Warning (treesit): Cannot activate tree-sitter, because tree-sitter library is not compiled with Emacs
>   Warning (treesit): Cannot activate tree-sitter, because tree-sitter library is not compiled with Emacs
>   Warning (treesit): Cannot activate tree-sitter, because tree-sitter library is not compiled with Emacs
>   ELC      progmodes/typescript-ts-mode.elc
>   Warning (treesit): Cannot activate tree-sitter, because tree-sitter library is not compiled with Emacs
>   Warning (treesit): Cannot activate tree-sitter, because tree-sitter library is not compiled with Emacs
>   Warning (treesit): Cannot activate tree-sitter, because tree-sitter library is not compiled with Emacs

Yes, I've seen these as well.  The reason is that some modes 'require'
c-ts-mode, because they want to use their comment-related functions.
But the changes I made recently call treesit-ready-p when c-ts-mode is
being loaded, and that emits the warning.  I can shut up the warning
by calling treesit-ready-p with a non-nil QUIET argument, but then the
warning will not be emitted if users load c-ts-mode from their init
files or manually, which is not good.  I tried several other
solutions, but they either didn't work or were not clean enough for my
palate.

Yuan/Theo, please find a solution for this.  If no better idea comes
up, I think the c-ts-mode functions that other modes want to use
should be moved to a separate file, and that file that can be
'require'd by all those which want it, including by c-ts-mode.el.

TIA.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#60961; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 20 Jan 2023 10:30:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 20 05:30:46 2023
Received: from localhost ([127.0.0.1]:45694 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pIofV-0001Ht-TE
	for submit <at> debbugs.gnu.org; Fri, 20 Jan 2023 05:30:46 -0500
Received: from lists.gnu.org ([209.51.188.17]:55744)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rpluim@HIDDEN>) id 1pIofR-0001Hj-Iu
 for submit <at> debbugs.gnu.org; Fri, 20 Jan 2023 05:30:44 -0500
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 <rpluim@HIDDEN>) id 1pIofR-0006vM-B2
 for bug-gnu-emacs@HIDDEN; Fri, 20 Jan 2023 05:30:41 -0500
Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <rpluim@HIDDEN>) id 1pIofO-000292-9y
 for bug-gnu-emacs@HIDDEN; Fri, 20 Jan 2023 05:30:41 -0500
Received: by mail-wr1-x42c.google.com with SMTP id d14so742628wrr.9
 for <bug-gnu-emacs@HIDDEN>; Fri, 20 Jan 2023 02:30:37 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=mime-version:message-id:date:subject:to:from:from:to:cc:subject
 :date:message-id:reply-to;
 bh=LUXow9rJDi5AciRk73NeNLZfMqqQjkLH1ykwUnEfCgY=;
 b=MoIjqEfBKJBZwFNuMhsEcAmMoV8VdHaKPPW03RFODsjZ49QN6GcMjnJBlPWJvDVSIp
 LcIXlKDVBWSmi+29RstUELPc4QQP0pOicxtTdwdclpcslaOTVD+wJ7WYVIGmQYLPjC3M
 19IGZKqFCgfIAOoY8/yoQa8jbISzSYf/6fhG31a4KS6qqRJCQieLZTt4jb/974mCkTBY
 9C5H4RubS/iUlq1NoDVacy3MAETIK7lucdUqYJwxVvk3V6SLKNNAAib1I+5XDWjRI/CE
 uVLa79IoA0Rzjb+2l6RAQJt/P5w4mNIMwzB9tlzTB7hsOMiKHHnYqAk89wIE5Y4ciLoA
 w85g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=mime-version:message-id:date:subject:to:from:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=LUXow9rJDi5AciRk73NeNLZfMqqQjkLH1ykwUnEfCgY=;
 b=rms3govSDoHPE+xjZUMQJhKYsKRPZnmtg5mCjsYNc2QjChx1h2cUAbn2pmbJt67I1U
 DMMnDUY2AC8Er1CxyW9G87x34YW/AH+QBD5hBcld9d8OMxePUxzW8//OmM3UygTqZE4o
 t0pxa+rcfLM52YvRSlwKfVV3ZpEjAEDgWuQjYuYG1As4nSul1LIJA/3UvuBkxDbjztgG
 wnjGEd8WUtDzlELIuWrUcRIF4/OBSYdJRBMrEitgyYW5zzNwNCYPNadW9U/TF1EP+uXj
 oBQw5htyGC6guSm/EG3XX5Lx/A3A1V0rHpsgZam+nsSGjzkkap0dZim4PZS76VUbj5/Z
 uQfQ==
X-Gm-Message-State: AFqh2kpXUpbDwBLF162uubX9WMZGBYOyxfAfKJdUTN7If/IP9FZebyzU
 be4hNEWlY17AkjiqCbhihmW/Ut2QDrs=
X-Google-Smtp-Source: AMrXdXtkwhS/37Brv1kOqFedznQnBduufLeT0mdEBQ5QUS0YfffW4cPr8c8kYlzAI+bOxz/VCP+WHg==
X-Received: by 2002:a05:6000:1e0f:b0:2bd:fe42:2b34 with SMTP id
 bj15-20020a0560001e0f00b002bdfe422b34mr13335650wrb.71.1674210635598; 
 Fri, 20 Jan 2023 02:30:35 -0800 (PST)
Received: from rltb ([82.66.8.55]) by smtp.gmail.com with ESMTPSA id
 n6-20020adfe786000000b002bdbde1d3absm25653493wrm.78.2023.01.20.02.30.34
 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 20 Jan 2023 02:30:34 -0800 (PST)
From: Robert Pluim <rpluim@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 29.0.60; Compiling emacs-29 without treesitter outputs warnings
X-Debbugs-No-Ack: yes
Date: Fri, 20 Jan 2023 11:30:33 +0100
Message-ID: <878rhx1os6.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
Received-SPF: pass client-ip=2a00:1450:4864:20::42c;
 envelope-from=rpluim@HIDDEN; helo=mail-wr1-x42c.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-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)


This is emacs-29 as of 6b2f85caa6c

  ELC      progmodes/csharp-mode.elc
  Warning (treesit): Cannot activate tree-sitter, because tree-sitter library is not compiled with Emacs
  Warning (treesit): Cannot activate tree-sitter, because tree-sitter library is not compiled with Emacs
  Warning (treesit): Cannot activate tree-sitter, because tree-sitter library is not compiled with Emacs
  ELC      progmodes/dockerfile-ts-mode.elc
  ELC      progmodes/go-ts-mode.elc
  ELC      progmodes/java-ts-mode.elc
  Warning (treesit): Cannot activate tree-sitter, because tree-sitter library is not compiled with Emacs
  Warning (treesit): Cannot activate tree-sitter, because tree-sitter library is not compiled with Emacs
  Warning (treesit): Cannot activate tree-sitter, because tree-sitter library is not compiled with Emacs
  ELC      progmodes/js.elc
  Warning (treesit): Cannot activate tree-sitter, because tree-sitter library is not compiled with Emacs
  Warning (treesit): Cannot activate tree-sitter, because tree-sitter library is not compiled with Emacs
  Warning (treesit): Cannot activate tree-sitter, because tree-sitter library is not compiled with Emacs
  ELC      progmodes/json-ts-mode.elc
  ELC      progmodes/python.elc
  ELC      progmodes/ruby-mode.elc
  ELC      progmodes/ruby-ts-mode.elc
  ELC      progmodes/rust-ts-mode.elc
  Warning (treesit): Cannot activate tree-sitter, because tree-sitter library is not compiled with Emacs
  Warning (treesit): Cannot activate tree-sitter, because tree-sitter library is not compiled with Emacs
  Warning (treesit): Cannot activate tree-sitter, because tree-sitter library is not compiled with Emacs
  ELC      progmodes/typescript-ts-mode.elc
  Warning (treesit): Cannot activate tree-sitter, because tree-sitter library is not compiled with Emacs
  Warning (treesit): Cannot activate tree-sitter, because tree-sitter library is not compiled with Emacs
  Warning (treesit): Cannot activate tree-sitter, because tree-sitter library is not compiled with Emacs

In GNU Emacs 29.0.60 (build 38, x86_64-pc-linux-gnu, X toolkit, cairo
 version 1.16.0, Xaw3d scroll bars) of 2023-01-19 built on rltb
Repository revision: faee7e1f1bd0167e455a0e1e5fe02e21d23fd77f
Repository branch: emacs-29
Windowing system distributor 'The X.Org Foundation', version 11.0.12011000
System Description: Debian GNU/Linux 11 (bullseye)

Configured using:
 'configure --with-x-toolkit=lucid'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ
JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES
NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS WEBP X11 XAW3D XDBE XIM XINPUT2 XPM LUCID ZLIB

Robert
-- 




Report forwarded to bug-gnu-emacs@HIDDEN:
bug#60961; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sat, 21 Jan 2023 20:45:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.