From unknown Sun Jun 22 00:36:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#60961: 29.0.60; Compiling emacs-29 without treesitter outputs warnings Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Jan 2023 10:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 60961 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 60961@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16742106464957 (code B ref -1); Fri, 20 Jan 2023 10:31:01 +0000 Received: (at submit) by debbugs.gnu.org; 20 Jan 2023 10:30:46 +0000 Received: from localhost ([127.0.0.1]:45694 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pIofV-0001Ht-TE for submit@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 ) id 1pIofR-0001Hj-Iu for submit@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 ) id 1pIofR-0006vM-B2 for bug-gnu-emacs@gnu.org; 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 ) id 1pIofO-000292-9y for bug-gnu-emacs@gnu.org; Fri, 20 Jan 2023 05:30:41 -0500 Received: by mail-wr1-x42c.google.com with SMTP id d14so742628wrr.9 for ; 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 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Jan 2023 02:30:34 -0800 (PST) From: Robert Pluim Date: Fri, 20 Jan 2023 11:30:33 +0100 Message-ID: <878rhx1os6.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=rpluim@gmail.com; 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" 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 -- From unknown Sun Jun 22 00:36:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#60961: 29.0.60; Compiling emacs-29 without treesitter outputs warnings Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Jan 2023 13:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60961 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Robert Pluim , Yuan Fu , Theodor Thornhill Cc: 60961@debbugs.gnu.org Received: via spool by 60961-submit@debbugs.gnu.org id=B60961.1674221803431 (code B ref 60961); Fri, 20 Jan 2023 13:37:01 +0000 Received: (at 60961) by debbugs.gnu.org; 20 Jan 2023 13:36:43 +0000 Received: from localhost ([127.0.0.1]:45865 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pIrZS-00006r-G6 for submit@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 ) id 1pIrZQ-00006b-IC for 60961@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 ) 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 ) 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@gnu.org> From: Eli Zaretskii In-Reply-To: <878rhx1os6.fsf@gmail.com> (message from Robert Pluim on Fri, 20 Jan 2023 11:30:33 +0100) References: <878rhx1os6.fsf@gmail.com> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Robert Pluim > 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. From unknown Sun Jun 22 00:36:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#60961: 29.0.60; Compiling emacs-29 without treesitter outputs warnings Resent-From: Theodor Thornhill Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Jan 2023 13:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60961 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii , Robert Pluim , Yuan Fu Cc: 60961@debbugs.gnu.org Received: via spool by 60961-submit@debbugs.gnu.org id=B60961.16742226292885 (code B ref 60961); Fri, 20 Jan 2023 13:51:02 +0000 Received: (at 60961) by debbugs.gnu.org; 20 Jan 2023 13:50:29 +0000 Received: from localhost ([127.0.0.1]:45895 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pIrmm-0000kT-Na for submit@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 ) id 1pIrmk-0000kK-4X for 60961@debbugs.gnu.org; Fri, 20 Jan 2023 08:50:27 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=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 In-Reply-To: <831qnpnx9g.fsf@gnu.org> References: <878rhx1os6.fsf@gmail.com> <831qnpnx9g.fsf@gnu.org> Date: Fri, 20 Jan 2023 14:50:22 +0100 Message-ID: <87o7qtuxgh.fsf@thornhill.no> MIME-Version: 1.0 Content-Type: text/plain X-Migadu-Flow: FLOW_OUT X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: >> From: Robert Pluim >> 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 From unknown Sun Jun 22 00:36:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#60961: 29.0.60; Compiling emacs-29 without treesitter outputs warnings Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Jan 2023 14:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60961 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Theodor Thornhill Cc: rpluim@gmail.com, casouri@gmail.com, 60961@debbugs.gnu.org Received: via spool by 60961-submit@debbugs.gnu.org id=B60961.16742241765618 (code B ref 60961); Fri, 20 Jan 2023 14:17:01 +0000 Received: (at 60961) by debbugs.gnu.org; 20 Jan 2023 14:16:16 +0000 Received: from localhost ([127.0.0.1]:45976 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pIsBj-0001SY-Rd for submit@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 ) id 1pIsBi-0001SJ-LE for 60961@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 ) 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 ) 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@gnu.org> From: Eli Zaretskii In-Reply-To: <87o7qtuxgh.fsf@thornhill.no> (message from Theodor Thornhill on Fri, 20 Jan 2023 14:50:22 +0100) References: <878rhx1os6.fsf@gmail.com> <831qnpnx9g.fsf@gnu.org> <87o7qtuxgh.fsf@thornhill.no> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Theodor Thornhill > Cc: 60961@debbugs.gnu.org > Date: Fri, 20 Jan 2023 14:50:22 +0100 > > Eli Zaretskii 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? From unknown Sun Jun 22 00:36:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#60961: 29.0.60; Compiling emacs-29 without treesitter outputs warnings Resent-From: Theodor Thornhill Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Jan 2023 14:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60961 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: rpluim@gmail.com, casouri@gmail.com, 60961@debbugs.gnu.org Received: via spool by 60961-submit@debbugs.gnu.org id=B60961.167422582017225 (code B ref 60961); Fri, 20 Jan 2023 14:44:02 +0000 Received: (at 60961) by debbugs.gnu.org; 20 Jan 2023 14:43:40 +0000 Received: from localhost ([127.0.0.1]:46015 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pIscF-0004Tk-Oj for submit@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 ) id 1pIscD-0004TY-Cc for 60961@debbugs.gnu.org; Fri, 20 Jan 2023 09:43:38 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=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 In-Reply-To: <83tu0lmgv6.fsf@gnu.org> References: <878rhx1os6.fsf@gmail.com> <831qnpnx9g.fsf@gnu.org> <87o7qtuxgh.fsf@thornhill.no> <83tu0lmgv6.fsf@gnu.org> Date: Fri, 20 Jan 2023 15:43:33 +0100 Message-ID: <87h6wll10q.fsf@thornhill.no> MIME-Version: 1.0 Content-Type: text/plain X-Migadu-Flow: FLOW_OUT X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Eli Zaretskii writes: >> From: Theodor Thornhill >> Cc: 60961@debbugs.gnu.org >> Date: Fri, 20 Jan 2023 14:50:22 +0100 >> >> Eli Zaretskii 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 From unknown Sun Jun 22 00:36:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#60961: 29.0.60; Compiling emacs-29 without treesitter outputs warnings Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Jan 2023 15:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60961 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Theodor Thornhill Cc: rpluim@gmail.com, casouri@gmail.com, 60961@debbugs.gnu.org Received: via spool by 60961-submit@debbugs.gnu.org id=B60961.167422785021876 (code B ref 60961); Fri, 20 Jan 2023 15:18:02 +0000 Received: (at 60961) by debbugs.gnu.org; 20 Jan 2023 15:17:30 +0000 Received: from localhost ([127.0.0.1]:46895 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pIt90-0005gm-7H for submit@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 ) id 1pIt8y-0005ga-Uk for 60961@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 ) 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 ) 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@gnu.org> From: Eli Zaretskii In-Reply-To: <87h6wll10q.fsf@thornhill.no> (message from Theodor Thornhill on Fri, 20 Jan 2023 15:43:33 +0100) References: <878rhx1os6.fsf@gmail.com> <831qnpnx9g.fsf@gnu.org> <87o7qtuxgh.fsf@thornhill.no> <83tu0lmgv6.fsf@gnu.org> <87h6wll10q.fsf@thornhill.no> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Theodor Thornhill > Cc: rpluim@gmail.com, casouri@gmail.com, 60961@debbugs.gnu.org > Date: Fri, 20 Jan 2023 15:43:33 +0100 > > Eli Zaretskii 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. From unknown Sun Jun 22 00:36:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#60961: 29.0.60; Compiling emacs-29 without treesitter outputs warnings Resent-From: Theodor Thornhill Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Jan 2023 16:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60961 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: rpluim@gmail.com, casouri@gmail.com, 60961@debbugs.gnu.org Received: via spool by 60961-submit@debbugs.gnu.org id=B60961.167423093527110 (code B ref 60961); Fri, 20 Jan 2023 16:09:01 +0000 Received: (at 60961) by debbugs.gnu.org; 20 Jan 2023 16:08:55 +0000 Received: from localhost ([127.0.0.1]:46937 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pItwk-00073B-QO for submit@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 ) id 1pItwi-000732-W1 for 60961@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@migadu.com and include these headers. From: Theodor Thornhill In-Reply-To: <83r0vpme0t.fsf@gnu.org> References: <878rhx1os6.fsf@gmail.com> <831qnpnx9g.fsf@gnu.org> <87o7qtuxgh.fsf@thornhill.no> <83tu0lmgv6.fsf@gnu.org> <87h6wll10q.fsf@thornhill.no> <83r0vpme0t.fsf@gnu.org> Message-ID: <8A47E6B6-BE4F-44F4-9BC5-55B6051CDCD4@thornhill.no> 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On 20 January 2023 16:17:22 CET, Eli Zaretskii wrote: >> From: Theodor Thornhill >> Cc: rpluim@gmail=2Ecom, casouri@gmail=2Ecom, 60961@debbugs=2Egnu=2Eorg >> Date: Fri, 20 Jan 2023 15:43:33 +0100 >>=20 >> Eli Zaretskii 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 From unknown Sun Jun 22 00:36:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#60961: 29.0.60; Compiling emacs-29 without treesitter outputs warnings Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Jan 2023 22:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60961 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Theodor Thornhill Cc: Eli Zaretskii , rpluim@gmail.com, 60961@debbugs.gnu.org Received: via spool by 60961-submit@debbugs.gnu.org id=B60961.167425272511535 (code B ref 60961); Fri, 20 Jan 2023 22:13:01 +0000 Received: (at 60961) by debbugs.gnu.org; 20 Jan 2023 22:12:05 +0000 Received: from localhost ([127.0.0.1]:47381 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pIzcC-0002zy-Jh for submit@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 ) id 1pIzcB-0002zS-Lv for 60961@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@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\)) From: Yuan Fu In-Reply-To: <8A47E6B6-BE4F-44F4-9BC5-55B6051CDCD4@thornhill.no> Date: Fri, 20 Jan 2023 14:11:44 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: References: <878rhx1os6.fsf@gmail.com> <831qnpnx9g.fsf@gnu.org> <87o7qtuxgh.fsf@thornhill.no> <83tu0lmgv6.fsf@gnu.org> <87h6wll10q.fsf@thornhill.no> <83r0vpme0t.fsf@gnu.org> <8A47E6B6-BE4F-44F4-9BC5-55B6051CDCD4@thornhill.no> X-Mailer: Apple Mail (2.3731.300.101.1.3) X-Spam-Score: 1.0 (+) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > On Jan 20, 2023, at 8:07 AM, Theodor Thornhill = wrote: >=20 >=20 >=20 > On 20 January 2023 16:17:22 CET, Eli Zaretskii wrote: >>> From: Theodor Thornhill >>> Cc: rpluim@gmail.com, casouri@gmail.com, 60961@debbugs.gnu.org >>> Date: Fri, 20 Jan 2023 15:43:33 +0100 >>>=20 >>> Eli Zaretskii 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 From unknown Sun Jun 22 00:36:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#60961: 29.0.60; Compiling emacs-29 without treesitter outputs warnings Resent-From: Theodor Thornhill Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Jan 2023 22:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60961 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Yuan Fu Cc: Eli Zaretskii , rpluim@gmail.com, 60961@debbugs.gnu.org Received: via spool by 60961-submit@debbugs.gnu.org id=B60961.167425384713826 (code B ref 60961); Fri, 20 Jan 2023 22:31:01 +0000 Received: (at 60961) by debbugs.gnu.org; 20 Jan 2023 22:30:47 +0000 Received: from localhost ([127.0.0.1]:47429 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pIzuJ-0003aw-Ag for submit@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 ) id 1pIzuI-0003an-0N for 60961@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@migadu.com and include these headers. From: Theodor Thornhill In-Reply-To: References: <878rhx1os6.fsf@gmail.com> <831qnpnx9g.fsf@gnu.org> <87o7qtuxgh.fsf@thornhill.no> <83tu0lmgv6.fsf@gnu.org> <87h6wll10q.fsf@thornhill.no> <83r0vpme0t.fsf@gnu.org> <8A47E6B6-BE4F-44F4-9BC5-55B6051CDCD4@thornhill.no> Message-ID: <2025C712-7091-4971-B254-51844C0FA609@thornhill.no> 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 20 January 2023 23:11:44 CET, Yuan Fu wrote: > > >> On Jan 20, 2023, at 8:07 AM, Theodor Thornhill wr= ote: >>=20 >>=20 >>=20 >> On 20 January 2023 16:17:22 CET, Eli Zaretskii wrote: >>>> From: Theodor Thornhill >>>> Cc: rpluim@gmail=2Ecom, casouri@gmail=2Ecom, 60961@debbugs=2Egnu=2Eor= g >>>> Date: Fri, 20 Jan 2023 15:43:33 +0100 >>>>=20 >>>> Eli Zaretskii 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 From unknown Sun Jun 22 00:36:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#60961: 29.0.60; Compiling emacs-29 without treesitter outputs warnings Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Jan 2023 22:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60961 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Theodor Thornhill Cc: Eli Zaretskii , Robert Pluim , 60961@debbugs.gnu.org Received: via spool by 60961-submit@debbugs.gnu.org id=B60961.167425418114431 (code B ref 60961); Fri, 20 Jan 2023 22:37:01 +0000 Received: (at 60961) by debbugs.gnu.org; 20 Jan 2023 22:36:21 +0000 Received: from localhost ([127.0.0.1]:47439 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pIzzg-0003kh-HL for submit@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 ) id 1pIzze-0003kR-BJ for 60961@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@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\)) From: Yuan Fu In-Reply-To: <2025C712-7091-4971-B254-51844C0FA609@thornhill.no> Date: Fri, 20 Jan 2023 14:36:00 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <7824DF9F-E027-4D2C-ACCF-028D34332AE6@gmail.com> References: <878rhx1os6.fsf@gmail.com> <831qnpnx9g.fsf@gnu.org> <87o7qtuxgh.fsf@thornhill.no> <83tu0lmgv6.fsf@gnu.org> <87h6wll10q.fsf@thornhill.no> <83r0vpme0t.fsf@gnu.org> <8A47E6B6-BE4F-44F4-9BC5-55B6051CDCD4@thornhill.no> <2025C712-7091-4971-B254-51844C0FA609@thornhill.no> X-Mailer: Apple Mail (2.3731.300.101.1.3) X-Spam-Score: 1.0 (+) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > On Jan 20, 2023, at 2:30 PM, Theodor Thornhill = wrote: >=20 >=20 >=20 > On 20 January 2023 23:11:44 CET, Yuan Fu wrote: >>=20 >>=20 >>> On Jan 20, 2023, at 8:07 AM, Theodor Thornhill = wrote: >>>=20 >>>=20 >>>=20 >>> On 20 January 2023 16:17:22 CET, Eli Zaretskii wrote: >>>>> From: Theodor Thornhill >>>>> Cc: rpluim@gmail.com, casouri@gmail.com, 60961@debbugs.gnu.org >>>>> Date: Fri, 20 Jan 2023 15:43:33 +0100 >>>>>=20 >>>>> Eli Zaretskii 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= From unknown Sun Jun 22 00:36:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#60961: 29.0.60; Compiling emacs-29 without treesitter outputs warnings Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Jan 2023 04:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60961 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Yuan Fu Cc: rpluim@gmail.com, theo@thornhill.no, 60961@debbugs.gnu.org Received: via spool by 60961-submit@debbugs.gnu.org id=B60961.167427473817617 (code B ref 60961); Sat, 21 Jan 2023 04:19:02 +0000 Received: (at 60961) by debbugs.gnu.org; 21 Jan 2023 04:18:58 +0000 Received: from localhost ([127.0.0.1]:47704 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pJ5LF-0004a5-Qo for submit@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 ) id 1pJ5LE-0004Zs-4c for 60961@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 ) 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 ) 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@gnu.org> From: Eli Zaretskii In-Reply-To: (message from Yuan Fu on Fri, 20 Jan 2023 14:11:44 -0800) References: <878rhx1os6.fsf@gmail.com> <831qnpnx9g.fsf@gnu.org> <87o7qtuxgh.fsf@thornhill.no> <83tu0lmgv6.fsf@gnu.org> <87h6wll10q.fsf@thornhill.no> <83r0vpme0t.fsf@gnu.org> <8A47E6B6-BE4F-44F4-9BC5-55B6051CDCD4@thornhill.no> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Yuan Fu > Date: Fri, 20 Jan 2023 14:11:44 -0800 > Cc: Eli Zaretskii , > rpluim@gmail.com, > 60961@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. From unknown Sun Jun 22 00:36:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#60961: 29.0.60; Compiling emacs-29 without treesitter outputs warnings Resent-From: Theodor Thornhill Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Jan 2023 12:25:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60961 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii , Yuan Fu Cc: rpluim@gmail.com, 60961@debbugs.gnu.org Received: via spool by 60961-submit@debbugs.gnu.org id=B60961.167430386310913 (code B ref 60961); Sat, 21 Jan 2023 12:25:01 +0000 Received: (at 60961) by debbugs.gnu.org; 21 Jan 2023 12:24:23 +0000 Received: from localhost ([127.0.0.1]:48228 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pJCuz-0002pw-Jw for submit@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 ) id 1pJCuw-0002pl-Ll for 60961@debbugs.gnu.org; Sat, 21 Jan 2023 07:24:21 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=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 In-Reply-To: <83edromses.fsf@gnu.org> References: <878rhx1os6.fsf@gmail.com> <831qnpnx9g.fsf@gnu.org> <87o7qtuxgh.fsf@thornhill.no> <83tu0lmgv6.fsf@gnu.org> <87h6wll10q.fsf@thornhill.no> <83r0vpme0t.fsf@gnu.org> <8A47E6B6-BE4F-44F4-9BC5-55B6051CDCD4@thornhill.no> <83edromses.fsf@gnu.org> Date: Sat, 21 Jan 2023 13:24:12 +0100 Message-ID: <87edrohy8j.fsf@thornhill.no> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Migadu-Flow: FLOW_OUT X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Eli Zaretskii writes: >> From: Yuan Fu >> Date: Fri, 20 Jan 2023 14:11:44 -0800 >> Cc: Eli Zaretskii , >> rpluim@gmail.com, >> 60961@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 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) +;; 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 . + +;;; 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 --=-=-=-- From unknown Sun Jun 22 00:36:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#60961: 29.0.60; Compiling emacs-29 without treesitter outputs warnings Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Jan 2023 12:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60961 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Theodor Thornhill Cc: casouri@gmail.com, rpluim@gmail.com, 60961@debbugs.gnu.org Received: via spool by 60961-submit@debbugs.gnu.org id=B60961.167430470121191 (code B ref 60961); Sat, 21 Jan 2023 12:39:02 +0000 Received: (at 60961) by debbugs.gnu.org; 21 Jan 2023 12:38:21 +0000 Received: from localhost ([127.0.0.1]:48247 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pJD8X-0005Vi-83 for submit@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 ) id 1pJD8V-0005VU-Vv for 60961@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 ) 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 ) 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@gnu.org> From: Eli Zaretskii In-Reply-To: <87edrohy8j.fsf@thornhill.no> (message from Theodor Thornhill on Sat, 21 Jan 2023 13:24:12 +0100) References: <878rhx1os6.fsf@gmail.com> <831qnpnx9g.fsf@gnu.org> <87o7qtuxgh.fsf@thornhill.no> <83tu0lmgv6.fsf@gnu.org> <87h6wll10q.fsf@thornhill.no> <83r0vpme0t.fsf@gnu.org> <8A47E6B6-BE4F-44F4-9BC5-55B6051CDCD4@thornhill.no> <83edromses.fsf@gnu.org> <87edrohy8j.fsf@thornhill.no> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Theodor Thornhill > Cc: rpluim@gmail.com, 60961@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. From unknown Sun Jun 22 00:36:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#60961: 29.0.60; Compiling emacs-29 without treesitter outputs warnings Resent-From: Theodor Thornhill Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Jan 2023 12:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60961 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: casouri@gmail.com, rpluim@gmail.com, 60961@debbugs.gnu.org Received: via spool by 60961-submit@debbugs.gnu.org id=B60961.167430521422141 (code B ref 60961); Sat, 21 Jan 2023 12:47:02 +0000 Received: (at 60961) by debbugs.gnu.org; 21 Jan 2023 12:46:54 +0000 Received: from localhost ([127.0.0.1]:48284 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pJDGo-0005l2-Ay for submit@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 ) id 1pJDGl-0005ku-WD for 60961@debbugs.gnu.org; Sat, 21 Jan 2023 07:46:53 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=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 In-Reply-To: <83lelwkqpz.fsf@gnu.org> References: <878rhx1os6.fsf@gmail.com> <831qnpnx9g.fsf@gnu.org> <87o7qtuxgh.fsf@thornhill.no> <83tu0lmgv6.fsf@gnu.org> <87h6wll10q.fsf@thornhill.no> <83r0vpme0t.fsf@gnu.org> <8A47E6B6-BE4F-44F4-9BC5-55B6051CDCD4@thornhill.no> <83edromses.fsf@gnu.org> <87edrohy8j.fsf@thornhill.no> <83lelwkqpz.fsf@gnu.org> Date: Sat, 21 Jan 2023 13:46:49 +0100 Message-ID: <87r0vogime.fsf@thornhill.no> MIME-Version: 1.0 Content-Type: text/plain X-Migadu-Flow: FLOW_OUT X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: >> From: Theodor Thornhill >> Cc: rpluim@gmail.com, 60961@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 From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 21 15:42:05 2023 Received: (at control) by debbugs.gnu.org; 21 Jan 2023 20:42:05 +0000 Received: from localhost ([127.0.0.1]:49898 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pJKgf-0006n4-Ct for submit@debbugs.gnu.org; Sat, 21 Jan 2023 15:42:05 -0500 Received: from out2.migadu.com ([188.165.223.204]:30397) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pJKgc-0006mv-OT for control@debbugs.gnu.org; Sat, 21 Jan 2023 15:42:03 -0500 Date: Sat, 21 Jan 2023 21:42:01 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1674333722; h=from:from:reply-to:subject:subject:date:date:to:to:cc; bh=v6Eiqn2eYCb395AIw2nosHQ5cnSafit4AnlTy5oB9Hk=; b=HvnxahWRznL/Db6kGNpKjvelWDu1xW5UGod3U6F889zf9FVO6nvWQqJ9nUeiiZbWVWh2Ok vVrCE+xhonrD3Bjepiwn9rZcpw2pVwAzzbn9zv8DVyuGqOOK3v3YZA3755MLP6uUbn3m70 WYI92ALlrNTiO8C57wIfICvQ3DtGrtab9az9Un4m70cFEWi/OVaDmBa418FTPQD43wyB0J 8++RCMigGhGXMY5a9D0oIBrCgvv/OkAxgxHNpsaQIYVXnUaUtQLsBZzI5Uuat+YGcMjxGc 6BHF5azbytwU7ce8urwvfNU4XCsYry507Vd3aTZKZbVBsRAKfi8zefbuWIQqFg== To: control@debbugs.gnu.org X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Theodor Thornhill Subject: control message for bug #60961 X-Migadu-Flow: FLOW_OUT X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" Message-Id: X-Spam-Score: -1.0 (-) fixed 60961 30.1 quit From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 04 03:26:37 2023 Received: (at control) by debbugs.gnu.org; 4 Feb 2023 08:26:37 +0000 Received: from localhost ([127.0.0.1]:40634 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pODsa-0007fn-QU for submit@debbugs.gnu.org; Sat, 04 Feb 2023 03:26:36 -0500 Received: from out-225.mta1.migadu.com ([95.215.58.225]:59749) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pODsU-0007fa-RA for control@debbugs.gnu.org; Sat, 04 Feb 2023 03:26:35 -0500 Date: Sat, 04 Feb 2023 09:26:29 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1675499190; h=from:from:reply-to:subject:subject:date:date:to:to:cc; bh=J62RW1d+yR/LzzgWkErVGXTwjLigwcHTDuzFjL4C4h4=; b=N3HitYNVTz1Pa4M6JZQkidYEciOFndP6xD4dH1rnJqPb/ksR1m8IdlEVi/WQjj7SkbE7eY OcltAUwVAIVPUiE9aWBv6DvkOPxsd1BeohHJOrEyvpibyGDHGNZDQIF+VbeXN8E+9qKw4w +vDATpj684ix2B8tF1b5k9md5kZ5+pT5OaoFwBOu2797l6MQ7YxukC7Wjsy0a/Qca9bgH8 5b36HvSS3cxCQVedSQEV5IcdadPUNMJvej0zF+db+/4BMo9evmZ6WQHeRDkZWJ3+XZvgRO eccu2KPVDLUfs4nlFwuqa4L6FxVi0ySZ2YqoD7xjRsv4/AytQGzvHZIszyCfMg== To: control@debbugs.gnu.org X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Theodor Thornhill Subject: control message for bug #60961 X-Migadu-Flow: FLOW_OUT X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" Message-Id: X-Spam-Score: -1.0 (-) close 60961 29.1 quit