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: Fri, 6 Dec 2024 17:12:38 -0800 Message-ID: References: <2C0B7D3A-6131-4427-BF04-9211981B57DD@gmail.com> <867c8g3o6v.fsf@gnu.org> <0D278D91-4D67-4E0E-869F-6AF0A46678F7@gmail.com> <86h67jz36z.fsf@gnu.org> <502D58B8-9432-4A8F-B50D-ECA392B7E7C5@gmail.com> <86ser2y5e1.fsf@gnu.org> 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="20417"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Dec 07 02:13:37 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 1tJjO5-0005Ek-4P for ged-emacs-devel@m.gmane-mx.org; Sat, 07 Dec 2024 02:13:37 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tJjNQ-0005bZ-67; Fri, 06 Dec 2024 20:12:57 -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 1tJjNN-0005bL-Qh for emacs-devel@gnu.org; Fri, 06 Dec 2024 20:12:53 -0500 Original-Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tJjNM-00029E-Ek; Fri, 06 Dec 2024 20:12:53 -0500 Original-Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-215d92702feso22868985ad.1; Fri, 06 Dec 2024 17:12:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733533970; x=1734138770; 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=TfDjaMDIcqLik+DVQyl8HMkp+ASwfGp0FIIYX1mfErA=; b=F5CX2xT2XWuSZx4vedH6hTGJHBzbE/ovNY9gp2XNdIk9hrx1pRrGuqmGkEkBFJF2OG elEPQRj0vz2M2cx2QR0dBEhfsmhEKh6DRUnQiwxqWpgEX+2HuAI1APr9YYpJFnbrqHQM yGA/NumiyiqVuiwl0NsNoDwOMyp8A4+1nMrOH6wdAMl5Er3x2cMxNvmXfZDqjNkGVHWf P7fthBtnXJtZsM6FRwFRKarzdqAzap/rmE6z1l9G0BWNFYme4N8e3j+XhCGlFtLTc42n oxSwgXoP/jkvIT9eifPGl70EovftiW+d8IrPwI+wE2n4mGMiwOQzu+SNSPpyXv30a/2m EikQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733533970; x=1734138770; 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=TfDjaMDIcqLik+DVQyl8HMkp+ASwfGp0FIIYX1mfErA=; b=Ke4BPEGeOgixM9HSC1VW1t9t7Gz1TW/KjaTrcLyvJ4zIH92wQGlyPf7DUp/ZnqHLz6 SZCrOKEkXy1OZK9WPjCRMhayJW1vStr9MbwYhZfAp4gz73AZLSdSF7zRFev5ahZQ1TYw 9oIO1LjIZAOTrge3qSNq7F7rOy+ub35Uijdb2udibfJF5N9wSC+6vdkBOW6sQNDpQZYM wUbOIivTx5Z9ep8bQJzf3SP5jclA0CpoxrMHWH0QM7gJdos1IEOyEmyC7dz4XI7o+MQ5 MIR+jhtocY8sZe/KK/v4sdOwaFsUBJGx83HUPQ3lIZqF19+LgUwnXpqaxNpgqf8XTgKw 7jQw== X-Gm-Message-State: AOJu0Yxv+AWykQ9pfQhjzRdy+3o2xvF8WnLkbQE6qhHI31eZNz1jKK0j IPlEw7MlisOH4+ERCE9hatIN+FrhSKX3G5Ah/QBhbITy5QOlNHYo5OsCJA== X-Gm-Gg: ASbGncvdldnp30wWTvXYfeBc0YVRWVgIJUoYvaxr8/FK0B95jO6NBFuBD9gM3N0wpZK IlUHfXZJQ6tomrT1sPVKsKSHFFWjEVCjOFOyTdRec5ZaVfGVtaNAKf7LXwAhewwF9jEnfirx5NS sweGK9PdUgFteSMGyPOXX1pXQxON3IZZwovFaW4uLT24yhvYj828ik+jC8e3CA8XUM6awDuey+8 ejJ3S8sy5nSC0SeWq1u2PGZ2eaCw0nP1X3IE1K3FkgC368UqsYGio30S3bIdgNc5kVO/ykNfg== X-Google-Smtp-Source: AGHT+IEVdM6RDHgMAppZiymu8ZQmeh+gwRbDRAV9sWVCN9XKlGXiYZcr4zRvIUIGQkSb9Ls1AsNcRQ== X-Received: by 2002:a17:902:cf4b:b0:215:a2f2:cfbf with SMTP id d9443c01a7336-21614d35377mr67858945ad.18.1733533970234; Fri, 06 Dec 2024 17:12:50 -0800 (PST) Original-Received: from smtpclient.apple ([2601:646:8f81:6120:d59e:a328:96f3:f483]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-215f8f092d6sm34539495ad.197.2024.12.06.17.12.49 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Dec 2024 17:12:49 -0800 (PST) In-Reply-To: <86ser2y5e1.fsf@gnu.org> X-Mailer: Apple Mail (2.3776.700.51) Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=casouri@gmail.com; helo=mail-pl1-x631.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:326150 Archived-At: > On Dec 4, 2024, at 11:07=E2=80=AFPM, Eli Zaretskii = wrote: >=20 >> From: Yuan Fu >> Date: Wed, 4 Dec 2024 22:25:33 -0800 >> Cc: emacs-devel@gnu.org >>=20 >>>> If we use eval-when-compile, we don=E2=80=99t need to write = declare-function forms in c-ts-mode.el anymore, because treesit.el has = declare-function forms for all treesit.c functions. >>>=20 >>> That's what I don't understand: how will eval-when-compile which = loads >>> treesit.el be different from (require 'treesit) we already have in >>> c-ts-mode? Don't they both load treesit.el? >>=20 >> I maybe wrong here, but I thought if you don=E2=80=99t use = eval-when-compile, simply byte-compiling c-ts-mode.el wouldn=E2=80=99t = load treesit.el? >=20 > Yes, it would. You can clearly see this in a debugger if you put a > breakpoint in Fload and then byte-compile c-ts-mode.el. Does that mean declare-function forms only affect the file it=E2=80=99s = in? Because if treesit.el has declare-function forms for all the = treesit.c functions, and c-ts-mode.el requires treesit.el, why do we = need to have declare-function forms in c-ts-mode.el? Yuan=