From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: zsh-workers-request@euclid.skiles.gatech.edu Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by coral.primenet.com.au (8.7.5/8.7.3) with ESMTP id WAA23032 for ; Tue, 15 Oct 1996 22:53:03 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id IAA19360; Tue, 15 Oct 1996 08:47:15 -0400 (EDT) Resent-Date: Tue, 15 Oct 1996 08:47:15 -0400 (EDT) Message-Id: <199610151245.OAA20575@hydra.ifh.de> X-Authentication-Warning: hydra.ifh.de: Host pws@localhost didn't use HELO protocol To: zsh-workers@math.gatech.edu (Zsh hackers list) Subject: Re: pushd In-reply-to: ""Bart Schaefer""'s message of "Fri, 11 Oct 1996 12:53:54 MET." <961011125354.ZM10006@candle.brasslantern.com> Date: Tue, 15 Oct 1996 14:45:35 +0200 From: Peter Stephenson Resent-Message-ID: <"M1nkU1.0.Qk4.IVuOo"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/2230 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu "Bart Schaefer" wrote: > Is the following more like the behavior you want? Well, if I adapt your suggestion to: pushd () { setopt localoptions globsubst unsetopt ksharrays case $1 in +*) setopt pushdignoredups builtin pushd ${${=$(dirs)}[$1+1]};; -*) setopt pushdignoredups builtin pushd ${${=$(dirs)}[$1-1]};; *) builtin pushd $*;; esac } (since I need ~ expansion and I don't want to count entry 0 from dirs in the array indexing) I seem to get basically what I want. It's yet another case of running very hard to stay in the same place. -- Peter Stephenson Tel: +49 33762 77366 WWW: http://www.ifh.de/~pws/ Fax: +49 33762 77413 Deutches Electronen-Synchrotron --- Institut fuer Hochenergiephysik Zeuthen DESY-IfH, 15735 Zeuthen, Germany.