From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Kaushal Modi Newsgroups: gmane.emacs.help Subject: Re: Basic question about autoload function Date: Wed, 06 Dec 2017 19:14:33 +0000 Message-ID: References: <8199d375-ba83-44b0-b30f-5503fab7f4cf@default> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1512587710 24969 195.159.176.226 (6 Dec 2017 19:15:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 6 Dec 2017 19:15:10 +0000 (UTC) Cc: Help Gnu Emacs mailing list To: Drew Adams Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Dec 06 20:15:07 2017 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eMf9t-0006Mw-M9 for geh-help-gnu-emacs@m.gmane.org; Wed, 06 Dec 2017 20:15:05 +0100 Original-Received: from localhost ([::1]:57128 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eMf9z-0005sJ-HY for geh-help-gnu-emacs@m.gmane.org; Wed, 06 Dec 2017 14:15:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47429) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eMf9Z-0005qf-Jq for help-gnu-emacs@gnu.org; Wed, 06 Dec 2017 14:14:46 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eMf9Y-0005zV-Hr for help-gnu-emacs@gnu.org; Wed, 06 Dec 2017 14:14:45 -0500 Original-Received: from mail-yw0-x232.google.com ([2607:f8b0:4002:c05::232]:44136) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eMf9Y-0005yX-Bf for help-gnu-emacs@gnu.org; Wed, 06 Dec 2017 14:14:44 -0500 Original-Received: by mail-yw0-x232.google.com with SMTP id m129so1978907ywb.11 for ; Wed, 06 Dec 2017 11:14:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LcHibGzsVqrfkvGclBXgh10vMsFkkhwSbXaC3iyXBss=; b=q+wrwcDks4eK4TS/dzOrxyuIxhla3/xqEWj0s70M+xXfCnx6Gu4kb3oPRAEsoEVpDl Y1D1ZrZG70y297LZt9X+4m04CldKf6MxaGfDviV0jCvz3O3rQs4gVQSKaXrPWbdu+7VJ FhA1pLiOe5Pi1k2X1+qeDDvzF6xfztoDeUt807XKd2R5zAHNmmQqN0hSJH5P4fmo5Kia F7hcmpSsJa26KNF8heDXIcKBko6xujpfI196DTTqhH9GkNSLnONOhUAtb3+V3MwW+uGc r4gaxe4EcdYMg2y2d58fU05D7iuCQWx570dK9ea/LgcE3TwyjcfjLO9B9eB6TYnqD08f h/Bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=LcHibGzsVqrfkvGclBXgh10vMsFkkhwSbXaC3iyXBss=; b=gSP2E5+8pXb9tsY1NgtjxdlR04NMyfgcwI/XjqxCoR8afpExUDqGeNhcSgTfsZn+U4 gys60r1lxOS79vfb5HKr8QV9JvoU/5vE2AP4NIwPCfnkZNH4oLDIz3GVlHTKyrAFJAGH PMJGNCaRaZ941ffYlp2wBZurCEcvMbmGKSO5tDJtj/EW+U9hXu4xUEylmvVPJ89Qj3tB oqYk5SKdGf6sho9kocQwTKGHtwDOVrsKETe/X76llbJ9RsB/CGy5mthuON1A9TMepsmo KdSNXOrNA/7Ag1GVhdEB9G+HW8yH6UyLuRTnCaMIuCIGTdwKwwrgPW7QCgOZA1QXUmM2 RoAw== X-Gm-Message-State: AJaThX6XRwgkg80dMfqVChaJeVq5mu49K5U0oOuDTkr2rTRrKFEuWUgx +K9jvSoI9hzVVVjLZZwQHSTJCN3qE+K3SrnYOsU= X-Google-Smtp-Source: AGs4zMaWsx3WDa04VMkjviXsoV0EYyscuDgqMsyxZLKqXDsenEUl+4rsvSUUiIe9nS37IrCVgKnh06CZ07p+aPkthLw= X-Received: by 10.13.241.69 with SMTP id a66mr16261830ywf.427.1512587683659; Wed, 06 Dec 2017 11:14:43 -0800 (PST) In-Reply-To: <8199d375-ba83-44b0-b30f-5503fab7f4cf@default> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4002:c05::232 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:115271 Archived-At: On Wed, Dec 6, 2017 at 2:04 PM Drew Adams wrote: > > I have recently realized that (autoload #'foo-fn "bar-pkg") > > works even if foo-fn is *not* defined inside bar-pkg. > > What do you mean by "works"? > By "works", I meant that bar-pkg got loaded when I called foo-fn. Sorry, I myself hate the "works" and "does not work" phrases and I ended up using those. All that does is cause file bar-pkg.el[c] to be loaded > whenever someone or something tries to invoke/use function, > macro, or keymap `foo-fn'. (But it does nothing if `foo-fn' > is a function already defined.) > > Yes, nothing implies that `foo-fn' is defined in bar-pkg.el. > Thanks. > The documentation also doesn't say that it has to be that way. > > What doesn't have to be what way? > I meant to say that the documentation does not imply that the FUNCTION has to be defined inside FILE. I was wondering if that was intentional i.e. FUNCTION can or cannot be defined inside FILE. > So I was just pleasantly surprised that that did the right thing. > > The right thing being ___? I guess you wanted Emacs to > load that file when that function is invoked? > Yes, bar-pkg got loaded even when I called foo-fn (where foo-fn was defined outside bar-pkg).. no errors, nothing.. it just worked as I thought. -- Kaushal Modi