Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Setting the 'completer' style - _match and **



On Sep 20,  8:54am, Daniel Shahaf wrote:
}
} [ Your MUA seems to have changed the subject: your email has a hyphen
} where the email you reply to had an em dash. ]

Sorry about that; mail to my home desktop passes through a number of
gateways and processing steps, some of which think non-ascii subjects
are potential spam indicators.

} > } The idea is that if a pattern contains "**" then _match('s wrapper) will
} > } leave it for _expand to process.
} > 
} > You could probably come up with a "zstyle -e" formulation that would only
} > include_match in the completer value in the right circurmstances.
} 
} How would I do that?  I think the "right circumstances" are [[ $curtag
} == *(file|dir)* ]], but the 'completer' style is looked up under the
} context :completion:::::, before tags are known.

I was thinking quite literally what you said about the pattern:

zstyle -e ':completion:*' completer \
  '[[ $PREFIX$SUFFIX == *[*][*]* ]] && reply=(... _expand ...) || \
    reply=(... _match ...)'

But you could add to the [[ ]] e.g. "&& $words[1] == service" (the
value of $service hasn't been set yet there either because it's a
feature of _complete).



Messages sorted by: Reverse Date, Date, Thread, Author