From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5546 invoked from network); 17 Jun 2004 03:35:56 -0000 Received: from thor.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.86) by ns1.primenet.com.au with SMTP; 17 Jun 2004 03:35:56 -0000 Received: (qmail 2453 invoked from network); 17 Jun 2004 03:35:47 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 17 Jun 2004 03:35:47 -0000 Received: (qmail 11771 invoked by alias); 17 Jun 2004 03:35:39 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 20066 Received: (qmail 11762 invoked from network); 17 Jun 2004 03:35:39 -0000 Received: from thor.dotsrc.org (HELO a.mx.sunsite.dk) (qmailr@130.225.247.86) by sunsite.dk with SMTP; 17 Jun 2004 03:35:35 -0000 Received: (qmail 2196 invoked from network); 17 Jun 2004 03:35:34 -0000 Received: from lakermmtao03.cox.net (68.230.240.36) by a.mx.sunsite.dk with SMTP; 17 Jun 2004 03:35:33 -0000 Received: from quark.hightek.org ([68.12.75.33]) by lakermmtao03.cox.net (InterMail vM.6.01.03.02 201-2131-111-104-20040324) with ESMTP id <20040617033503.NXAW3786.lakermmtao03.cox.net@quark.hightek.org> for ; Wed, 16 Jun 2004 23:35:03 -0400 Received: by quark.hightek.org (Postfix, from userid 501) id 73B3E12422; Wed, 16 Jun 2004 22:35:16 -0500 (CDT) Date: Wed, 16 Jun 2004 22:35:16 -0500 From: Vincent Stemen To: zsh-workers@sunsite.dk Subject: Re: 'pushd +2' rotates rather than extracts Message-ID: <20040617033516.GA19074@quark.hightek.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=0.0 required=6.0 tests=none autolearn=no version=2.63 X-Spam-Hits: 0.0 On Wed, Jun 16, 2004 at 02:48:32PM -0700, Dave Yost wrote: > This is how tcsh works with 'dextract' set: > > % dirs > /tmp/a /tmp/b /tmp/c /tmp/d /tmp/e > % pushd +2 > 0 /tmp/c > 1 /tmp/a > 2 /tmp/b > 3 /tmp/d > 4 /tmp/e > > That is also how I believe zsh is documented to work (and how I would like it to work). > > But here is what zsh does: > > 202 Z% echo $ZSH_VERSION > 4.2.0 > Z% dirs > /tmp/a /tmp/b /tmp/c /tmp/d /tmp/e > Z% pushd +2 > /tmp/c /tmp/d /tmp/e /tmp/a /tmp/b > Z% It also seems to me it should work the way tcsh does as shown above. I have noticed that the directory stack did not behave as I would expect for quite a while and rarely use it with numbered arguments because of that. I just have not bothered to take the time to look closely at what it was doing before now. Dave pinpointed the problem. Looks like it moves the entire rest of stack to the top rather than the single entry like it does when used with no arguments. It does it on zsh-4.1.1 also. -- Vincent Stemen Avoid the VeriSign/Network Solutions domain registration trap! Read how Network Solutions (NSI) was involved in stealing our domain name. http://www.InetAddresses.net