zsh-workers
 help / color / mirror / code / Atom feed
* _generic and nounset option
@ 2004-02-09 21:29 Oliver Kiddle
  0 siblings, 0 replies; only message in thread
From: Oliver Kiddle @ 2004-02-09 21:29 UTC (permalink / raw)
  To: Zsh workers

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-02-09 21:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-09 21:29 _generic and nounset option Oliver Kiddle

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).