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

Re: Dynamic directory name function

On Tue, 22 Sep 2015 21:07:56 -0700
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> 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.

I did think about that.  But having written the wrapper function, with
the variables the way they are, everything immediately fell out neatly
and clearly with associative arrays having a natural meaning.  zstyle
would just obscure the way the hierarchy was linked for no real gain ---
quite possibly to the point where I couldn't remember how to do it even
myself and wouldn't actually use it, in which case the whole thing would
be a waste of time.  (I can never remember how the more complicated
styles work in completion.)

But maybe you can come up with an example of how you'd set styles that
shows it working neatly and obviously.


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