zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh Users <zsh-users@zsh.org>
Subject: Re: Dynamic directory name function
Date: Tue, 22 Sep 2015 21:07:56 -0700	[thread overview]
Message-ID: <150922210756.ZM30253@torch.brasslantern.com> (raw)
In-Reply-To: <20150922204251.05f3d291@ntlworld.com>

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.

Thoughts?


  reply	other threads:[~2015-09-23  4:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-22 19:42 Peter Stephenson
2015-09-23  4:07 ` Bart Schaefer [this message]
2015-09-23  8:48   ` Peter Stephenson
2015-09-23  9:55     ` Peter Stephenson
2015-09-24  6:10     ` Bart Schaefer
2015-09-24  8:37       ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=150922210756.ZM30253@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).