zsh-workers
 help / color / mirror / code / Atom feed
From: "Mikael Magnusson" <mikachu@gmail.com>
To: "Peter Stephenson" <pws@csr.com>
Cc: "Zsh hackers list" <zsh-workers@sunsite.dk>
Subject: Re: PATCH: dynamic named directories
Date: Thu, 25 Sep 2008 16:46:55 +0200	[thread overview]
Message-ID: <237967ef0809250746n1d25d9b4ybc8101505a8f8c00@mail.gmail.com> (raw)
In-Reply-To: <15726.1222353125@csr.com>

I'll proof read the docs a bit (ie i'll read them, i can't read without
proof reading anyway) *does that*, okay, only one comment.

2008/9/25 Peter Stephenson <pws@csr.com>:
> Problem: six feet deep in WiFi and UWB bugs to fix.  Solution:  do
> something else entirely.
>
> This morning I had a brainwave/brainstorm that turned out to be easy to
> implement and test without interfering with the rest of the shell, which
> is the sort of feature I like.  I'm sure you'll tell me if it's a stupid
> idea.
>
> It's based on the way I use an Emacs function suite called "bufname"
> that a colleague and I wrote a few years ago.  I have lots of parallel
> directory hierarchies with slightly different names at different levels,
> so normal static directory naming isn't really flexible enough.
>
> Now you can use ~[<stuff>] and <stuff> gets passed down to a function
> zsh_directory_name, which either parses it and picks an appropriate
> directory or refuses.  (If the function isn't defined this syntax is
> treated the way it always was, which typically wasn't all that useful.)
> There's also a mechanism for going the other way.  See documentation and
> examples.
>
> Much of the patch is actually another simplification to doshfunc() which
> was obvious when I worked out what the third argument was for.  It
> should mean any PM_* flags applicable to functions (such as PM_TAGGED)
> are handled more consistently.
>
> Index: Doc/Zsh/expn.yo
> ===================================================================
> RCS file: /cvsroot/zsh/zsh/Doc/Zsh/expn.yo,v
> retrieving revision 1.91
> diff -u -r1.91 expn.yo
> --- Doc/Zsh/expn.yo     16 Jun 2008 16:39:18 -0000      1.91
> +++ Doc/Zsh/expn.yo     25 Sep 2008 12:39:43 -0000
> @@ -1308,8 +1308,73 @@
>  option exchanges the effects of `tt(~PLUS())' and `tt(~-)' where they are
>  followed by a number.
>
> -cindex(directories, named)
> -cindex(named directories)
> +subsect(Dynamic named directories)
> +cindex(directories, named, dynamic)
> +cindex(named directories, dynamicic)
> +cindex(dynamic named directories)
> +
> +The feature described here is only available if the shell function
> +tt(zsh_directory_name) exists.
> +
> +A `tt(~)' followed by a string var(namstr) in unquoted square brackets is
> +treated specially as a dynamic directory name.  Note that the first
> +unquoted closing square bracket always terminates var(namstr).  The shell
> +function is passed two arguments: the string tt(n) (for name) and
> +var(namstr).  It should either set the array tt(reply) to a single element
> +which is the directory corresponding to the name and return status zero
> +(executing an assignment as the last statement is usually sufficient), or
> +it should return status non-zero.  In the former case the element of reply

the what element of reply? i guess the first?

-- 
Mikael Magnusson


  reply	other threads:[~2008-09-25 14:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-25 14:32 Peter Stephenson
2008-09-25 14:46 ` Mikael Magnusson [this message]
2008-09-25 14:50   ` Peter Stephenson
2008-09-25 15:51 ` Bart Schaefer
2008-09-25 16:05   ` Peter Stephenson
2008-09-27  5:54     ` Bart Schaefer
2008-09-26 12:52 ` Mikael Magnusson
2008-09-26 12:56   ` Mikael Magnusson
2008-09-27 19:42     ` 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=237967ef0809250746n1d25d9b4ybc8101505a8f8c00@mail.gmail.com \
    --to=mikachu@gmail.com \
    --cc=pws@csr.com \
    --cc=zsh-workers@sunsite.dk \
    /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).