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

Re: Compinit tries a filename once



On Jan 27,  4:43pm, Peter Stephenson wrote:
}
} The points I'm trying to make are (i) <somehow> needs to be the same
} in both cases for consistency (ii) in normal operation, the autoload
} has a very simple, builtin rule for <somehow>, deep down inside the
} shell --- grab the first file you see --- so compinit needs to do the
} same (iii) if you want to do better, you need to arrange for some
} more programmable form of <somehow> to be shared by the two.

For Sebastian's purposes the most interesting bit is the handling of
the #compdef or #autoload token as the first word in the file.  What
he actually wants to do, I think, is invoke just that part of compinit
on an arbitrary new set of function source files discovered at plugin
load time, which may be after "compinit" has been run.

"compdef" itself is already defined separately as a function (in the
course of executing "compinit"), but the #token parsing is part of the
body of compinit and evaporates when compinit unfunctions itself at the
end.

This has now become a zsh-workers-level topic and should move to a new
thread over there.



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