zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Mikael Magnusson <mikachu@gmail.com>
Cc: Zach Riggle <zachriggle@gmail.com>, Zsh Users <zsh-users@zsh.org>
Subject: Re: Re-loading files loaded via "autoload"
Date: Wed, 11 Aug 2021 11:56:51 -0700	[thread overview]
Message-ID: <CAH+w=7ZKGgJc2Rn_QMw=r2xOgCHG6fHy9xRm=t9fg-OpPzokLA@mail.gmail.com> (raw)
In-Reply-To: <CAHYJk3SUHp9f_mb1WAa0yB6bXFhm4H0_MvV-2yYo=6or0kMgEg@mail.gmail.com>

On Wed, Aug 11, 2021 at 11:25 AM Mikael Magnusson <mikachu@gmail.com> wrote:
>
> On 8/11/21, Zach Riggle <zachriggle@gmail.com> wrote:
> >
> > Thanks in advance for my spam.  I recently spent some time spelunking
> > in the Zsh docs for how to get an "autoload"ed module (sorry if the
> > terminology is incorrect) to be re-loaded.

A "module" usually refers to a binary object managed by "zmodload".
There really isn't a consistent shorthand terminology for an
"autoload" function that happens to define multiple helpers in its
source file.

> It is implied in some places that you can do this, but perhaps it is
> worth mentioning explicitly somewhere?

Given that we have an entire section dedicated to "Autoloading
functions" it would seem reasonable to mention it there.

> eg, we have this, which mentions it in a comment of the example code:
>        It is also possible to create a function that is not  marked
> as  autoloaded,
>        but which loads its own definition by searching fpath, by using
> `autoload -X'
>        within a shell function.  For example, the following are equivalent:

Those are no longer entirely equivalent, for one thing as you noted
about loading from absolute paths.  There's no way to attach this
metadata to the function definition when wrapping up an "autoload -X"
command yourself.  Some update of that example is probably worthwhile.
(This shortcoming does not apply to "autoload +X" as far as I know.)


  reply	other threads:[~2021-08-11 18:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-11  7:49 Zach Riggle
2021-08-11 18:25 ` Mikael Magnusson
2021-08-11 18:56   ` Bart Schaefer [this message]
2021-08-12 16:04   ` Philippe Troin
2021-08-13  2:29     ` Mikael Magnusson

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='CAH+w=7ZKGgJc2Rn_QMw=r2xOgCHG6fHy9xRm=t9fg-OpPzokLA@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=mikachu@gmail.com \
    --cc=zachriggle@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).