Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Calling completion function from a non-completion ZLE widget
- X-seq: zsh-workers 11650
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: Re: Calling completion function from a non-completion ZLE widget
- Date: Tue, 30 May 2000 09:59:08 +0200 (MET DST)
- In-reply-to: "Bart Schaefer"'s message of Tue, 30 May 2000 07:20:18 +0000
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
Bart Schaefer wrote:
> ...
>
> The best we can do seems to be a bit of defensive programming up front.
> What's a reliable way to determine that the completion system is active?
> (Testing a parameter won't do it, the user could always set another of
> the same name.)
Hm, no parameter? Even if ${(t)compstate} yields `association-local-special'?
We can use the conditions, e.g.:
if [[ -prefix * ]] 2> /dev/null; then
# completion active
fi
Or should we change compadd to return `2' in $? when completion is not
active? Or `1' there, but `2' if no matches are given, so that we
could do
compadd 2> /dev/null
if [[ $? -ne 1 ]]; then
...
fi
? Dunno.
Bye
Sven
--
Sven Wischnowsky wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author