zsh-users
 help / color / mirror / code / Atom feed
From: Ray Andrews <rayandrews@eastlink.ca>
To: zsh-users@zsh.org
Subject: Re: Autoload vs regular function
Date: Fri, 18 Sep 2015 11:45:28 -0700	[thread overview]
Message-ID: <55FC5BC8.4040107@eastlink.ca> (raw)
In-Reply-To: <150918101506.ZM26893@torch.brasslantern.com>

On 09/18/2015 10:15 AM, Bart Schaefer wrote:
> On Sep 18,  8:34am, Sebastian Gniazdowski wrote:
> }
> } are there any pitfalls about functions declared in this way instead of
> } using autoload and separate files? Is this enough to have plugin for
> } e.g. antigen?
>
> There aren't any pitfalls to this, except that the file has to be
> sourced (i.e., all the functions fully defined in shell memory) unless
> there is a single entry-point function whose name can be the same as
> the basename of the file, and thereby trigger loading the whole thing.
>
> E.g. the _git file that handles completion for all the git subcommands
> has a whole slew of helper functions, none of which are loaded until
> an attempt to complete for "git" is done, at which time the _git entry
> point function loads all of them.
Can you rough in an example of that for us Bart?  Sounds like an elegant 
idea.  I wonder
if it is possible that when one types a command that is not found, it 
could trigger
a sort of search in some directory for a script that would itself source 
the very command
not found and then run it?  Sorta a reinvention of autoload but maybe more
transparent.

>


  reply	other threads:[~2015-09-18 18:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-18  6:34 Sebastian Gniazdowski
2015-09-18 17:15 ` Bart Schaefer
2015-09-18 18:45   ` Ray Andrews [this message]
2015-09-18 21:53     ` Bart Schaefer
2015-09-19 16:23       ` simple question regarding local variables Ray Andrews
2015-09-19 16:32         ` Bart Schaefer
2015-09-19 18:21           ` Ray Andrews

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55FC5BC8.4040107@eastlink.ca \
    --to=rayandrews@eastlink.ca \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).