From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28116 invoked from network); 7 Apr 2004 10:41:54 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 7 Apr 2004 10:41:54 -0000 Received: (qmail 3665 invoked by alias); 7 Apr 2004 10:41:24 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7330 Received: (qmail 3631 invoked from network); 7 Apr 2004 10:41:24 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 7 Apr 2004 10:41:24 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [130.225.247.86] by sunsite.dk (MessageWall 1.0.8) with SMTP; 7 Apr 2004 10:41:23 -0000 Received: (qmail 18742 invoked from network); 7 Apr 2004 10:41:22 -0000 Received: from mta7.srv.hcvlny.cv.net (167.206.5.74) by a.mx.sunsite.dk with SMTP; 7 Apr 2004 10:41:20 -0000 Received: from acm.org (ool-182cd17f.dyn.optonline.net [24.44.209.127]) by mta7.srv.hcvlny.cv.net (iPlanet Messaging Server 5.2 HotFix 1.25 (built Mar 3 2004)) with ESMTP id <0HVS004TSR1DUU@mta7.srv.hcvlny.cv.net> for zsh-users@sunsite.dk; Wed, 07 Apr 2004 06:41:38 -0400 (EDT) Date: Wed, 07 Apr 2004 06:41:41 -0400 From: paxunix Subject: Re: How to get faster completion if I make zsh assume what I've typed so far is correct? In-reply-to: <4061027C.907@acm.org> Cc: zsh-users@sunsite.dk Message-id: <4073DAE5.6040904@acm.org> MIME-version: 1.0 Content-type: multipart/alternative; boundary="Boundary_(ID_nqPvrrM8o2W5d3dgGYpdig)" X-Accept-Language: en-us, en User-Agent: Mozilla Thunderbird 0.5+ (Windows/20040319) References: <12734.1080061609@csr.com> <4061027C.907@acm.org> X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: ** X-Spam-Status: No, hits=2.1 required=6.0 tests=HTML_MESSAGE,HTML_TITLE_EMPTY, RCVD_IN_NJABL,RCVD_IN_SORBS autolearn=no version=2.63 X-Spam-Hits: 2.1 --Boundary_(ID_nqPvrrM8o2W5d3dgGYpdig) Content-type: text/plain; charset=us-ascii; format=flowed Content-transfer-encoding: 7BIT I wrote: > Peter Stephenson wrote: > >>paxunix wrote: >> >> >>>Why does zsh have to glob every directory along a pathname in order to >>>find completions within the final directory? For example, take this case: >>> >>>/one/two/three/four >>> >>>If I set -x, the output after hitting TAB shows zsh retrieves all the >>>subdirectories within one, two, three and four. >>> >>> >> >>It's looking for /oneandabit/twoandabit/threeandabit/four... etc. >> >>I certainly agree it should be possible to turn this off but the >>function that implements this is very hairy and full of calls to poorly >>documented shell internals. >> >>The documentation in the zshcompsys manual page suggests setting >> >> zstyle ':completion:*:paths' accept-exact true >> >>or maybe (I'm not quite sure what the entry means and the implementation >>is obscure) >> >> zstyle ':completion:*:paths' accept-exact '*' >> >>If neither works, I would definitely interpret that as a bug. >> >>I'm afraid vagueness is the order of the day since the author hasn't >>been seen in these parts for ages. Maybe Oliver knows more. >> > The latter works perfectly. The situation is even more pronounced on > zsh under Cygwin, where completing a path with > /cygdrive/ will cause your floppy drive to be accessed > every time you attempt a new completion. The accept-exact '*' > resolves this issue wonderfully. Many thanks! Following up to myself-- There are a couple of very annoying issues with this solution: ambiguous matches are not cycled through correctly and it is impossible to complete some pathnames. For example, if you have two directories: dir1 dir1~ Typing dir will complete up to 'dir1' and (in my case) show dir1 and dir1~ as possible completions. Successively hitting TAB will never cycle through to dir1~ - a trailing '/' is inserted after dir1 and zsh lists the contents of dir1 as possible completions. It appears that any common prefix to an initial path completion attempt causes completion to continue inside the first directory match. If it's between a directory and a filename with a common prefix, things work as they are supposed to. In case there is a style or option that is messing things up, here is my .compinstall: zstyle ':completion:*' completer _complete _expand zstyle ':completion:*' format 'Completing %d...' zstyle ':completion:*' insert-unambiguous true zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' zstyle :compinstall filename "$HOME//.compinstall" zstyle ':completion:*:paths' accept-exact '*' and my setopt output: noalwayslastprompt alwaystoend autopushd nobeep completeinword extendedglob extendedhistory globcomplete histfindnodups histignorealldups histreduceblanks histsavenodups interactive interactivecomments nolistambiguous nolistbeep login monitor nonomatch nopromptcr promptsubst pushdignoredups pushdminus rmstarsilent sharehistory shinstdin typesetsilent zle Any ideas appreciated. -- Shawn Halpenny --Boundary_(ID_nqPvrrM8o2W5d3dgGYpdig)--