From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13983 invoked by alias); 25 May 2017 06:36:22 -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: 22715 Received: (qmail 11657 invoked from network); 25 May 2017 06:36:22 -0000 X-Qmail-Scanner-Diagnostics: from mail-pf0-f193.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.192.193):SA:0(-2.3/5.0):. Processed in 1.655492 secs); 25 May 2017 06:36:22 -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=-2.3 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,RCVD_IN_SORBS_SPAM,SPF_PASS, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: lilydjwg@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.192.193 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to:disposition-notification-to :user-agent; bh=vuOdGyaB4yWDJsFZHwZfyuMYvQwK4p97+8YNVB5mSfE=; b=R69puBJvCbYvHIyMVWhD7euJvLlJQMvU5GhaotDe6AiPeftXaCOFmR4pKaGwRbRQ8i XF2B3jqYO9asjw15FqwT778wlUYUcFi0ZqJfz5tvhVwGEO0arFDDZdI3zLhxXkM8X2LO vBMakHkAqbeLPX90SvPJQuz5Z/UIPx1BCgy104gKPrTXYoyoIF7YbJ9toudRiFcIPyyk x9EXrCY8z/gzpiuilHs8SWTiwtHQEqxjDMhVCv889JmAuNAK7PhzisUpSM3P4XlOz/mv ZZKV7NLWWK0eV3FO6lgx+Wo41XMIQ7Jn2vyhTmHXcyznfw+UcuV3acSMtsi/R0r2UMdy n6ZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:references :mime-version:content-disposition:in-reply-to :disposition-notification-to:user-agent; bh=vuOdGyaB4yWDJsFZHwZfyuMYvQwK4p97+8YNVB5mSfE=; b=eYMR/yab0qwgO4ScNkr1/Z86kew81xJsDgz/Ncm5tzJZY0KF81naLMtlT3CueDHPzL fEiFnz6xDJajnBaDmXbUO4BuftGMSMk28GOxKJcCE00BnL//kKfsJoqxEF/764e3UhQS ATsOFqFz52HEOQs3SzlVphEAPGWt/veIBEPE7Jkt2T9gij0dJbxnhmbljZtQkfssksED QD5ytQranW7gcQl7eVye3xlmbJHJZoBxmXdUMW+htCDs9Dl/e0r5IoTIwBAWakg4TKnH 3rLUdWmbrsuhP3RhKN+UWyYfEZ5sXDqlui7klKz6spyKtIiPRz7mxVkqp3OxycxFJS1m 11Lw== X-Gm-Message-State: AODbwcCkYHoxukOxACuZGDGxpplVnc0kf3PKyvIgYxDCXhchU7IIjWgB JfH8sGJBB988MZBn X-Received: by 10.84.175.67 with SMTP id s61mr5937086plb.151.1495694175690; Wed, 24 May 2017 23:36:15 -0700 (PDT) Date: Thu, 25 May 2017 14:35:40 +0800 From: lilydjwg To: zsh-users@zsh.org Subject: Re: Can't complete path with hidden .zfs? Message-ID: <20170525063540.GA10491@lilyforest.localdomain> References: <20170518034452.GA22579@lilyforest.localdomain> <20170518100220.14cb480e@pwslap01u.europe.root.pri> <20170519033809.GA16150@lilyforest.localdomain> <20170519093052.1832023d@pwslap01u.europe.root.pri> <20170524104148.GA31624@lilyforest.localdomain> <170524120340.ZM15282@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <170524120340.ZM15282@torch.brasslantern.com> User-Agent: Mutt/1.8.2 (2017-04-18) On Wed, May 24, 2017 at 12:03:40PM -0700, Bart Schaefer wrote: > On May 24, 6:41pm, lilydjwg wrote: > } > } It'll be great if I can use a custom function to decide what to add, so > } I can add .zfs only when it actually exists. > > There are two ways you can go here. > > If the .zfs mappings don't change very often, you can test at the time > your .zshrc etc. are read and assign to fake-files at that time. > > On the other hand if either they change during your shell session or > the check for them is very inexpensive, you can use "zstyle -e" to > have a command executed every time the style is looked up. Thanks you so much! I've got it to work perfectly now: _get_zfs_fake_files () { reply=($(awk -vOFS=: -vORS=' ' '$9 == "zfs" { print $5, ".zfs" }' /proc/self/mountinfo)) } zstyle -e ':completion:*' fake-files _get_zfs_fake_files They do change often, because some of them are on one of my external hard drivers. -- Best regards, lilydjwg