zsh-users
 help / color / mirror / code / Atom feed
From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
To: zsh-users@zsh.org
Subject: Autoload vs regular function
Date: Fri, 18 Sep 2015 08:34:56 +0200	[thread overview]
Message-ID: <CAKc7PVBmBypgTYyObW83a5864dNgK4EO2mdS0aOyOpPyRkL4EA@mail.gmail.com> (raw)

Hello,
I tried to do the following on my series of autoload functions (their
names begins with "n-" prefix):

#!/bin/zsh

local PLUGIN_FILE="znt.plugin.zsh"
rm -f "$PLUGIN_FILE"

for i in n-*; do
    echo "$i() {" >>"$PLUGIN_FILE"
    cat "$i" >>"$PLUGIN_FILE"
    echo "}" >>"$PLUGIN_FILE"
    echo >>"$PLUGIN_FILE"
done

to have plugin for the various current frameworks. In result the code
gives file with series of functions. The technique seems to work, but
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?

Best regards,
Sebastian Gniazdowski


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

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-18  6:34 Sebastian Gniazdowski [this message]
2015-09-18 17:15 ` Bart Schaefer
2015-09-18 18:45   ` Ray Andrews
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=CAKc7PVBmBypgTYyObW83a5864dNgK4EO2mdS0aOyOpPyRkL4EA@mail.gmail.com \
    --to=sgniazdowski@gmail.com \
    --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).