From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28752 invoked from network); 6 Jan 2002 04:40:46 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 6 Jan 2002 04:40:46 -0000 Received: (qmail 14823 invoked by alias); 6 Jan 2002 04:40:31 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 4566 Received: (qmail 14812 invoked from network); 6 Jan 2002 04:40:31 -0000 From: "Bart Schaefer" Message-Id: <1020106053212.ZM7648@candle.brasslantern.com> Date: Sun, 6 Jan 2002 05:32:12 +0000 In-Reply-To: <20011222235104.84129.qmail@web12303.mail.yahoo.com> Comments: In reply to Le Wang "merging consecutive cd commands" (Dec 22, 6:51pm) References: <20011222235104.84129.qmail@web12303.mail.yahoo.com> X-Mailer: Z-Mail (5.0.0 30July97) To: Le Wang , Zsh users list Subject: Re: merging consecutive cd commands MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Dec 22, 6:51pm, Le Wang wrote: } } Is there an option that allows consecutive cd or pushd } commands to modify the top entry in the cd stack That would be what happens when autopushd is not set, wouldn't it? } and command history, instead of adding to it? There's currently no option or other mechanism that allows altering an existing history entry (unless you count hist_ignore_space). We've talked about making editable the $history association, but haven't come up with a working solution yet. } e.g. } --------------------------- } LE-XP% setopt autopushd } LE-XP% cd temp } LE-XP% cd temp2 } LE-XP% dirs } ~/temp/temp2 ~ } LE-XP% } --------------------------- I suspect that what you mean is that you want autopushd only when NOT changing to a subdirectory of the current directory. You can simulate that with something like this: chpwd() { # setopt localoptions pushd_silent no_pushd_minus # as needed [[ ~0 = ~1/* ]] && popd +1 } Or you can manipulate the $dirstack array if you have the zsh/parameter module loaded: chpwd() { # setopt localoptions no_ksh_arrays # if needed [[ $PWD = $dirstack[1]/* ]] && dirstack[1]=() } Or you can write your own cd and/or chdir functions and do it in those. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net