zsh-users
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: Peter Stephenson <Peter.Stephenson@csr.com>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: possibly useful zsh_directory_name implementation
Date: Fri, 11 Mar 2011 18:09:57 +0100	[thread overview]
Message-ID: <AANLkTikvpOu6KZADcxBEPiiGPhpNMP6shVFBd0bocXaJ@mail.gmail.com> (raw)
In-Reply-To: <20110311163325.2bc05b6b@pwslap01u.europe.root.pri>

On 11 March 2011 17:33, Peter Stephenson <Peter.Stephenson@csr.com> wrote:
> On Fri, 11 Mar 2011 16:25:14 +0000
> Peter Stephenson <Peter.Stephenson@csr.com> wrote:
>> +local func
>> +
>> +if [[ -n $functions[zsh_directory_name] || \
>> +  ${+zsh_directory_name_functions} -ne 0 ]] ; then
>> +  zsh_directory_name c && return 0
>> +  for func in $zsh_directory_name_functions; do
>> +    $func c && return 0
>> +  done
>> +  return 1
>
> Instantly after sending this, I realised it should try all functions and
> return status 0 or 1 based on whether any were successful.  I've
> submitted it in that form.

Can you really just call a bunch of completions in series and get a
useful result? The documentation still seems to imply running will
stop as soon as one hook returns 0 status.

More importantly, shouldn't you only run zsh_directory_name if that
function exists? As it is now, it will be run even if only the array
is defined. Also, why the mix of -n $foo and ${+foo}?

% ls ~[<tab>_dynamic_directory_name:8: command not found: zsh_directory_name

-- 
Mikael Magnusson


  reply	other threads:[~2011-03-11 17:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-11  1:06 Mikael Magnusson
2011-03-11  1:15 ` Mikael Magnusson
2011-03-11 10:44 ` Peter Stephenson
2011-03-11 12:06   ` Mikael Magnusson
2011-03-11 12:17     ` Peter Stephenson
2011-03-11 12:32       ` Mikael Magnusson
2011-03-11 16:25   ` Peter Stephenson
2011-03-11 16:33     ` Peter Stephenson
2011-03-11 17:09       ` Mikael Magnusson [this message]
2011-03-11 18:24         ` Peter Stephenson
2011-03-11 17:44 ` Jérémie Roquet

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=AANLkTikvpOu6KZADcxBEPiiGPhpNMP6shVFBd0bocXaJ@mail.gmail.com \
    --to=mikachu@gmail.com \
    --cc=Peter.Stephenson@csr.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).