From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Karl Fogel Newsgroups: gmane.emacs.devel Subject: Re: Question: loading code when two packages are load? Date: Wed, 08 Sep 2021 16:44:35 -0500 Message-ID: <87sfyeivy4.fsf@red-bean.com> References: Reply-To: Karl Fogel Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26008"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: "emacs-devel@gnu.org" To: Qiantan Hong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Sep 08 23:46:25 2021 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 1mO5Oi-0006Vz-DH for ged-emacs-devel@m.gmane-mx.org; Wed, 08 Sep 2021 23:46:24 +0200 Original-Received: from localhost ([::1]:48056 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mO5Og-0008PG-Nw for ged-emacs-devel@m.gmane-mx.org; Wed, 08 Sep 2021 17:46:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51164) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mO5N4-0007Xz-5I for emacs-devel@gnu.org; Wed, 08 Sep 2021 17:44:42 -0400 Original-Received: from sanpietro.red-bean.com ([45.79.25.59]:52998) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mO5N2-0006k4-B5 for emacs-devel@gnu.org; Wed, 08 Sep 2021 17:44:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=red-bean.com; s=202005newsp; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Message-ID:In-Reply-To:Date:Reply-To:References:Subject:Cc:To: From:Sender:Content-ID:Content-Description; bh=ikV3ULlC3n1ufXmMZHYu74zvFNqJ7yK2NeKsRNV2Ysk=; t=1631137478; x=1632347078; b=BkPy6FIHSljPz27+taqgNYjqBLnd55Ag9IEdFiOuNrqUgACZhe/zOp0c+o0EdkdFKr/Uz1j8pz7 zPyKU8BNtI7d7LOBl96Rv++eHBVDdayTq+dW0D47GwRmkuZJqDXHpmRRs7z/vo0c3agK9D6Dd+noQ IfDoy1OkCCF6Qi9UwVNI3loHbqbNCxWwxn8ompiz1sE96bitc4rNyoprbwjfDYwyN129qTX0EIf9N VCA+ZrAQ4EYfI3xV0DU+7hv/NUKg8cZmwueJYmgx/YBlwEU420qV/3olkQg/ya9fktFqhG3ZXK2XY 2GmECQ5+nuACnl7a++1XY+1epsD0450JvOJA==; Original-Received: from 99-112-125-163.lightspeed.cicril.sbcglobal.net ([99.112.125.163]:43398 helo=floss) by sanpietro.red-bean.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mO5My-00Ex8X-K6; Wed, 08 Sep 2021 21:44:36 +0000 In-Reply-To: (Qiantan Hong's message of "Wed, 8 Sep 2021 16:06:37 +0000") Received-SPF: pass client-ip=45.79.25.59; envelope-from=kfogel@red-bean.com; helo=sanpietro.red-bean.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, SPF_HELO_PASS=-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.23 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" Xref: news.gmane.io gmane.emacs.devel:274397 Archived-At: On 08 Sep 2021, Qiantan Hong wrote: >I=E2=80=99ve been working on the integration of crdt.el with a few other=20 >packages (xscheme.el, comint.el). >Those code only make sense when both crdt.el and the =E2=80=9Cclient=E2=80= =9D=20 >package are loaded. > >Is there a way to lazy load those code? > >Currently I (require *client-package*) in crdt.el but that causes=20 >all client package to be loaded >when crdt.el is loaded. >Or I could remove the require but then that leaves bunch of free=20 >variable warnings >(because client package haven=E2=80=99t been loaded) and bunch of command= =20 >that is >invokable but not usable. Would the "autoload" facility solve this problem? See the section "Autoload" in the Elisp manual: https://www.gnu.org/software/emacs/manual/html_node/elisp/Autoload.html#Aut= oload and this introduction: https://www.gnu.org/software/emacs/manual/html_node/eintr/Autoload.html Best regards, -Karl