From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8175 invoked by alias); 15 Mar 2017 07:22:51 -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: 22575 Received: (qmail 16582 invoked from network); 15 Mar 2017 07:22:51 -0000 X-Qmail-Scanner-Diagnostics: from mail-lf0-f42.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.215.42):SA:0(0.5/5.0):. Processed in 1.264565 secs); 15 Mar 2017 07:22:51 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,RCVD_IN_SORBS_SPAM, SPF_PASS,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.1 X-Envelope-From: jesper.nygards@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.215.42 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=VJoLp6TCcqG893s/zRglaOjx1tPp73xNxncPzomN16c=; b=jFJZSHEHoY/XB4fyoNp77Dsl2arJPnFdH0ZhFgzl/VBd9x8wqjbR2jYgqpNqDdZSR0 qrDUfBlH4M5HNX6VDe4X+BRn24A0URoCKRaWUUIz9+IbOwpdc7a5iFyDiahK7WTOyN10 AdNntOgJE62EJ12CgFZ47/c+FGDbcFtuboVHLGoZAWz7uieSp9/BjwFOvd2WHLQC36Z+ wFk0WfJ6qu42aT8dXazxLYQMuL+a1cP88nQ7zQwSIiPtQMIRILwJAlpHhahQ8pjeWBTv t4/O9FZgjisZyYNlemUh08fX66SLQz4at3bGhBwPFLat6k52qr/BR+HjqHtx/RDSaFxe 817w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=VJoLp6TCcqG893s/zRglaOjx1tPp73xNxncPzomN16c=; b=oPS7WOZnXnd5QYdYCuyzXtvA2P54OKAnT7wXoUmLkHJECKPZwCbaVmH0MbMIsC2Hmu b1o2WTwH/feelS9YgqptP4FxZxL/SXYd53CnL+We/PubSEQEZ1W43FRYaSCmPosS0zrk p/N+Z250Dqlw679uAVFzgz+IMSbEt8vUEKN7hAJW7T90LLCQS/KMN7vWyX9Iu0Kr6UFX fG6x5wSkMI9jNmS7fTb3axmhL6E/2KRUfAn6dgwf6njeirOCkYlrjP7rLoCUGNSXGB3H l3y7xtyvdTY5WUSfFLRk4wwq7FIyh1lzjk1mzJ75iTKd+zevSsNp/d6ev4T52ZefKgc+ hUSQ== X-Gm-Message-State: AFeK/H0qsFuxCaDgM9DhI1C8dbzIMsYpUV5URGVYz+UpnVQ7Yr/8rhnO50YEYjeMh2KZmEANTVt4LtEmh82obw== X-Received: by 10.46.69.130 with SMTP id s124mr529383lja.71.1489562564890; Wed, 15 Mar 2017 00:22:44 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <170314120715.ZM10347@torch.brasslantern.com> From: =?UTF-8?Q?Jesper_Nyg=C3=A5rds?= Date: Wed, 15 Mar 2017 08:22:44 +0100 Message-ID: Subject: Re: Completion for cd To: Zsh Users Content-Type: multipart/alternative; boundary=001a114b0ef68d1776054abfcfdb --001a114b0ef68d1776054abfcfdb Content-Type: text/plain; charset=UTF-8 On Wed, Mar 15, 2017 at 4:56 AM, Bart Schaefer wrote: > The clue is at the very end of each file: In the first case [that > ignores parents as expected], the _complete function generated the > matches, but in the second case the _approximate function generated > them. > > The path search correctly excludes "zaa" but then _approximate puts it > back because it is similar enough to the string on the command line. > Thanks to your help, I managed to find a working solution, changing the critical lines to this: zstyle ':completion:*:complete:cd:*:*' tag-order local-directories directories - zstyle ':completion:*:withpath:cd:*:*' tag-order path-directories In other words, I have added 'directories' to the first line. However, I still don't fully understand what is going on. As per your findings, it's the _approximate function that adds 'zaa'. But that must mean that none of the previous completers have found any match, doesn't it? If _complete or _complete:withpath had found even _one_ match, _approximate would never have been called, right? The documentation for the local-directories tag says that it and path-directories are used if cdpath is set, instead of the 'directories' tag. I had interpreted this to mean that the 'directories' tag does not come into play when doing cd completion whenever cdpath is set, as in my case. Furthermore, as I read the documentation of tag-order, all tags are in play after the explicitly mentioned tags, _unless_ the list ends with a hyphen. However, the tag-order of the second completer, 'withpath', doesn't end with a hyphen, and I would thus have expected the 'directories' tag to be tried even though it is not explicitly mentioned. In short, I would have thought that 'directories' was uninteresting tag when cdpath was set, and when it actually was in play, I would have thought it would be tried by the withpath-completer since there is no hyphen at the end of the tag-order. But obviously I have misunderstood something here, since it works. I'm just curious to know where the fault in my understanding is. --001a114b0ef68d1776054abfcfdb--