about summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Base/_first9
-rw-r--r--Completion/Commands/_history_complete_word6
-rw-r--r--Completion/User/_cvs2
-rw-r--r--Completion/User/_groups9
4 files changed, 20 insertions, 6 deletions
diff --git a/Completion/Base/_first b/Completion/Base/_first
index 694bb8c63..ba5ef6c24 100644
--- a/Completion/Base/_first
+++ b/Completion/Base/_first
@@ -35,7 +35,7 @@
 # and hitting TAB.
 #
 #     if [[ "$PREFIX" = *,, ]]; then
-#       local max i=1
+#       local max i=1 expl
 #     
 #       PREFIX="$PREFIX[1,-2]"
 #       # If a numeric prefix is given, we use it as the number of
@@ -50,7 +50,12 @@
 #       # We first search in the last ten lines, then in the last
 #       # twenty lines, and so on...
 #       while [[ i -le max ]]; do
-#         if compgen -X "%Bhistory ($n):%b" -Q -H $(( i*10 )) ''; then
+#         if [[ -n "$compconfig[history_sort]" ]]; then
+#           _description expl "history ($n)"
+#         else
+#           _description -V expl "history ($n)"
+#         fi
+#         if compgen "$expl[@]" -Q -H $(( i*10 )) ''; then
 #           # We have found at least one matching word, so we switch
 #           # on menu-completion and make sure that no other
 #           # completion function is called by setting _compskip.
diff --git a/Completion/Commands/_history_complete_word b/Completion/Commands/_history_complete_word
index b55966062..76cad470f 100644
--- a/Completion/Commands/_history_complete_word
+++ b/Completion/Commands/_history_complete_word
@@ -2,5 +2,9 @@
 
 local expl
 
-_description expl 'history word'
+if [[ -n "$compconfig[history_sort]" ]]; then
+  _description expl 'history word'
+else
+  _description -V expl 'history word'
+fi
 compgen "$expl[@]" -Q -H 0 ''
diff --git a/Completion/User/_cvs b/Completion/User/_cvs
index 66adf80df..f1324cfb2 100644
--- a/Completion/User/_cvs
+++ b/Completion/User/_cvs
@@ -468,7 +468,7 @@ _cvs_extract_file_entries () {
 
 builtin functions _cvs_extract_modifiedfile_entries >&- ||
 _cvs_extract_modifiedfile_entries () {
-  if [[ -n "$compconfig[_cvs_disable_stat]" ]] ||
+  if [[ -n "$compconfig[cvs_disable_stat]" ]] ||
     ! { zmodload -e stat || zmodload stat }; then
     _cvs_extract_file_entries
     return
diff --git a/Completion/User/_groups b/Completion/User/_groups
index 61f63596e..b867634c0 100644
--- a/Completion/User/_groups
+++ b/Completion/User/_groups
@@ -2,8 +2,13 @@
 
 local expl
 
-: ${(A)groups:=${${(s: :)$(</etc/group)}%%:*}}
-# : ${(A)groups:=${${(s: :)$(ypcat group.byname)}%%:*}} # If you use NIS
+if (( ! $+groups )); then
+  if whence -p ypcat > /dev/null; then
+    : ${(A)groups:=${${(s: :)$(ypcat group.byname)}%%:*}} # If you use NIS
+  else
+    : ${(A)groups:=${${(s: :)$(</etc/group)}%%:*}}
+  fi
+fi
 
 _description expl group
 compadd "$@" "$expl[@]" - $groups