Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH (?) Re: [zsh 4.0.1 bug] filename completion

On Jun 27,  3:11pm, Sven Wischnowsky wrote:
} Subject: Re: PATCH (?) Re: [zsh 4.0.1 bug] filename completion
} It looks as good as we can currently get... (after replacing the
} `_alternative ... && ret=2' with `... && ret=0').

Where in the world did that come from?  I don't have ret=2 in my copy
here from which I generated that diff ... I just checked and even re-
generated the diff and there's no ret=2 ...

} Now for the problem: just sticking a tilde in front of $PREFIX won't
} work in a case like the one we're discussing (a named directory `soft'
} and a directory `software').  Try it with `cd soft/<TAB>'.  The `soft'
} vanishes.

Yes, I did notice that.  Actually, in my case, it doesn't vanish, but it
is replaced by ~soft/xx where xx is the unambiguous prefix of subdirs
within ~soft/.  Oh, that's because there are no subdirectories of the
software/ directory -- if I make one, then soft/ vanishes.

} That's because the call on line 46/47 adds matches like
} `~soft/foo' and the calls on lines 59/60 add matches like `software/foo'.
} We can almost get to where we want to get by changing it to what you can
} see in the patch below.  It first stuffs the parameter into $IPREFIX and
} then calls _path_files with a -W containing the expanded directory.

I played with and discarded that approach in the course of coming up with
what I posted (although I used `compset -P' to manipulate the prefixes,
rather than munging the parameters directly).  But perhaps the reason I
discarded it was because of (the symptoms of) the compatch.c problem.

} But this isn't a really good solution, because with that and directories
} `~soft/foo' and `software/foo' completion after `cd soft/f<TAB>' lists
} the `foo's, not the ambiguous prefix

Hrm.  That's a pretty minor problem by comparison.  Particularly since it
will (appear to) do the right thing if there are at least two directories
starting with `f' that don't share a whole name in common.

} Because of that I'm not going to commit that part of the patch

I think you should commit it.  Anybody else have an opinion?

Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   

Messages sorted by: Reverse Date, Date, Thread, Author