Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm
Precedence: bulk
X-No-Archive: yes
List-Id: Zsh Workers List <zsh-workers.zsh.org>
List-Post: <mailto:zsh-workers@zsh.org>
List-Help: <mailto:zsh-workers-help@zsh.org>
X-Qmail-Scanner-Diagnostics: from hermes.apache.org by f.primenet.com.au (envelope-from <danielsh@apache.org>, uid 7791) with qmail-scanner-2.11 
 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1.  
 Clear:RC:0(140.211.11.3):SA:0(-0.5/5.0):. 
 Processed in 0.230723 secs); 18 Aug 2016 16:55:50 -0000
X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au
X-Spam-Level: 
X-Spam-Status: No, score=-0.5 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS,
	RP_MATCHES_RCVD autolearn=unavailable autolearn_force=no version=3.4.1
X-Envelope-From: danielsh@apache.org
X-Qmail-Scanner-Mime-Attachments: |
X-Qmail-Scanner-Zip-Files: |
Received-SPF: none (ns1.primenet.com.au: domain at apache.org does not designate permitted sender hosts)
Date: Thu, 18 Aug 2016 16:55:41 +0000
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: zsh-workers@zsh.org
Subject: Re: [PATCH] New :P history modifier.
Message-ID: <20160818165541.GB25890@tarsus.local2>
References: <1471391679-9604-1-git-send-email-danielsh@tarsus.local2>
 <160817000240.ZM19759@torch.brasslantern.com>
 <20160817163141.GB9003@tarsus.local2>
 <160817100614.ZM21570@torch.brasslantern.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <160817100614.ZM21570@torch.brasslantern.com>
User-Agent: Mutt/1.5.23 (2014-03-12)
X-Seq: zsh-workers 39061

Bart Schaefer wrote on Wed, Aug 17, 2016 at 10:06:14 -0700:
> On Aug 17,  4:31pm, Daniel Shahaf wrote:
> }
> } - xsymlink() is not a drop-in replacement: it tolerates trailing
> }   non-existing path components.  The single callsite in current master
> }   wouldn't care, though.
> 
> Pretty much my point; if there's only one call and they're equivalent
> for that instance, why leave the special case?

*nod*

> } >  The new word modifier ':P' computes the physical path of the argument.
> } >  it is different from the existing ':a' modifier which does always
> } >  resolves /before/here/../after to /before/after, and differs from the
> } >  existing ':A' modifier which resolves symlinks only after here/.. is
> } >  removed even when /before/here is itself a symbolic link.
> } 
> } What about the "It is recommended [to audit uses of :A and change them
> } to :P]" sentence that the original patch had, should it be kept or
> } removed?
> 
> IMO it can be kept.

Kept.  The interdiff so far follows.

Thanks again for the review,

Daniel

diff --git a/Completion/Zsh/Type/_history_modifiers b/Completion/Zsh/Type/_history_modifiers
index 5141d80..1a049d6 100644
--- a/Completion/Zsh/Type/_history_modifiers
+++ b/Completion/Zsh/Type/_history_modifiers
@@ -64,8 +64,8 @@ while true; do
       )
     if (( ! global )); then
       list+=(
-	"a:absolute path, resolve '..' logically"
-	"A:same, then resolve symlinks"
+	"a:absolute path, resolve '..' lexically"
+	"A:as ':a', then resolve symlinks"
 	"c:PATH search for command"
 	"g:globally apply s or &"
 	"h:head - strip trailing path element"
diff --git a/NEWS b/NEWS
index d676e40..65b246d 100644
--- a/NEWS
+++ b/NEWS
@@ -7,13 +7,13 @@ Note also the list of incompatibilities in the README file.
 Changes from 5.2 to 5.3
 -----------------------
 
-The new word modifier ':P' computes the realpath() of the argument.
-It is different from the existing ':a' modifier which does not resolve
-symlinks, and from the existing ':A' modifier which always resolves
-/before/here/../after to /before/after --- even if /before/here is
-a symbolic link.  It is recommended to review uses of ':A' and, if
-appropriate, convert them to ':P' as soon as compatibility with 5.2 is
-no longer a requirement.
+The new word modifier ':P' computes the physical path of the argument.
+It is different from the existing ':a' modifier which always resolves
+'/before/here/../after' to '/before/after', and differs from the
+existing ':A' modifier which resolves symlinks only after 'here/..' is
+removed, even when /before/here is itself a symbolic link.  It is
+recommended to review uses of ':A' and, if appropriate, convert them
+to ':P' as soon as compatibility with 5.2 is no longer a requirement.
 
 Changes from 5.1.1 to 5.2
 -------------------------

