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

Re: Dynamic directory name function

On Sep 22,  8:42pm, Peter Stephenson wrote:
} Subject: Dynamic directory name function
} For almost as long I've been meaning to turn this into a generic
} function that you can configure just with a few variables.  I've finally
} done that, and this has allowed me to add the completion support that
} was missing before.

I have one immediate suggestion:  Use zstyle instead of variables.  Look
them up in the context of the wrapper function name (with some prefix to
disambiguate from other zstyle uses).  Remember that there's nothing in
the zstyle builtin that requires you to use colon-separated context names
or wildcards.

Places where you currently use e.g.  _zdn_assoc=(${(Pkv)_zdn_var}) become

    zstyle -a ZDN_${0} zdn_var _zdn_assoc

or the like; it becomes possible to define multiple wrapper functions if
for some reason that's useful.


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