about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2000-10-19 08:58:17 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2000-10-19 08:58:17 +0000
commite14a02f4408039ce7aa46ea085a7cf9156e648d0 (patch)
treec542746463209137959b70c977e7d86268129de4
parent16d7e31ae81bdd87dd90ce91d9072006e43f6596 (diff)
downloadzsh-e14a02f4408039ce7aa46ea085a7cf9156e648d0.tar.gz
zsh-e14a02f4408039ce7aa46ea085a7cf9156e648d0.tar.xz
zsh-e14a02f4408039ce7aa46ea085a7cf9156e648d0.zip
simplify setting standard completion system options using $_comp_options (13036)
-rw-r--r--ChangeLog10
-rw-r--r--Completion/Commands/_bash_completions3
-rw-r--r--Completion/Commands/_complete_debug3
-rw-r--r--Completion/Commands/_complete_help4
-rw-r--r--Completion/Commands/_correct_word3
-rw-r--r--Completion/Commands/_expand_word3
-rw-r--r--Completion/Commands/_history_complete_word3
-rw-r--r--Completion/Commands/_next_tags3
-rw-r--r--Completion/Core/_main_complete4
-rw-r--r--Completion/Core/compinit15
10 files changed, 35 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index a8bf8c92a..1115ac882 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2000-10-19  Sven Wischnowsky  <wischnow@zsh.org>
 
+	* 13036: Completion/Commands/_bash_completions,
+ 	Completion/Commands/_complete_debug,
+ 	Completion/Commands/_complete_help,
+ 	Completion/Commands/_correct_word,
+ 	Completion/Commands/_expand_word,
+ 	Completion/Commands/_history_complete_word,
+ 	Completion/Commands/_next_tags, Completion/Core/_main_complete,
+ 	Completion/Core/compinit: simplify setting standard completion
+ 	system options using $_comp_options
+	
 	* 13035: Doc/Zsh/mod_zpty.yo, Functions/Misc/nslookup, Src/utils.c,
  	Src/Modules/zpty.c, Test/comptest: make non-blocking IO on ptys
  	work again; add -t option to test if command is still alive
diff --git a/Completion/Commands/_bash_completions b/Completion/Commands/_bash_completions
index 1c66bacf7..f16b5e0a4 100644
--- a/Completion/Commands/_bash_completions
+++ b/Completion/Commands/_bash_completions
@@ -25,8 +25,7 @@
 # that will not have been overridden, so you should add '~' to the
 # list of keys at the top of the for-loop.
 
-setopt localoptions nullglob rcexpandparam extendedglob unset
-unsetopt markdirs globsubst shwordsplit shglob ksharrays cshnullglob
+setopt localoptions $_comp_options
 
 local key=$KEYS[-1] expl
 
diff --git a/Completion/Commands/_complete_debug b/Completion/Commands/_complete_debug
index bddc90313..d013f00d9 100644
--- a/Completion/Commands/_complete_debug
+++ b/Completion/Commands/_complete_debug
@@ -1,7 +1,6 @@
 #compdef -k complete-word \C-x?
 
-setopt localoptions nullglob rcexpandparam extendedglob unset
-unsetopt markdirs globsubst shwordsplit shglob ksharrays cshnullglob
+setopt localoptions $_comp_options
 
 setopt localtraps noerrexit ; trap - ZERR
 
