From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29240 invoked by alias); 6 Dec 2010 11:34:47 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 28487 Received: (qmail 6138 invoked from network); 6 Dec 2010 11:34:44 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.216.171 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=doX92F3a4QF42OvUjFnQxhZdHhRhu9RFlUhg6A7dKi8=; b=Rm9tXLXSHmcFTPmSf1zl8sG16/DtzVjc/1wUol+dNWLqNpJyn3tD9sBvyU4BRxmRgN OXvg+hvDz4ThdGF33r6G+Ue9B/dnbu8uuR36UfmzwKHOQ99VywAVOqtiWDtCNi68/q0X pMS6Yu3IKvhX3CyP5fIv7xDPEZTqJE47EuqfA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=viKTV4j+exwC5w/43jj2JhEHHCyFhd0OSfSoNQNEL3dX5EX9NBpGfAlUNvaZtPAh2H UOfbDTmOIndOt3nJv2ZpfaXG2nB7r6DkS1fWR5LdsRZw60nVWBFhbuViCpDMxK2ro8nH 0YFlHt0uVbMqiw0lJSHupST54lKP+wFoanuKg= MIME-Version: 1.0 In-Reply-To: References: Date: Mon, 6 Dec 2010 12:34:39 +0100 Message-ID: Subject: Re: $PWD and ~+ (and others) in documentation From: Mikael Magnusson To: zsh workers Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 22 September 2010 21:26, Peter Stephenson wrote: > On Tue, 21 Sep 2010 17:48:41 +0200 > Mikael Magnusson wrote: >> Should I fix this, or does nobody care? And by fix, do I mean changing >> the appropriate occurrences of "$PWD" to "the current working >> directory" or something else? :) > > I think that's the right change: =C2=A0assigning to PWD is for scripts, a= s > you noted, and the prompt should show the real working directory. http://mika.l3ib.org/patches/zsh-pwd.patch >>From a72c328a2bf2bf47b9e705f56a3278eb47717b3e Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Mon, 6 Dec 2010 12:31:41 +0100 Subject: [PATCH] PWD --- Doc/Zsh/builtins.yo | 2 +- Doc/Zsh/expn.yo | 4 ++-- Doc/Zsh/options.yo | 6 +++--- Doc/Zsh/prompt.yo | 19 ++++++++++--------- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/Doc/Zsh/builtins.yo b/Doc/Zsh/builtins.yo index 02071fb..3be4a8b 100644 --- a/Doc/Zsh/builtins.yo +++ b/Doc/Zsh/builtins.yo @@ -169,7 +169,7 @@ item(tt(cd) [ tt(-qsLP) ] {tt(PLUS())|tt(-)}var(n))( Change the current directory. In the first form, change the current directory to var(arg), or to the value of tt($HOME) if var(arg) is not specified. If var(arg) is `tt(-)', change to the -value of tt($OLDPWD), the previous directory. +previous directory. Otherwise, if var(arg) begins with a slash, attempt to change to the directory given by var(arg). diff --git a/Doc/Zsh/expn.yo b/Doc/Zsh/expn.yo index 0f15447..1e2ffff 100644 --- a/Doc/Zsh/expn.yo +++ b/Doc/Zsh/expn.yo @@ -1472,8 +1472,8 @@ described here. If so, then the `tt(~)' and the checked portion are replaced with the appropriate substitute value. A `tt(~)' by itself is replaced by the value of tt($HOME). -A `tt(~)' followed by a `tt(PLUS())' or a `tt(-)' is replaced by the value= of -tt($PWD) or tt($OLDPWD), respectively. +A `tt(~)' followed by a `tt(PLUS())' or a `tt(-)' is replaced by current +or previous working directory, respectively. A `tt(~)' followed by a number is replaced by the directory at that position in the directory stack. diff --git a/Doc/Zsh/options.yo b/Doc/Zsh/options.yo index b050639..a965971 100644 --- a/Doc/Zsh/options.yo +++ b/Doc/Zsh/options.yo @@ -93,9 +93,9 @@ item(tt(CHASE_DOTS))( When changing to a directory containing a path segment `tt(..)' which woul= d otherwise be treated as canceling the previous segment in the path (in other words, `tt(foo/..)' would be removed from the path, or if `tt(..)' i= s -the first part of the path, the last part of tt($PWD) would be deleted), -instead resolve the path to the physical directory. This option is -overridden by tt(CHASE_LINKS). +the first part of the path, the last part of the current working directory +would be removed), instead resolve the path to the physical directory. +This option is overridden by tt(CHASE_LINKS). For example, suppose tt(/foo/bar) is a link to the directory tt(/alt/rod). Without this option set, `tt(cd /foo/bar/..)' changes to tt(/foo); with it diff --git a/Doc/Zsh/prompt.yo b/Doc/Zsh/prompt.yo index e55338e..8d79795 100644 --- a/Doc/Zsh/prompt.yo +++ b/Doc/Zsh/prompt.yo @@ -93,16 +93,17 @@ continuation lines and tt(PS4) for debugging with the tt(XTRACE) option; in the latter case it will also work non-interactively. ) xitem(tt(%d)) -item(tt(%/))( -Present working directory (tt($PWD)). If an integer follows the `tt(%)', -it specifies a number of trailing components of tt($PWD) to show; zero -means the whole path. A negative integer specifies leading components, -i.e. tt(%-1d) specifies the first component. +item(tt(/))( +Current working directory. If an integer follows the `tt(%)', +it specifies a number of trailing components of the current working +directory to show; zero means the whole path. A negative integer +specifies leading components, i.e. tt(%-1d) specifies the first component. ) item(tt(%~))( -As tt(%d) and tt(%/), but if tt($PWD) has a named directory as its prefix, -that part is replaced by a `tt(~)' followed by the name of the directory. -If it starts with tt($HOME), that part is replaced by a `tt(~)'. +As tt(%d) and tt(%/), but if the current working directory has a named +directory as its prefix, that part is replaced by a `tt(~)' followed by +the name of the directory. If it starts with tt($HOME), that part is +replaced by a `tt(~)'. ) xitem(tt(%h)) item(tt(%!))( @@ -139,7 +140,7 @@ names are not shown, instead the file where they were defined. xitem(tt(%c)) xitem(tt(%.)) item(tt(%C))( -Trailing component of tt($PWD). +Trailing component of the current working directory. An integer may follow the `tt(%)' to get more than one component. Unless `tt(%C)' is used, tilde contraction is performed first. These are deprecated as tt(%c) and tt(%C) are equivalent to tt(%1~) and tt(%1/), --=20 1.7.3 --=20 Mikael Magnusson