zsh-users
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: zsh-users@zsh.org
Subject: Re: File completion with **/ (with solution)
Date: Thu, 22 Sep 2016 21:12:14 +0000	[thread overview]
Message-ID: <20160922211214.GA14444@fujitsu.shahaf.local2> (raw)
In-Reply-To: <160920175623.ZM32730__25904.0603101768$1474419485$gmane$org@torch.brasslantern.com>

Bart Schaefer wrote on Tue, Sep 20, 2016 at 17:56:23 -0700:
>   _glob_expand() { reply=( $~1* ) }
>   zstyle :completion::user-expand:: user-expand _glob_expand
>   zstyle :completion::user-expand:: tag-order expansions all-expansions
>   zstyle ':completion:*' completer _expand _complete _match _user_expand
> 
> Daniel, this might be the "better answer" to your _match question, too.

Right: I could use _user_expand instead of _expand in my completer
style, and implement a policy such as
.
    1. Try _expand if $condition
    2. Try _match
    3. Try _expand if not $condition
.
with $condition being the *[*][*]* pattern from the _match thread.

> The other thing it might be useful to call out in the doc is to note that
> because _user_expand is called AS a completer, it has access to more of
> the zstyle $context when it is called than when the "completer" style is
> looked up.  This could be handy when deciding what to assign to $reply.

I don't see that additional context: if I define _f as a completer
function, then it's called with curcontext=:f::.

Thanks again for all the investigations.  I've switched to your 'zstyle
-e' solution since this way I don't have to munge $curcontext in my
wrapper function.

Cheers,

Daniel


       reply	other threads:[~2016-09-22 21:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <160920175623.ZM32730__25904.0603101768$1474419485$gmane$org@torch.brasslantern.com>
2016-09-22 21:12 ` Daniel Shahaf [this message]
2016-09-21  0:56 Bart Schaefer
2016-09-21  5:32 ` Bart Schaefer
2016-09-21 20:30   ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160922211214.GA14444@fujitsu.shahaf.local2 \
    --to=d.s@daniel.shahaf.name \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).