From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2315 invoked by alias); 11 Mar 2011 12:32:42 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 15863 Received: (qmail 2206 invoked from network); 11 Mar 2011 12:32:40 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.212.43 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=S/oqVzkA/JFXLXWUO+uKVk9tolalUekjlDTVcRDFL60=; b=sQJD+QRDz8gFeQG9EQ4cYw1PsENFRqbUEm/pxRI1MFlw4FAuEifJbOtqAsWqueM6ot kxmr2vxv7sttsqa5Gpr9c0nsS5hfecvmS9zhatqSG1OkY2Kw9ir16mulgslVTBxatdJ/ 8lqvCmGrCIWXQIr/sD33iRDXxIbHnvqMd5MTw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=Puog2yTbqsPI3pJWzk0Pkb4xwEmY3XAcp0ropwZnxKkZlsHBzaE4xIKLJxW73116KG MV2tqiwFh+yFD+jA/3TkjAsOhXKA787sYtrEDpBoOpju2b8MnzUTTZgLSO1WAO51QGFV rNgCPne6OXXJ9gu7XALhImV+ptfAlF7E/Vtb8= MIME-Version: 1.0 In-Reply-To: <20110311121703.16795372@pwslap01u.europe.root.pri> References: <20110311104402.6a411b10@pwslap01u.europe.root.pri> <20110311121703.16795372@pwslap01u.europe.root.pri> Date: Fri, 11 Mar 2011 13:32:35 +0100 Message-ID: Subject: Re: possibly useful zsh_directory_name implementation From: Mikael Magnusson To: Peter Stephenson Cc: Zsh Users Content-Type: text/plain; charset=UTF-8 On 11 March 2011 13:17, Peter Stephenson wrote: > On Fri, 11 Mar 2011 13:06:13 +0100 > Mikael Magnusson wrote: >> If you don't have a prefix, how do you specify which of the functions >> should handle the argument? > > I'm not sure I understand the question, but the way it would is each > hook function is passed the same arguments in turn. If it's not in a > form it recognises, it returns a non-zero status. This continues until > one function handles the argument and returns a zero status. So each > function just looks at the pattern it's got and sees if it thinks it > makes sense to handle it. That requires a minimal amount of cooperation > but in the name -> directory direction it's simply a question of failing > gracefully with unmatched names. In the other direction there's more of > an ordering problem --- do you want the name to pop up as a relative > directory like '.dir', or using some kind of absolute naming scheme? > But that's up to the user's preference. Okay, I completely misinterpreted one of your sentences, it makes complete sense now. I thought you meant the . and / in _my_ function wouldn't be needed, somehow. Clearly that referred to the other functions. ("the function here would interact nicely with other functions that implemented naming without the "/" or "." at the start.") -- Mikael Magnusson