diff --git a/Completion/Commands/_complete_help b/Completion/Commands/_complete_help
index 0630ebe1f..2d2ba52d9 100644
--- a/Completion/Commands/_complete_help
+++ b/Completion/Commands/_complete_help
@@ -1,8 +1,8 @@
 #compdef -k complete-word \C-xh
 
 _complete_help() {
-  setopt localoptions nullglob rcexpandparam extendedglob unset
-  unsetopt markdirs globsubst shwordsplit shglob ksharrays cshnullglob
+  setopt localoptions $_comp_options
+
   exec </dev/null	# ZLE closes stdin, which can cause errors
 
   local _sort_tags=_help_sort_tags text i j k
diff --git a/Completion/Commands/_correct_word b/Completion/Commands/_correct_word
index d027dc0e4..c0b03dd02 100644
--- a/Completion/Commands/_correct_word
+++ b/Completion/Commands/_correct_word
@@ -7,8 +7,7 @@
 # If configurations keys with the prefix `correctword_' are
 # given they override those starting with `correct_'.
 
-setopt localoptions nullglob rcexpandparam extendedglob unset
-unsetopt markdirs globsubst shwordsplit shglob ksharrays cshnullglob
+setopt localoptions $_comp_options
 
 local curcontext="$curcontext"
 
diff --git a/Completion/Commands/_expand_word b/Completion/Commands/_expand_word
index 895695676..45173a4ba 100644
--- a/Completion/Commands/_expand_word
+++ b/Completion/Commands/_expand_word
@@ -2,8 +2,7 @@
 
 # Simple completion front-end implementing expansion.
 
-setopt localoptions nullglob rcexpandparam extendedglob unset
-unsetopt markdirs globsubst shwordsplit shglob ksharrays cshnullglob
+setopt localoptions $_comp_options
 
 local curcontext="$curcontext"
 
diff --git a/Completion/Commands/_history_complete_word b/Completion/Commands/_history_complete_word
index d4b06c2d2..c15cd427b 100644
--- a/Completion/Commands/_history_complete_word
+++ b/Completion/Commands/_history_complete_word
@@ -16,8 +16,7 @@
 #   range -- range of history words to complete
 
 _history_complete_word () {
-  setopt localoptions nullglob rcexpandparam extendedglob unset
-  unsetopt markdirs globsubst shwordsplit shglob ksharrays cshnullglob
+  setopt localoptions $_comp_options
 
   local expl direction stop curcontext="$curcontext"
   local max slice hmax=$#historywords
diff --git a/Completion/Commands/_next_tags b/Completion/Commands/_next_tags
index f60302c37..5d6b41e71 100644
--- a/Completion/Commands/_next_tags
+++ b/Completion/Commands/_next_tags
@@ -3,8 +3,7 @@
 # Main widget.
 
 _next_tags() {
-  setopt localoptions nullglob rcexpandparam extendedglob unset
-  unsetopt markdirs globsubst shwordsplit shglob ksharrays cshnullglob
+  setopt localoptions $_comp_options
 
   local ins ops="$PREFIX$SUFFIX"
 
diff --git a/Completion/Core/_main_complete b/Completion/Core/_main_complete
index 893930f7d..5c7484df4 100644
--- a/Completion/Core/_main_complete
+++ b/Completion/Core/_main_complete
@@ -16,8 +16,8 @@
 # which makes the output of setopt and unsetopt reflect a different
 # state than the global one for which you are completing.
 
-setopt localoptions nullglob rcexpandparam extendedglob unset
-unsetopt markdirs globsubst shwordsplit shglob ksharrays cshnullglob
+setopt localoptions $_comp_options
+
 exec </dev/null	# ZLE closes stdin, which can cause errors
 
 # Failed returns from this code are not real errors
diff --git a/Completion/Core/compinit b/Completion/Core/compinit
index de11c8f8c..338dc18ad 100644
--- a/Completion/Core/compinit
+++ b/Completion/Core/compinit
@@ -120,6 +120,21 @@ else
   _comp_dumpfile="${ZDOTDIR:-$HOME}/.zcompdump"
 fi
 
+# The standard options set in completion functions.
+
+_comp_options=(
+       nullglob
+       rcexpandparam
+       extendedglob
+       unset
+    NO_markdirs
+    NO_globsubst
+    NO_shwordsplit
+    NO_shglob
+    NO_ksharrays
+    NO_cshnullglob
+)
+
 # These can hold names of functions that are to be called before/after all
 # matches have been generated.