From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12763 invoked by alias); 13 May 2011 20:08:14 -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: 29265 Received: (qmail 23967 invoked from network); 13 May 2011 20:08:02 -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.220.171 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=JM2mFSfHde+NqV1HYGbIrdcjm6U4ac0oR3EFUbPpDWc=; b=K7t7AvCkEj7PLiMI+CRAq78P5CwYJDFX1laLTiwwlP2G0VIKIs0v2cZg6mDZj0Ixa6 5xFmZPVI2zkOrGuaaJ0NZYZkHmeH/vli1T/0qXUXWx9LSvRN7WebZEPGrw7JiyT1yH0H iRe6qhJAnwuOT+r/4DHT98FxeJdsWSBnq9fnY= 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 :cc:content-type; b=npXDrR3EkTJdxgrQ1/voUrttPY7JtARYnAbUvQ7DHRJe4mswd5N9TrtvSF6Pw35vKm 05vdXaKc4ZYHlysdaukpdXTe2/WCzWXMsBAnAJBXInIOqD8q3UGH5eHimVHeDkKSjRPP SiUW30XQGcNhFIJHZYlsNeyv6XmNP2C5J4SNs= MIME-Version: 1.0 In-Reply-To: <20110513195324.6ab90eb2@pws-pc.ntlworld.com> References: <20110513191710.657d2f61@pws-pc.ntlworld.com> <20110513195324.6ab90eb2@pws-pc.ntlworld.com> Date: Fri, 13 May 2011 22:07:57 +0200 Message-ID: Subject: Re: squeeze-slashes false not working? From: Mikael Magnusson To: Peter Stephenson Cc: zsh workers Content-Type: text/plain; charset=UTF-8 On 13 May 2011 20:53, Peter Stephenson wrote: > On Fri, 13 May 2011 20:23:15 +0200 > Mikael Magnusson wrote: >> On 13 May 2011 20:17, Peter Stephenson wrote: >> > On Thu, 12 May 2011 19:18:26 +0200 >> > Mikael Magnusson wrote: >> >> Another old mail: >> >> """ >> >> estragib noted on irc that >> >> 21:28:58 completing ~/d/p/t/i. works for >> >> ~/dev/prj/test/index.html, as does ~/d/*/*/ind. i vaguely remember >> >> seeing a setting somewhere that will allow ~/d///ind but can't find >> >> it again. help? :) >> >> >> >> and it seems that setting squeeze-slashes to true or false has no >> >> effect, the slashes are always squeezed. But it works in zsh -f. >> >> """ >> >> >> >> But now I can't reproduce it working in zsh -f. At best it jumps back >> >> to the first doubleslash and completes at that point. Maybe another >> >> option is interfering, any idea which one if so? >> > >> > That's the standard feature that it tries to expand path segments before >> > the first. It can be turned off by setting the style path-completion to >> > false, although what setting it to false does is to allow _path_files to >> > skip a prefix of the file that already exists, and I'm not sure what >> > happens if there are multiple slashes there. >> >> Hm, with that set, zsh -f starts acting like with my .zshrc, ie as if >> I only had one slash. Does ls ///// just show stuff in / for you >> too? The documentation for squeeze-slashes says it should act like I >> typed ls /*/*/*/*/. > > Er, that sounds like it means it works with path-files *on*, and I don't > know how that's supposed to be implemented. It also looks I don't know > what's supposed to be happening in any given case, either, or quite what > is or isn't working. Okay, I'll try to sum up :). Starting from zsh -f + compinit, with path-files on and squeeze-slashes off (the default), I get this behaviour: ls //// jumps back to the first slash and allows me to complete components in /. With the same and path-files off, it simply behaves as if I had ls /, ie it completes components in / after the four slashes. squeeze-slashes on and path-completion on behaves as the second case. squeeze-slashes on and path-completion off behaves the same way. When I type ls /*/*/, all paths matching that glob are inserted on the command line, this does not equal any of the above results. In my zshrc setup it cycles through the matches of the first segment and leaves the second /*/ alone. Ideally I would like to cycle through the matches of the whole glob, not just the first segment, but that's a separate problem I think. Hm. If I start from zsh -f and compinit and then setopt globcomplete, it behaves closer to how I want. I get a completion menu that lists things in both /bin and /tmp starting with 'a' when I do ls //a. It still jumps back to the first slash and stops working when I unset path-completion though. Completing ls /*/a only works with path-completion on when globcomplete is on, but behaves the same way with globcomplete off regardless of the setting of path-completion. In all cases so far with /*/a it only completes to /tmp/a which is an exact match, not /bin/attr for example which would be a partial match, so I think that's actually expansion, not completion? With globcomplete on and path-completion on, completing /*/a* goes back to listing only the first segment in the menu, and no obvious way to accept and start completing the second segment, any cursor movement does the trick but... In almost none of the above have I seen any evidence that with squeeze-slashes on, is any repeated slashes treated as an asterisk appearing between them though. :) It does sort of come close with path-completion on, but that seems orthogonal in principle. This is what the manpage says about squeeze-slashes, "by default the file completion function behaves as if there were a `*' between the slashes." -- Mikael Magnusson