From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27535 invoked from network); 9 Feb 2004 21:17:31 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 9 Feb 2004 21:17:31 -0000 Received: (qmail 1779 invoked by alias); 9 Feb 2004 21:17:21 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 19409 Received: (qmail 1723 invoked from network); 9 Feb 2004 21:17:20 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 9 Feb 2004 21:17:20 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [80.184.44.74] by sunsite.dk (MessageWall 1.0.8) with SMTP; 9 Feb 2004 21:17:20 -0000 Received: from opk by athlon with esmtp (masqmail 0.2.20) id 1AqIyH-0pl-00 for ; Mon, 09 Feb 2004 22:29:37 +0100 From: Oliver Kiddle To: Zsh workers Subject: _generic and nounset option Date: Mon, 09 Feb 2004 22:29:37 +0100 Message-ID: <3208.1076362177@athlon> If the nounset option is set, the following error occurs when _generic is used: _generic:3: curcontext: parameter not set This is because _generic runs before options are setup in _main_complete. A wrapper script might setup some initial context so the patch I'm suggesting below is to use ${curcontext:-} instead of making it ignore any existing $curcontext. I can't help wondering if it would have been better is nounset was set globally for completion functions though because it might help avoid bugs. Oliver Index: Completion/Base/Widget/_generic =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Base/Widget/_generic,v retrieving revision 1.1 diff -u -r1.1 _generic --- Completion/Base/Widget/_generic 2 Apr 2001 11:16:02 -0000 1.1 +++ Completion/Base/Widget/_generic 9 Feb 2004 21:11:20 -0000 @@ -1,6 +1,6 @@ #autoload -local curcontext="$curcontext" +local curcontext="${curcontext:-}" if [[ -z "$curcontext" ]]; then curcontext="${WIDGET}:::"