zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@ibmth.df.unipi.it>
To: zsh-workers@math.gatech.edu (Zsh hackers list)
Subject: PATCH: 3.1.5: alternative PWD patch
Date: Tue, 10 Nov 1998 11:19:38 +0100	[thread overview]
Message-ID: <9811101019.AA37598@ibmth.df.unipi.it> (raw)
In-Reply-To: "Peter Stephenson"'s message of "Wed, 04 Nov 1998 13:26:13 NFT." <9811041226.AA32302@ibmth.df.unipi.it>

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@ibmth.df.unipi.it>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarotti 2, 56100 Pisa, Italy


      parent reply	other threads:[~1998-11-10 10:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-11-04 11:44 Strange prompting in new 3.1.5 Stucki
1998-11-04 12:03 ` Bruce Stephens
1998-11-04 12:27 ` Zefram
1998-11-04 12:26   ` PATCH: " Peter Stephenson
1998-11-04 16:21     ` Bart Schaefer
1998-11-10 10:19     ` Peter Stephenson [this message]

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=9811101019.AA37598@ibmth.df.unipi.it \
    --to=pws@ibmth.df.unipi.it \
    --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).