Zsh Mailing List Archive
Messages sorted by:
Re: Re-loading files loaded via "autoload"
- X-seq: zsh-users 26913
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Zach Riggle <zachriggle@xxxxxxxxx>
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: Re-loading files loaded via "autoload"
- Date: Wed, 11 Aug 2021 20:25:25 +0200
- Archived-at: <https://zsh.org/users/26913>
- In-reply-to: <CAMP9c5kjuw4sxS0ZsCTN_Vkd=4SZNhx8Vg3UCcoNPi-Y9TK3Rg@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- References: <CAMP9c5kjuw4sxS0ZsCTN_Vkd=4SZNhx8Vg3UCcoNPi-Y9TK3Rg@mail.gmail.com>
On 8/11/21, Zach Riggle <zachriggle@xxxxxxxxx> wrote:
> Hello all!
> 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.
> It appears this is possible, but not well documented.
> Specifically, "unfunction" or "unset -f" work to permit the "autoload
> foo" to run again, and re-define the various functions declared in the
> What's the appropriate venue to ask for documentation updates, since
> this should likely be in the documentation for .
> # Homework
> I looked at the documentation page for autoloading functions  as
> well as the page for the autoload builtin itself .
> As always, SEARCHING the man page / info page / HTML pages are
> difficult, because it's not possible to scope the search results to
> "just this section here" so searching for "remove" or "reload" shows
> lots of unrelated hits.
> Because "autoload" has its own page, the behavior of unfunction /
> unset -f should probably be documented there.
> : https://zsh.sourceforge.io/Doc/Release/Functions.html#Functions
> : https://zsh.sourceforge.io/Doc/Release/Shell-Builtin-Commands.html
> Zach Riggle
It is implied in some places that you can do this, but perhaps it is
worth mentioning explicitly somewhere?
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
but which loads its own definition by searching fpath, by using
within a shell function. For example, the following are equivalent:
unfunction myfunc # if myfunc was defined
But then this introductory paragraph for the autoload builtin:
If name consists of an absolute path, the function is
defined to load
from the file given (searching as usual for dump
files in the given
location). The name of the function is the basename
makes no mention of the fact that this is not true if 'name' is
already a defined function, and it also doesn't seem to mention it in
any of the subsequent paragraphs.
Messages sorted by: