From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2938 invoked by alias); 8 Nov 2011 15:14:13 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 16557 Received: (qmail 22661 invoked from network); 8 Nov 2011 15:14:11 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <111108071341.ZM3017@torch.brasslantern.com> Date: Tue, 08 Nov 2011 07:13:41 -0800 In-reply-to: <20111108142146.GC1621@x4.trippels.de> Comments: In reply to Markus Trippelsdorf "Re: zsh spinning for ages when I hit tab on directory" (Nov 8, 3:21pm) References: <20111108131022.GA1621@x4.trippels.de> <20111108135809.GB1621@x4.trippels.de> <20111108142146.GC1621@x4.trippels.de> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: zsh spinning for ages when I hit tab on directory MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Nov 8, 3:21pm, Markus Trippelsdorf wrote: } Subject: Re: zsh spinning for ages when I hit tab on directory } } > > When position the cursor after the man1/ of } > > ~ % /usr/share/gcc-data/x86_64-pc-linux-gnu/4.7.0/man/man1/ } > > and hit tab, zsh starts spinning: } } zstyle ':completion:::::' completer _complete _approximate } zstyle -e ':completion:*:approximate:*' max-errors 'reply=( $(( ($#PREFIX+$#SUFFIX)/3 )) )' } zstyle ':completion:*:corrections' format '%B%d (errors: %e)%b' } } When I comment out the max-errors zstyle, zsh no longer hangs. } } So the next question is, how can I get the same behavior as before, but } without the long hangs? You're computing max-errors based on the length of the entire path, but the effect of correction is applied to each individual component, so you're allowing 18 corrections per filename in man1/ with the above. Try changing to something like zstyle -e ':completion:*:approximate:*' \ max-errors 'reply=( $(( ($#PREFIX:t+$#SUFFIX:h)/3 )) )' although that (and your original) allows no corrections unless there are at least 6 characters already in the current word, so you might want to use e.g. ($#PREFIX:t+2) or ($#PREFIX:t < 3 ? 3 : $#PREFIX:t).