Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: pushd



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"



Messages sorted by: Reverse Date, Date, Thread, Author