From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.devel Subject: Use (eval-when-compile 'treesit) to save us from writing declare-function forms Date: Mon, 2 Dec 2024 22:31:48 -0800 Message-ID: <2C0B7D3A-6131-4427-BF04-9211981B57DD@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10727"; mail-complaints-to="usenet@ciao.gmane.io" To: Emacs Devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Dec 03 07:32:43 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 1tIMSh-0002ip-BF for ged-emacs-devel@m.gmane-mx.org; Tue, 03 Dec 2024 07:32:43 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tIMS5-0000Kx-1N; Tue, 03 Dec 2024 01:32:05 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tIMS3-0000Kn-MQ for emacs-devel@gnu.org; Tue, 03 Dec 2024 01:32:03 -0500 Original-Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tIMS2-0008IU-6m for emacs-devel@gnu.org; Tue, 03 Dec 2024 01:32:03 -0500 Original-Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-215c4000c20so1308555ad.3 for ; Mon, 02 Dec 2024 22:32:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733207520; x=1733812320; darn=gnu.org; h=to:date:message-id:subject:mime-version:content-transfer-encoding :from:from:to:cc:subject:date:message-id:reply-to; bh=QfEq2eV/7Lg7npxRTpdZK3ULIR4xU1r5d0KiGhXA8Ns=; b=lmebxlTmsc3k5eXY/8WRingFpqzFKaUiJEuTAyRalEQZfg3IfwqrQ3Q0GUzEUMMNhA CwBnWWUaxH16spY/hdJuz/pWMqbGcCVd7PfyVoO4wLCNpYZrtJXQgvpXaCv/0CjDSW28 UUyA5n8TIeVeeUSinP3iYIhufQiof+IJdWTFjkZxSvzLJT76jyHt3xBQmnZssdOm0eC3 SW3GAO+hVHTRa90YByAegtZvCbL/YjTp0/qE7wHpodvBKP6m9SPepb+AVMm6mL4/91XV vl5ggo11V/cT8ud47DZztws9I382blvhPD+cmFMGfawwR+/JdQNe0Y0Eyki86S36ZyVk yXRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733207520; x=1733812320; h=to:date:message-id:subject:mime-version:content-transfer-encoding :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=QfEq2eV/7Lg7npxRTpdZK3ULIR4xU1r5d0KiGhXA8Ns=; b=c0mW/WWDisK2Npgtr2rz4/a0RHliOVvw4nM7vaDeB7Bs/QWU2INzsqIfAOR8H6o8xL YkrGPntZ1lwQHQFmZPN34xzCUkeh2hun6yAMxWBjRxsSlqBFMr8QEmN1igRK5YQh3YLk kOFlcT2gGZBA+OmFouSk/YEEznTTktIkzPrQuWZuKYXBoA8X4sYUy6iglWj3Tuju6g9G oukL2AFgIV2/m18tZki5jtDDWdYmIxgM1pRRhC+cSgnDiU4M4ITvMQZmpSMRQYIQtsPk Mxvkq6qt6mIqK7/WKE4wcwQNzRXKSGopv1pXwUGIiQOHFeXGAtfsw+zQoIWXQtqkJRM0 7FkA== X-Gm-Message-State: AOJu0YzK23ifwf1q6RdBfVRJ399U2CNRBwrV5ihJF3ZpK06KTiruNN6v 654k20hnwjQ7gPeBawMd6Y5irUnHXgp2C9iYxi4c/besHmh1dsR+6OpiZw== X-Gm-Gg: ASbGnculzO55R1W4cdp7+SIWaBm4jd2zKbiJ7u9/mlPkQtWNprguAN8R6sgbq3crSnA /CFJUOK5odymFdYG+pVvR+eTirlR5SwlaNiznBZhqV4DRQ270ni89QyzfibEaNoRhrEYXkpFsfa I5PP0poQqNnCQTT9wWKVrFnaVcQcrhUdC8gNkDSSa+BfAlK0fLZr0IYIS3utmiUaMgipnhoKCos 1guZGw1V8oEOOVoQjPPtAakkYKiadjZ0H87hEJn4SJJUUHQz2MeSu98KCMOgKY+zAxa/QeUvg== X-Google-Smtp-Source: AGHT+IF63nBjHyps8aDJBkJi5wxUmEiDPZHsTtt+34gIIXxMv6Dli8J5sBqUQNqyDC9ZRaZLQZi9UA== X-Received: by 2002:a17:903:1790:b0:215:853d:38 with SMTP id d9443c01a7336-215bd200b3emr20291845ad.25.1733207520097; Mon, 02 Dec 2024 22:32:00 -0800 (PST) Original-Received: from smtpclient.apple ([2601:646:8f81:6120:d4a2:bdb3:ccbc:4058]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-215bba381a4sm6162425ad.248.2024.12.02.22.31.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Dec 2024 22:31:59 -0800 (PST) X-Mailer: Apple Mail (2.3776.700.51) Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=casouri@gmail.com; helo=mail-pl1-x632.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: 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:325967 Archived-At: 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=E2=80=99t get warning for them unless you = build a non-tree-sitter build of Emacs. So I=E2=80=99m prone to forgot = about them. Also it=E2=80=99s 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 want to ask because IIRC I proposed this a while back but there were = objections, the details of which I forgot. Yuan=