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 PAA28014 for ; Wed, 16 Oct 1996 15:38:13 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id BAA11046; Wed, 16 Oct 1996 01:35:12 -0400 (EDT) Resent-Date: Wed, 16 Oct 1996 01:35:12 -0400 (EDT) From: "Bart Schaefer" Message-Id: <961015223809.ZM27932@candle.brasslantern.com> Date: Tue, 15 Oct 1996 22:38:08 -0700 In-Reply-To: Zoltan Hidvegi "Re: pushd" (Oct 15, 7:34pm) References: <199610151734.TAA06740@bolyai.cs.elte.hu> Reply-To: schaefer@nbn.com X-Mailer: Z-Mail (4.0b.820 20aug96) To: Zoltan Hidvegi Subject: Re: pushd Cc: zsh-workers@math.gatech.edu MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Resent-Message-ID: <"SJsKz.0.Wi2.FG7Po"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/2240 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Well, that was remarkably easy, especially as compared to John Cooper's popd problems. --- Doc/zsh.texi.0 Tue Oct 8 10:30:07 1996 +++ Doc/zsh.texi Tue Oct 15 22:32:02 1996 @@ -5054,6 +5054,15 @@ If set, @dfn{parameter expansion}, @dfn{command substitution} and @dfn{arithmetic expansion} is performed in prompts. +@item PUSHD_CYCLE +@cindex directory stack, cycling entries +@pindex PUSHD_CYCLE +When set, @code{pushd +@var{n}} and @code{pushd -@var{n}} (for integer +@var{n}) rotate the directory stack to bring the @var{n}th directory to +the top. Otherwise the @var{n}th element is moved to the top of the stack +without reordering other directories, which was the behavior in past +versions of @code{zsh}. + @item PUSHD_IGNORE_DUPS @cindex directory stack, ignoring dups @pindex PUSHD_IGNORE_DUPS @@ -6162,7 +6171,7 @@ The third form of @code{pushd} changes directory by rotating the directory list. An argument of the form @code{+n} identifies a stack entry by counting from the left of the list shown by the @code{dirs} command, starting with -zero. An argument of the form @samp{-n} counts from the right. If the +zero. An argument of the form @code{-n} counts from the right. If the @code{PUSHD_MINUS} option is set, the meanings of @code{+} and @code{-} in this context are swapped. --- Doc/zshoptions.man.0 Tue Oct 8 10:30:08 1996 +++ Doc/zshoptions.man Tue Oct 15 21:12:47 1996 @@ -436,6 +436,12 @@ If set, \fIparameter expansion\fP, \fIcommand substitution\fP and \fIarithmetic expansion\fP is performed in prompts. .TP +\fBPUSHD_CYCLE\fP +When set, \fBpushd +n\fP and \fBpushd -n\fP (for integer \fIn\fP) rotate the +directory stack to bring the \fIn\fPth directory to the top. Otherwise the +\fIn\fPth element is moved to the top of the stack without reordering other +directories, which was the behavior in past versions of \fBzsh\fP. +.TP \fBPUSHD_IGNORE_DUPS\fP Don't push multiple copies of the same directory onto the directory stack. .TP --- Src/builtin.c.0 Tue Oct 8 10:30:08 1996 +++ Src/builtin.c Tue Oct 15 16:37:42 1996 @@ -1262,7 +1262,7 @@ char *new_pwd, *s; int dirstacksize; - if (func == BIN_PUSHD) + if (func == BIN_PUSHD && isset(PUSHDCYCLE)) rolllist(dirstack, dir); new_pwd = remnode(dirstack, dir); --- Src/globals.h.0 Tue Oct 8 10:30:09 1996 +++ Src/globals.h Tue Oct 15 16:36:33 1996 @@ -764,6 +764,7 @@ {"privileged", 'p', 'p', OPT_SPECIAL}, {"promptcr", x'V', 0, OPT_ALL}, {"promptsubst", 0, 0, OPT_EMULATE|OPT_KSH}, + {"pushdcycle", 0, 0, OPT_ALL}, {"pushdignoredups", 0, 0, 0}, {"pushdminus", 0, 0, 0}, {"pushdsilent", 'E', 0, 0}, --- Src/zsh.h.0 Tue Oct 8 10:30:10 1996 +++ Src/zsh.h Tue Oct 15 16:38:17 1996 @@ -1134,6 +1134,7 @@ PRIVILEGED, PROMPTCR, PROMPTSUBST, + PUSHDCYCLE, PUSHDIGNOREDUPS, PUSHDMINUS, PUSHDSILENT, -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.nbn.com/people/lantern New male in /home/schaefer: >N 2 Justin William Schaefer Sat May 11 03:43 53/4040 "Happy Birthday"