From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3995 invoked by alias); 11 Mar 2011 12:17:14 -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: 15862 Received: (qmail 2398 invoked from network); 11 Mar 2011 12:17:11 -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.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at csr.com does not designate permitted sender hosts) Date: Fri, 11 Mar 2011 12:17:03 +0000 From: Peter Stephenson To: Zsh Users Subject: Re: possibly useful zsh_directory_name implementation Message-ID: <20110311121703.16795372@pwslap01u.europe.root.pri> In-Reply-To: References: <20110311104402.6a411b10@pwslap01u.europe.root.pri> Organization: Cambridge Silicon Radio X-Mailer: Claws Mail 3.7.8 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.103.11.49] X-Scanned-By: MailControl A_10_80_00 (www.mailcontrol.com) on 10.71.0.131 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. -- Peter Stephenson Software Engineer Tel: +44 (0)1223 692070 Cambridge Silicon Radio Limited Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom