From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4379 invoked from network); 27 Jun 2001 16:24:30 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 27 Jun 2001 16:24:30 -0000 Received: (qmail 2323 invoked by alias); 27 Jun 2001 16:23:38 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 15143 Received: (qmail 2258 invoked from network); 27 Jun 2001 16:23:36 -0000 From: "Bart Schaefer" Message-Id: <1010627162054.ZM6208@candle.brasslantern.com> Date: Wed, 27 Jun 2001 16:20:54 +0000 In-Reply-To: <200106271311.PAA31162@beta.informatik.hu-berlin.de> Comments: In reply to Sven Wischnowsky "Re: PATCH (?) Re: [zsh 4.0.1 bug] filename completion" (Jun 27, 3:11pm) References: <200106271311.PAA31162@beta.informatik.hu-berlin.de> X-Mailer: Z-Mail (5.0.0 30July97) To: Sven Wischnowsky , zsh-workers@sunsite.dk Subject: Re: PATCH (?) Re: [zsh 4.0.1 bug] filename completion MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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/'. 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' 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