Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: file completion of ~user/... stats wrong directory
- X-seq: zsh-workers 27121
- From: Peter Stephenson <pws@xxxxxxx>
- To: Zsh list <zsh-workers@xxxxxxxxxx>
- Subject: Re: file completion of ~user/... stats wrong directory
- Date: Fri, 10 Jul 2009 10:07:21 +0100
- In-reply-to: <19030.11925.370937.608524@xxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- Organization: CSR
- References: <19030.11925.370937.608524@xxxxxxxxxxxxxxxxxx>
On Thu, 9 Jul 2009 13:53:25 -0400
Greg Klanderman <gak@xxxxxxxxxxxxxx> wrote:
> Looking at _path_files, I'm guessing it has something to do with
> setting prepaths=( '' ) in the logic dealing with ~ prefixed strings.
> But I don't understand what prepaths is supposed to be doing. It
> worries me a bit that it is set to that same value in a number of
> other cases. Maybe it should be setting prepaths=() instead?
prepaths comes from the -W option (see the zparseopts call), which is used
when you want the file matcher to behave as if there was a path
prefix---for example, to complete folders in your mail directory, you might
use "-W ~/Mail".
I think the reason it's not an empty array is that matches are eventually
generated in a loop over all -W paths. If there are none, we still want to
execute that loop once, but with an empty prepath (at line 340):
for prepath in "$prepaths[@]"; do
--
Peter Stephenson <pws@xxxxxxx> Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
Messages sorted by:
Reverse Date,
Date,
Thread,
Author