Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: 3.1.5: alternative PWD patch
- X-seq: zsh-workers 4596
- From: Peter Stephenson <pws@xxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxxx (Zsh hackers list)
- Subject: PATCH: 3.1.5: alternative PWD patch
- Date: Tue, 10 Nov 1998 11:19:38 +0100
- In-reply-to: "Peter Stephenson"'s message of "Wed, 04 Nov 1998 13:26:13 NFT." <9811041226.AA32302@xxxxxxxxxxxxxxxxx>
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 <pws@xxxxxxxxxxxxxxxxx> Tel: +39 050 844536
WWW: http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarotti 2, 56100 Pisa, Italy
Messages sorted by:
Reverse Date,
Date,
Thread,
Author