From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12359 invoked from network); 10 Nov 1998 10:37:52 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 10 Nov 1998 10:37:52 -0000 Received: (from list@localhost) by math.gatech.edu (8.9.1/8.9.1) id FAA22805; Tue, 10 Nov 1998 05:34:52 -0500 (EST) Resent-Date: Tue, 10 Nov 1998 05:34:52 -0500 (EST) Message-Id: <9811101019.AA37598@ibmth.df.unipi.it> To: zsh-workers@math.gatech.edu (Zsh hackers list) Subject: PATCH: 3.1.5: alternative PWD patch In-Reply-To: "Peter Stephenson"'s message of "Wed, 04 Nov 1998 13:26:13 NFT." <9811041226.AA32302@ibmth.df.unipi.it> Date: Tue, 10 Nov 1998 11:19:38 +0100 From: Peter Stephenson Resent-Message-ID: <"gDB372.0.Ga5.CR1Is"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/4596 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu I wrote: > + /* Never hash PWD, because it's never useful */ Bart pointed out to me that if the user explicitly uses ~PWD or `hash -d PWD', they should get what they ask for. Here's an alternative patch for that: now PWD is simply never added automatically. The only use I can think of is completion of ~PWD to get an absolute path to the current directory on the command line. Another strategy would be to hash it anyway, but simply never use it if the destination is %~. This is getting a little tricky. *** Src/utils.c.pwd Fri Oct 30 16:37:18 1998 --- Src/utils.c Tue Nov 10 11:09:13 1998 *************** *** 510,515 **** --- 510,519 ---- if ((flags & ND_USERNAME) && nameddirtab->getnode2(nameddirtab, s)) return; + /* Never hash PWD unless it was explicitly requested */ + if (!always && !strcmp(s, "PWD")) + return; + /* Normal parameter assignments generate calls to this function, * * with always==0. Unless the AUTO_NAME_DIRS option is set, we * * don't let such assignments actually create directory names. * -- Peter Stephenson Tel: +39 050 844536 WWW: http://www.ifh.de/~pws/ Dipartimento di Fisica, Via Buonarotti 2, 56100 Pisa, Italy