zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@candle.brasslantern.com>
To: Zoltan Hidvegi <hzoli@cs.elte.hu>
Cc: zsh-workers@math.gatech.edu
Subject: Re: pushd
Date: Tue, 15 Oct 1996 22:38:08 -0700	[thread overview]
Message-ID: <961015223809.ZM27932@candle.brasslantern.com> (raw)
In-Reply-To: Zoltan Hidvegi <hzoli@cs.elte.hu> "Re: pushd" (Oct 15,  7:34pm)

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"


  reply	other threads:[~1996-10-16  5:38 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-10-11 12:34 pushd Peter Stephenson
1996-10-11 13:01 ` pushd Vinnie Shelton
1996-10-11 15:13   ` pushd Peter Whaite
1996-10-11 19:53 ` pushd Bart Schaefer
1996-10-15 12:45   ` pushd Peter Stephenson
1996-10-15 17:08     ` pushd Bart Schaefer
1996-10-15 17:34       ` pushd Zoltan Hidvegi
1996-10-16  5:38         ` Bart Schaefer [this message]
1996-10-16  8:42           ` pushd Zefram
1996-10-16 17:36             ` pushd Bart Schaefer
1996-10-16 18:10               ` pushd Zefram
1996-10-16 21:16                 ` pushd Bart Schaefer
1996-10-17 13:22                   ` pushd Anthony Heading
1996-10-17 13:47                     ` pushd Peter Stephenson
1996-10-17 17:01                     ` pushd Bart Schaefer
1996-10-16 22:28                 ` pushd Zoltan Hidvegi
1996-10-16 12:42           ` pushd Peter Stephenson
1996-10-15 18:45       ` pushd Anthony Heading
1996-10-18 13:14 pushd Ray Van Tassle-CRV004

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=961015223809.ZM27932@candle.brasslantern.com \
    --to=schaefer@candle.brasslantern.com \
    --cc=hzoli@cs.elte.hu \
    --cc=schaefer@nbn.com \
    --cc=zsh-workers@math.gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).