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: Re: Use (eval-when-compile 'treesit) to save us from writing declare-function forms Date: Wed, 4 Dec 2024 10:21:13 -0800 Message-ID: <56812B4F-EDF3-4B07-AEF5-C86B2A0764CB@gmail.com> References: <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="27824"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Emacs Devel To: Andrea Corallo Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Dec 04 19:21:47 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 1tIu0R-000741-DX for ged-emacs-devel@m.gmane-mx.org; Wed, 04 Dec 2024 19:21:47 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tIu0A-00014p-TV; Wed, 04 Dec 2024 13:21:31 -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 1tIu08-00014F-MN for emacs-devel@gnu.org; Wed, 04 Dec 2024 13:21:28 -0500 Original-Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tIu07-0000hs-93; Wed, 04 Dec 2024 13:21:28 -0500 Original-Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-215e194b65aso395175ad.1; Wed, 04 Dec 2024 10:21:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733336485; x=1733941285; darn=gnu.org; 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=W4tNHvK9uDwH8vm4+JQJXTvNnGtnHy32TEByVICldm8=; b=Kzb5qnlqsA1qsqsyxImxHJEH+ZW1NO4Cw+AhwT5wHYunBQUGEFHl+Z77siWEJxHf+n tP7uZ0+sQZsA7Y03crw3OUroJU68hkTh7F6o1rr+hWJYe5k7NMUnVnDtH/r/fzJtVNle ZJxmziiVqMMwKojXCwVKf6PW2CFs7PZ3wTOQWaFeuHmcsGCTM6I9lxF7N7sFLv0wsNx6 pOdV852+lr9W1MoBCBN+Ly4swIypvtAz+DDWy2tedh17aC0boge69H5gOZ6MuGRwpa+m 84A020TDAdM796eO7Amb2atnFTicUBLcRChGNIVrjdwxwZACL07YBg+4go66cgnxtnNw bxEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733336485; x=1733941285; 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=W4tNHvK9uDwH8vm4+JQJXTvNnGtnHy32TEByVICldm8=; b=GhKbVKGqjfNfE1MDOMCF4sRlmrW6Mp3N6nOEQs056ll7XZNLchwqT2dWkxkZTawLdc ANuaBCNmp6r5QtndVMmMSi04HRTXFBSUU61UpTow6D2oX/qgMRNSMJ1LpiDNSdxxkK8s VZOlDdSp1m3IYE3mI4mGn055YkeE5FOkGgt97Q31fzxu9AZZfYHO9PEUwEjYLD8kkqMP rpkEEvsf8vHhGlE2VZaP1Qpd45JkaOicdMKAM6I8hMg/lWcXqZDB8PV8sWT0Kjo6CNkm gHlkzwKCbbSZ7RsqZveTJVbtpwMSYcDx4dmYs29YODVrUFpvAaTRhyQwwSMNe6p5Umw9 Wp4g== X-Gm-Message-State: AOJu0Yx/0C5DGfvwSHACxy8rCYkbxaNsixi5x+8iPgURBFrxsVAJCNzw U04Txx4dCKoPkXobydP5oRfeO7v8uPsR1fj69tPylcm/Bf+cjSGQCCAdXg== X-Gm-Gg: ASbGncuBsqBZbE9HIWgvFYgburlOc7Arwe9n7PanQIco/Wu1Ch7rIVzEuuFNa4f6/Io TlYitsAI9s1YSGb7fWFogse1OtxdJMP/PxvjpEaqLSsTN+smTF8X8rYWBTZm3aM63Hh398t4Coc GlqDkUQzZPi8/Pl56GRlGYnFh67VzMdJpyUuf5ck5cU+rJElUJz7iKh7i7wQX4WSZ21AIuALugd AFAKNoxdBE1GjDK8dcVp5TLD+uKKsSit5gtncu/1hlPy6ujU/gFj8Dz9MHTW/S3FgT5pnwXpw== X-Google-Smtp-Source: AGHT+IHSSaQyxk17lzJ2etgu1fWER3oTnG3qrItVpnCDxDZNPMHvzPJ4YkM822tiqygMPd4gTS1hNg== X-Received: by 2002:a17:902:d4cd:b0:215:a3fb:b4d6 with SMTP id d9443c01a7336-215bd1b46d1mr91284215ad.8.1733336485049; Wed, 04 Dec 2024 10:21:25 -0800 (PST) Original-Received: from smtpclient.apple ([2601:646:8f81:6120:d4a2:bdb3:ccbc:4058]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2154764f312sm93807155ad.102.2024.12.04.10.21.24 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Dec 2024 10:21:24 -0800 (PST) In-Reply-To: X-Mailer: Apple Mail (2.3776.700.51) Received-SPF: pass client-ip=2607:f8b0:4864:20::62e; envelope-from=casouri@gmail.com; helo=mail-pl1-x62e.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:326047 Archived-At: > On Dec 3, 2024, at 12:30=E2=80=AFAM, Andrea Corallo = wrote: >=20 > Yuan Fu writes: >=20 >> 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. >>=20 >> 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? >>=20 >> I want to ask because IIRC I proposed this a while back but there = were objections, the details of which I forgot. >>=20 >> Yuan >=20 > Hi Yuan, >=20 > I was not part of the discussion and I don't know what's the downside = of > (eval-when-compile 'treesit), maybe another alternative would be to = have > like a dedicated treesit-delcs.el to require where necessary? >=20 That=E2=80=99ll be ok too. Though 99.99% the case, if some package uses = tree-sitter, they=E2=80=99d need something in treesit.el too. Yuan=