From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10272 invoked from network); 30 May 2000 07:59:24 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 30 May 2000 07:59:24 -0000 Received: (qmail 9072 invoked by alias); 30 May 2000 07:59:11 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 11650 Received: (qmail 9065 invoked from network); 30 May 2000 07:59:10 -0000 Date: Tue, 30 May 2000 09:59:08 +0200 (MET DST) Message-Id: <200005300759.JAA19754@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: "Bart Schaefer"'s message of Tue, 30 May 2000 07:20:18 +0000 Subject: Re: Calling completion function from a non-completion ZLE widget 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@informatik.hu-berlin.de