Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Sort of PATCH: local completions
- X-seq: zsh-workers 16213
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Peter Stephenson <pws@xxxxxxx>, zsh-workers@xxxxxxxxxx (Zsh hackers list)
- Subject: Re: Sort of PATCH: local completions
- Date: Fri, 2 Nov 2001 17:19:36 -0800
- In-reply-to: <11955.1004723898@xxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <11955.1004723898@xxxxxxx>
On Nov 2, 5:58pm, Peter Stephenson wrote:
> Subject: Sort of PATCH: local completions
> I'm sure this can be done much better. This modifies the normal way of
> choosing a context-sensitive completion to allow you to have a special form
> in a particular directory. [...]
>
> There is no way of making styles local. This would take a certain amount
> of internal hacking. [...]
Hrm. I think the way I'd approach this whole "local completions" issue is
to alter the context used by the styles in the first place.
E.g., suppose the file .zcompcontext contains the string "zsh-source":
chpwd() {
[[ -f .zcompcontext ]] && curcontext="$(<.zcompcontext)":::
}
zstyle+ ':completion:zsh-source:*:make:*:targets' call-command yes
+ '' command _make_for_zsh_source
This is overloading the `function' field of the context, but what the hell.
You could still read the file with `source' instead, I suppose, and thus put
all the zstyle commands right there in the file, but the code would have to
get a whole lot more paranoid to avoid trojan horses.
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net
Messages sorted by:
Reverse Date,
Date,
Thread,
Author