Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATH: autoload with explicit path

On Fri, Jan 27, 2017, at 10:44 AM, Peter Stephenson wrote:
> On Fri, 27 Jan 2017 10:40:15 -0800
> Sebastian Gniazdowski <psprint2@xxxxxxxxxxxx> wrote:
> > Internally via autoload it will be easy to create custom versions of
> > multiple functions. For example calendar does:
> > 
> > autoload -Uz calendar_{add,parse,read,scandate,show,lockfiles}
> > 
> > With the requested feature
> I'm still not clear if your "requested feature" is what I'm talking
> about or not, i.e. what you can do already with $funcsourcetrace.

We talk about the same thing, though I want to remove requirement of
using absolute paths in any function files. You wrote:

> # definition of fun1
> autoload -Uz <what-goes-here?>/fun2
> fun2

The point is to make <what-goes-here> not needed at all. The path is to
be taken from "dircache" (that's the name used in previous messages).
Autoload should use dircache of fun1 to find fun2, then follow to
process fpath. There can be an option to enable/disable this.

I've described how flexible and clean would be management of custom
version of functions this way. It's like having packages of software
instead of functions. Requiring the <what-goes-here> part will make this

> > Sounds nice, though it's nice that current implementation of the
> > absolute-path feature uses pointers to paths to limit memory usage, a
> > new parameter would probably spend that.
> The new parameter would only look up the internal information when you
> refer to it, there's nothing permanent additional to be stored.

Thought about it, it's a cool approach.

Sebastian Gniazdowski

Messages sorted by: Reverse Date, Date, Thread, Author