zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: Zsh workers <zsh-workers@sunsite.dk>
Subject: _generic and nounset option
Date: Mon, 09 Feb 2004 22:29:37 +0100	[thread overview]
Message-ID: <3208.1076362177@athlon> (raw)

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}:::"


                 reply	other threads:[~2004-02-09 21:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3208.1076362177@athlon \
    --to=okiddle@yahoo.co.uk \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).