From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Use (eval-when-compile 'treesit) to save us from writing declare-function forms Date: Tue, 03 Dec 2024 15:12:40 +0200 Message-ID: <867c8g3o6v.fsf@gnu.org> References: <2C0B7D3A-6131-4427-BF04-9211981B57DD@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8518"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Dec 03 14:13:30 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tISiY-00021h-Fx for ged-emacs-devel@m.gmane-mx.org; Tue, 03 Dec 2024 14:13:30 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tIShp-0005nG-5V; Tue, 03 Dec 2024 08:12:45 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tIShm-0005mr-Sx for emacs-devel@gnu.org; Tue, 03 Dec 2024 08:12:42 -0500 Original-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 1tIShm-00062k-EX; Tue, 03 Dec 2024 08:12:42 -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=ZlPqjAhD7z7j/BiOLzuV5S1TMBuAdE3G/R7zZfj8h3o=; b=bkXu9Bf+eKd4EsQLOViA lUJ4Ll30rfl0gaYZVqkyM4rq8qpFtp+gtp9rHumGZJ6VEgKql8PylwrCRHQA76X+/7IApCvWk4FZc hqYl1tVwcf5zZfNdc2oUDk7kDqqChiz+kg4sHFl+Xg6nyCIxEF5YITcvhpK6PzC1r2lbp6HlqM6Z9 igWJ00SqrmNAIieIvyzhMNP5LjcjaCo2BqPr1DVS8zShEq0Yjjyq1Nr9+AJNEVV7jfVuhrXq0yO01 ewPzG7du0U/bopEFDpbUFsaHKNd2BME3TfZyYM/4biNshvwRH0JVdYPl42bqWA5NMUxGJtKPwU115 PX/wdq06IlN4sg==; In-Reply-To: <2C0B7D3A-6131-4427-BF04-9211981B57DD@gmail.com> (message from Yuan Fu on Mon, 2 Dec 2024 22:31:48 -0800) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:325984 Archived-At: > From: Yuan Fu > Date: Mon, 2 Dec 2024 22:31:48 -0800 > > Some of my recent changes to c-ts-mode.el uses some more C treesit functions, and I (again) forgot to add their declare-function forms to c-ts-mode.el, and Andrea has to fix it for me. The main problem for me is that (I think) you don’t get warning for them unless you build a non-tree-sitter build of Emacs. So I’m prone to forgot about them. Also it’s a burden for anyone wanting to use tree-sitter functions. > > treesit.el already has all the declare-function forms, how about we use (eval-when-compile 'treesit) in other files? I believe that should alleviate us from adding those declare-function forms in other files? I don't understand" c-ts-mode.el already does (require 'treesit) So what would eval-when-compile add to that?