From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 958 invoked by alias); 11 Mar 2011 12:06:22 -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: 15861 Received: (qmail 24689 invoked from network); 11 Mar 2011 12:06:20 -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.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.220.171 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=mKXpW3xfpowaxNrswy+As5f/nhAVy5YPPxW0aFdpMgU=; b=ZUvI9VC3dR/K2IL7/ts609OjBIYrwJsps2P7FeDsWjpi4aRM3wrDr/DvBLjuZUxzdX Rd5QeBmeS//NmKaGcRxXttLTa77DGL/5ovwyX+Tbc9FSozazvSDRktUzXLwuPfcXzvtm DNseZPyJ8AjvySnf7LQ9Z5/R1jl9xPrMLFOks= 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=wA/EkJQidShT8+TOBWbKF/RSPGBZr1B6tLBdB18yZnPwbrH8MHZKsMRWm5yikagG2z YA8OZ7jIV2FhA8GuEZ4zlwkKINhMLgbDfq8Hup2LVrLhr+pdwBNrghHcSyHdPS/jN6T3 6EK4OoU7bPNF3upAb1/yXGeNmlYUA0bJOUW+I= MIME-Version: 1.0 In-Reply-To: <20110311104402.6a411b10@pwslap01u.europe.root.pri> References: <20110311104402.6a411b10@pwslap01u.europe.root.pri> Date: Fri, 11 Mar 2011 13:06:13 +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 11:44, Peter Stephenson wrote: > On Fri, 11 Mar 2011 02:06:45 +0100 > Mikael Magnusson wrote: >> function zsh_directory_name () { >>... >> } >> >> With this, /home/mikachu/some/directory/somewhere% cd ~[/some], will >> take you to /home/mikachu/some/, and cd ~[.foo] will take you to foo/ >> in whatever parent directory has a subdirectory foo, for example it >> could be /home/foo/. > > I've been meaning to add a zsh_directory_name hook, so you can have > multiple functions implementing this and the function here would > interact nicely with other functions that implemented naming without the > "/" or "." at the start. However, I need to think about the > consequences --- it's more complicated than the existing hooks. If you don't have a prefix, how do you specify which of the functions should handle the argument? -- Mikael Magnusson