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 DAA02456 for ; Thu, 17 Oct 1996 03:44:00 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id NAA21641; Wed, 16 Oct 1996 13:33:52 -0400 (EDT) Resent-Date: Wed, 16 Oct 1996 13:33:52 -0400 (EDT) From: "Bart Schaefer" Message-Id: <961016103650.ZM30346@candle.brasslantern.com> Date: Wed, 16 Oct 1996 10:36:50 -0700 In-Reply-To: Zefram "Re: pushd" (Oct 16, 9:42am) References: <2900.199610160842@stone.dcs.warwick.ac.uk> Reply-To: schaefer@nbn.com X-Mailer: Z-Mail (4.0b.820 20aug96) To: Zefram Subject: Re: pushd Cc: hzoli@cs.elte.hu, zsh-workers@math.gatech.edu MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Resent-Message-ID: <"tCnNb1.0.3I5._nHPo"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/2245 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu On Oct 16, 9:42am, Zefram wrote: } Subject: Re: pushd } } >+ {"pushdcycle", 0, 0, OPT_ALL}, } } I think this should have OPT_EMULATE too. Probably right, unless what you're trying to emulate is zsh 2.x. :-) (Baroque idea: Have `emulate' take a version number and set the options to behave like that version of zsh. No, I'm not serious.) There are two remaining pushd oddities: (1) pushd with no args on an empty dirstack acts like pushdtohome, even when pushdtohome is not set. Perhaps the code in my patch: if (func == BIN_POPD && !nextnode(firstnode(dirstack))) { zwarnnam(nam, "directory stack empty", NULL, 0); return NULL; } Should instead read: if ((func == BIN_POPD || (func == BIN_PUSHD && unset(PUSHDTOHOME))) && !nextnode(firstnode(dirstack))) { zwarnnam(nam, "directory stack empty", NULL, 0); return NULL; } (2) pushd to a dirstack element that names a nonexistent directory has inconsistent behavior, and can put the current directory into the stack multiple times: zagzig% dirs /usr/src/local/zsh/zsh-3.0.1-test3 /tmp/remthis /tmp zagzig% rmdir /tmp/remthis zagzig% pushd +1 pushd: no such file or directory: /tmp/remthis zagzig% dirs /usr/src/local/zsh/zsh-3.0.1-test3 /tmp/remthis /tmp zagzig% pushd pushd: no such file or directory: /tmp/remthis zagzig% dirs /usr/src/local/zsh/zsh-3.0.1-test3 /usr/src/local/zsh/zsh-3.0.1-test3 /tmp At the moment I've reached the limit of my comprehension of how all of this works. Too many functions seem to be freeing nodes from the stack -- most notably, bin_cd() frees the top node if cd_get_dest() fails, but I don't understand why. I'm beginning to worry that even the patches I sent yesterday don't work as they should (or rather, that they work only because both zsfree() and getlinknode() ignore null pointers). -- 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"