about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-12-01 15:29:41 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-12-01 15:29:41 +0000
commitf844c87a4d676bcc8ad7ac24b5132d7aa5ccfeca (patch)
treec2a3b06a34243abe3826eead259bb08900f011f1
parent26cf7b8d50f1b7d9d0b9115018ef4dc8624b5030 (diff)
downloadzsh-f844c87a4d676bcc8ad7ac24b5132d7aa5ccfeca.tar.gz
zsh-f844c87a4d676bcc8ad7ac24b5132d7aa5ccfeca.tar.xz
zsh-f844c87a4d676bcc8ad7ac24b5132d7aa5ccfeca.zip
zsh-workers/8840
-rw-r--r--Completion/Base/_arguments4
-rw-r--r--Completion/Base/_brace_parameter26
-rw-r--r--Completion/Base/_describe2
-rw-r--r--Completion/Base/_first6
-rw-r--r--Completion/Base/_jobs6
-rw-r--r--Completion/Base/_subscript2
-rw-r--r--Completion/Base/_tilde2
-rw-r--r--Completion/Base/_values2
-rw-r--r--Completion/Builtins/_popd2
-rw-r--r--Completion/Commands/_history_complete_word4
-rw-r--r--Completion/Core/_alternative2
-rw-r--r--Completion/Core/_description24
-rw-r--r--Completion/Core/_files13
-rw-r--r--Completion/Core/_parameters76
-rw-r--r--Completion/Core/_path_files4
-rw-r--r--Completion/Core/_requested12
-rw-r--r--Completion/Core/_tags16
-rw-r--r--Completion/Core/_wanted12
-rw-r--r--Completion/Core/compinit3
-rw-r--r--Completion/Debian/_apt28
-rw-r--r--Completion/Linux/_rpm4
-rw-r--r--Completion/User/_bunzip22
-rw-r--r--Completion/User/_bzip22
-rw-r--r--Completion/User/_compress2
-rw-r--r--Completion/User/_dd4
-rw-r--r--Completion/User/_dvi2
-rw-r--r--Completion/User/_gdb8
-rw-r--r--Completion/User/_gprof6
-rw-r--r--Completion/User/_gs2
-rw-r--r--Completion/User/_gunzip2
-rw-r--r--Completion/User/_gzip2
-rw-r--r--Completion/User/_mh4
-rw-r--r--Completion/User/_mutt4
-rw-r--r--Completion/User/_netscape2
-rw-r--r--Completion/User/_nslookup10
-rw-r--r--Completion/User/_pack2
-rw-r--r--Completion/User/_pbm16
-rw-r--r--Completion/User/_pdf2
-rw-r--r--Completion/User/_ps2
-rw-r--r--Completion/User/_pspdf2
-rw-r--r--Completion/User/_ssh8
-rw-r--r--Completion/User/_strip2
-rw-r--r--Completion/User/_tar_archive2
-rw-r--r--Completion/User/_tex2
-rw-r--r--Completion/User/_tiff4
-rw-r--r--Completion/User/_uncompress2
-rw-r--r--Completion/User/_unpack2
-rw-r--r--Completion/User/_users_on2
-rw-r--r--Completion/X/_x_window4
-rw-r--r--Completion/X/_xmodmap2
-rw-r--r--Doc/Zsh/compsys.yo90
-rw-r--r--Etc/completion-style-guide32
-rw-r--r--Src/Zle/compcore.c19
53 files changed, 248 insertions, 249 deletions
diff --git a/Completion/Base/_arguments b/Completion/Base/_arguments
index 031ed90cf..0170ce307 100644
--- a/Completion/Base/_arguments
+++ b/Completion/Base/_arguments
@@ -194,7 +194,7 @@ if comparguments -i "$autod" "$@"; then
   while true; do
     while _tags; do
       if [[ -n "$matched" ]] || _requested arguments; then
-        _description expl "$descr"
+        _description arguments expl "$descr"
 
         if [[ "$action" = -\>* ]]; then
           comparguments -W line opt_args
@@ -268,7 +268,7 @@ if comparguments -i "$autod" "$@"; then
 	
         if comparguments -s single; then
 
-          _description expl option
+          _description options expl option
 
           if [[ "$single" = direct ]]; then
 	    compadd "$expl[@]" -QS '' - "${PREFIX}${SUFFIX}"
diff --git a/Completion/Base/_brace_parameter b/Completion/Base/_brace_parameter
index 2268b0068..a6892d944 100644
--- a/Completion/Base/_brace_parameter
+++ b/Completion/Base/_brace_parameter
@@ -1,29 +1,3 @@
 #compdef -brace-parameter-
 
 _tags parameters && _parameters -e
-
-
-# Without the `-e' option, we would use the following (see the file
-# Core/_parameters for more enlightenment).
-
-# local lp ls n q
-
-# if [[ "$SUFFIX" = *\}* ]]; then
-#   ISUFFIX="${SUFFIX#*\}}$ISUFFIX"
-#   SUFFIX="${SUFFIX%%\}*}"
-#   suf=()
-# elif [[ "$LBUFFER" = *\$\{[^}]#\$\{[^}]#$PREFIX ||
-#         "$compstate[insert]" = *menu* ]]; then
-#   suf=(-b '')
-# else
-#   suf=(-b ' ')
-# fi
-
-# lp="$LBUFFER[1,-${#PREFIX}-1]"
-# ls="$RBUFFER[${#SUFFIX}+1,-1]"
-# n=${(M)#ls##\"#}
-# q=${(M)lp%%\"#}
-
-# [[ n -gt 0 ]] && suf=''
-
-# _parameters "$suf[@]" -Qs "${q[1,-n-1]}" -r '-:?#%+=[/}'
diff --git a/Completion/Base/_describe b/Completion/Base/_describe
index 3d0d8507c..7be7ea29f 100644
--- a/Completion/Base/_describe
+++ b/Completion/Base/_describe
@@ -18,7 +18,7 @@ _tags "$_type" || return 1
 
 _style "$_type" verbose && _showd=yes
 
-_description _expl "$1"
+_description "$_type" _expl "$1"
 shift
 
 if [[ -n "$_showd" ]]; then
diff --git a/Completion/Base/_first b/Completion/Base/_first
index 0e281d061..6740c00c5 100644
--- a/Completion/Base/_first
+++ b/Completion/Base/_first
@@ -34,7 +34,7 @@
 # completion of words from the history by adding two commas at the end 
 # and hitting TAB.
 #
-#     if [[ "$PREFIX" = *,, ]]; then
+#     if [[ "$PREFIX" = *,, ]] && _tags history-words; then
 #       local max i=1 expl
 #     
 #       PREFIX="$PREFIX[1,-2]"
@@ -51,9 +51,9 @@
 #       # twenty words, and so on...
 #       while [[ i -le max ]]; do
 #         if _style history-words sort; then
-#           _description expl "history ($n)"
+#           _description history-words expl "history ($n)"
 #         else
-#           _description -V expl "history ($n)"
+#           _description -V history-words expl "history ($n)"
 #         fi
 #         if compadd "$expl[@]" -Q - \
 #                "${(@)${(@)historywords:#[\$'\"]*}[1,i*10]}"; then
diff --git a/Completion/Base/_jobs b/Completion/Base/_jobs
index 2a1b725b4..addc88607 100644
--- a/Completion/Base/_jobs
+++ b/Completion/Base/_jobs
@@ -11,15 +11,15 @@ _style jobs verbose       && desc=yes
 if [[ "$1" = -r ]]; then
   jids=( "${(@k)jobstates[(R)running*]}" )
   shift
-  _description expl 'running job'
+  _description jobs expl 'running job'
 elif [[ "$1" = -s ]]; then
   jids=( "${(@k)jobstates[(R)running*]}" )
   shift
-  _description expl 'suspended job'
+  _description jobs expl 'suspended job'
 else
   [[ "$1" = - ]] && shift
   jids=( "${(@k)jobtexts}" )
-  _description expl job
+  _description jobs expl job
 fi
 
 if [[ -n "$desc" ]]; then
diff --git a/Completion/Base/_subscript b/Completion/Base/_subscript
index cc3e9c435..21e62e8aa 100644
--- a/Completion/Base/_subscript
+++ b/Completion/Base/_subscript
@@ -19,7 +19,7 @@ elif [[ ${(Pt)${compstate[parameter]}} = array* ]]; then
   _tags indexes parameters
 
   while _tags; do
-    if _requested indexes -V expl 'array index'; then
+    if _requested -V indexes expl 'array index'; then
       ind=( {1..${#${(P)${compstate[parameter]}}}} )
       if _style indexes verbose; then
         list=()
diff --git a/Completion/Base/_tilde b/Completion/Base/_tilde
index d9eb0a887..4aceca6ce 100644
--- a/Completion/Base/_tilde
+++ b/Completion/Base/_tilde
@@ -21,7 +21,7 @@ while _tags; do
   _requested named-directories expl 'named directory' &&
       compadd "$suf[@]" "$expl[@]" "$@" - "${(@k)nameddirs}"
 
-  if _requested directory-stack -V expl 'directory stack' &&
+  if _requested -V directory-stack expl 'directory stack' &&
      { ! _style directory-stack prefix-needed ||
        [[ "$PREFIX" = [-+]* ]] }; then
     if _style directory-stack verbose; then
diff --git a/Completion/Base/_values b/Completion/Base/_values
index eded48363..f35aa5a9a 100644
--- a/Completion/Base/_values
+++ b/Completion/Base/_values
@@ -76,7 +76,7 @@ if compvalues -i "$@"; then
     return 1
   fi
 
-  _description expl "$descr"
+  _description arguments expl "$descr"
 
   # We add the separator character as a autoremovable suffix unless
   # we have only one possible value left.
diff --git a/Completion/Builtins/_popd b/Completion/Builtins/_popd
index e906571da..604bcecd5 100644
--- a/Completion/Builtins/_popd
+++ b/Completion/Builtins/_popd
@@ -9,7 +9,7 @@ setopt extendedglob nonomatch
 
 local expl list lines revlines disp
 
-_wanted directory-stack -V expl 'directory stack' || return 1
+_wanted -V directory-stack expl 'directory stack' || return 1
 
 ! _style directory-stack prefix-needed || [[ $PREFIX = [-+]* ]] || return 1
 
diff --git a/Completion/Commands/_history_complete_word b/Completion/Commands/_history_complete_word
index 07db1eeb9..c5438148d 100644
--- a/Completion/Commands/_history_complete_word
+++ b/Completion/Commands/_history_complete_word
@@ -69,9 +69,9 @@ _history_complete_word () {
 _history_complete_word_gen_matches () {
   if _style history-words list; then
     if _style history-words sort; then
-      _description expl 'history word'
+      _description history-words expl 'history word'
     else
-      _description -V expl 'history word'
+      _description -V history-words expl 'history word'
     fi
   else
     if _style history-words sort; then
diff --git a/Completion/Core/_alternative b/Completion/Core/_alternative
index 76a8380bc..9d30884ae 100644
--- a/Completion/Core/_alternative
+++ b/Completion/Core/_alternative
@@ -25,7 +25,7 @@ while _tags; do
       descr="${${def#*:}%%:*}"
       action="${def#*:*:}"
 
-      _description expl "$descr"
+      _description "${def%%:*}" expl "$descr"
 
       if [[ "$action" = \ # ]]; then
 
diff --git a/Completion/Core/_description b/Completion/Core/_description
index 8cd9cc2fb..54518e49f 100644
--- a/Completion/Core/_description
+++ b/Completion/Core/_description
@@ -1,27 +1,33 @@
 #autoload
 
-local gropt=-J format
+local gropt format gname
 
-if [[ "$1" = -[VJ]* ]]; then
-  gropt="$1"
+gropt=(-J)
+
+if [[ "$1" = -[VJ] ]]; then
+  gropt=("$1")
+  shift
+elif [[ "$1" = -[VJ] ]]; then
+  gropt=("-${1[3,-1]}" "${1[1,2]}")
   shift
 fi
 
-_lastdescr=( "$_lastdescr[@]" "$2" )
+_lastdescr=( "$_lastdescr[@]" "$3" )
 
 _style -s descriptions format format
+_style -s "$1" group-name gname && [[ -z "$gname" ]] && gname="$1"
 
-if _style matches group; then
+if [[ -n "$gname" ]]; then
   if [[ -n "$format" ]]; then
-    eval "$1=($gropt ${(q)2} -X ${(q)format//\\%d/$2})"
+    eval "$2=($gropt ${(q)gname} -X ${(q)format//\\%d/$3})"
   else
-    eval "$1=($gropt ${(q)2})"
+    eval "$2=($gropt ${(q)gname})"
   fi
 else
   if [[ -n "$format" ]]; then
-    eval "$1=(-X ${(q)format//\\%d/$2})"
+    eval "$2=(-J -default- -X ${(q)format//\\%d/$3})"
   else
-    eval "$1=()"
+    eval "$2=(-J -default-)"
   fi
 fi
 
diff --git a/Completion/Core/_files b/Completion/Core/_files
index ba5445797..9c5b45693 100644
--- a/Completion/Core/_files
+++ b/Completion/Core/_files
@@ -1,17 +1,24 @@
 #autoload
 
-local opts opt type=file
+local opts opt type=file group
 
 opts=()
+group=()
 while getopts "P:S:qr:R:W:F:J:V:X:f/g:M:" opt; do
   case "$opt" in
   /)    [[ "$type" = file       ]] && type=dir       ;;
   g)    [[ "$type" = (file|dir) ]] && type="$OPTARG" ;;
   q)    opts=("$opts[@]" -q               )          ;;
+  [JV]) group=(          "-$opt" "$OPTARG")          ;;
   [^f]) opts=("$opts[@]" "-$opt" "$OPTARG")          ;;
   esac
 done
 
+if [[ "$group[2]" = files ]]; then
+  opts=("$opts[@]" "$group[@]")
+  group=()
+fi
+
 case "$type" in
 file) _tags all-files                           ;;
 dir)  _tags directories all-files               ;;
@@ -20,15 +27,19 @@ esac
 
 while _tags; do
   if _requested all-files; then
+    (( $#group )) && group[2]=all-files
     _path_files "$opts[@]" -f
     return
   elif _requested directories; then
     if _requested globbed-files; then
+      (( $#group )) && group[2]=globbed-files
       _path_files "$opts[@]" -/g "$type" && return 0
     else
+      (( $#group )) && group[2]=directories
       _path_files "$opts[@]" -/ && return 0
     fi
   elif _requested globbed-files; then
+    (( $#group )) && group[2]=globbed-files
     _path_files "$opts[@]" -g "$type" && return 0
   fi
 done
diff --git a/Completion/Core/_parameters b/Completion/Core/_parameters
index 3735702df..c7875abcf 100644
--- a/Completion/Core/_parameters
+++ b/Completion/Core/_parameters
@@ -10,79 +10,3 @@ _wanted parameters expl parameter || return 1
 pars=( ${(k)parameters[(R)^*local*]} )
 
 compadd "$expl[@]" "$@" - $pars
-
-
-# The `-e' option does everything for parameter expansions of us. If
-# we wouldn't have it, we would use something like:
-
-# If the first argument is `-s' or `-b' auto_param_slash will be tested
-# and slashes will be added to parameters containing a directory. `-s' is
-# for parameter expansions without braces and `-b' is for expansions with
-# braces. A `-' as the first argument is ignored and in all cases all
-# other arguments will be given to `compadd'.
-
-# setopt localoptions extendedglob
-
-# local pars expl slash suf
-
-# if [[ "$1" = -s ]]; then
-#   slash=normal
-#   suf="$2"
-#   shift 2
-# elif [[ "$1" = -b ]]; then
-#   slash=brace
-#   suf="$2"
-#   shift 2
-# elif [[ "$1" = - ]]; then
-#   shift
-# fi
-
-# _description expl parameter
-
-# if [[ -n "$slash" && -o autoparamslash ]]; then
-#   local i dirs nodirs ret=1
-
-#   dirs=()
-#   nodirs=()
-
-#   if zmodload -e parameter; then
-#     setopt localoptions extendedglob
-#     nodirs=( ${(k)parameters[(R)undefined]} )
-#     pars=( ${(k)parameters[(R)^*(local|undefined)*]} )
-#   else
-#     nodirs=( ${${(M)${(f)"$(typeset +)"}:#undefined *}##* } )
-#     pars=( ${${${(f)"$(typeset +)"}:#*(local|undefined) *}##* } )
-#   fi
-
-#   for i in $pars; do
-#     if [[ -d "${(P)i}" ]]; then
-#       dirs=( $dirs $i )
-#     else
-#       nodirs=( $nodirs $i )
-#     fi
-#   done
-
-#   if [[ "$slash" = normal ]]; then
-#     compadd -S "/${suf%% #}" -r ' [/:' "$expl[@]" "$@" - $dirs && ret=0
-#     compadd -S "$suf" -r ' [:' "$expl[@]" "$@" - $nodirs && ret=0
-#   elif [[ "$slash" = brace ]]; then
-#     compadd -S "}/${suf%% #}" -r '-:?#%+=[/}' "$expl[@]" "$@" - $dirs && ret=0
-#     compadd -S "}$suf" -r '-:?#%+=[/}' "$expl[@]" "$@" - $nodirs && ret=0
-#   fi
-
-#   return ret
-# else
-#   if zmodload -e parameter; then
-#     pars=( ${(k)parameters[(R)^*local*]} )
-#   else
-#     pars=( ${${${(f)"$(typeset +)"}:#*local *}##* } )
-#   fi
-
-#   if [[ "$slash" = normal ]]; then
-#     compadd -S "$suf" -r ' [:' "$expl[@]" "$@" - $pars
-#   elif [[ "$slash" = brace ]]; then
-#     compadd -S "}$suf" -r '-:?#%+=[/}' "$expl[@]" "$@" - $pars
-#   else
-#     compadd "$expl[@]" "$@" - $pars
-#   fi
-# fi
diff --git a/Completion/Core/_path_files b/Completion/Core/_path_files
index 71ee3b218..2367def63 100644
--- a/Completion/Core/_path_files
+++ b/Completion/Core/_path_files
@@ -77,9 +77,9 @@ done
 
 if (( ! ( $#group + $#expl ) )); then
   if [[ "$sopt" = -/ ]]; then
-    _description expl directory
+    _description directories expl directory
   else
-    _description expl file
+    _description files expl file
   fi
 fi
 
diff --git a/Completion/Core/_requested b/Completion/Core/_requested
index 6641afdcf..3bc6f3b40 100644
--- a/Completion/Core/_requested
+++ b/Completion/Core/_requested
@@ -1,9 +1,17 @@
 #autoload
 
+local tag
+
+if [[ "$1" = -[VJ]* ]]; then
+  tag="$2"
+else
+  tag="$1"
+fi
+
 comptags -C _cur_context
 
-comptags -R "$1" &&
+comptags -R "$tag" &&
     if [[ $# -gt 1 ]]; then
-      _description "${(@)argv[2,-1]}"
+      _description "$@"
       return 0
     fi
diff --git a/Completion/Core/_tags b/Completion/Core/_tags
index 5294ab3c7..5519cc6cf 100644
--- a/Completion/Core/_tags
+++ b/Completion/Core/_tags
@@ -4,7 +4,7 @@ if (( $# )); then
 
   # We have arguments: the tags supported in this context.
 
-  local curcontext="$curcontext"
+  local curcontext="$curcontext" order
 
   if [[ "$1" = -C?* ]]; then
     curcontext="${curcontext}:${1[3,-1]}"
@@ -18,6 +18,20 @@ if (( $# )); then
 
   [[ "$1" = -(|-) ]] && shift
 
+
+  if _style -a '' group-order order; then
+    local name
+
+    for name in "$order[@]"; do
+      compadd -J "$name"
+      compadd -V "$name"
+      compadd -J "$name" -1
+      compadd -V "$name" -1
+      compadd -J "$name" -2
+      compadd -V "$name" -2
+    done
+  fi
+
   # Set and remember offered tags.
 
   comptags -i "$curcontext" "$@"
diff --git a/Completion/Core/_wanted b/Completion/Core/_wanted
index 7baa3e724..f95d74451 100644
--- a/Completion/Core/_wanted
+++ b/Completion/Core/_wanted
@@ -1,6 +1,6 @@
 #autoload
 
-local targs
+local targs tag
 
 if [[ "$1" = -C?* ]]; then
   targs=( -C "${1[3,-1]}" )
@@ -12,10 +12,14 @@ else
   targs=()
 fi
 
-[[ "$1" = -(|-) ]] && shift
+if [[ "$1" = -[VJ]* ]]; then
+  tag="$2"
+else
+  tag="$1"
+fi
 
 if [[ $# -gt 1 ]]; then
-  _tags "$targs[@]" "$1" && _description "${(@)argv[2,-1]}"
+  _tags "$targs[@]" "$tag" && _description "$@"
 else
-  _tags "$targs[@]" "$1"
+  _tags "$targs[@]" "$tag"
 fi
diff --git a/Completion/Core/compinit b/Completion/Core/compinit
index 746b6c4d4..b313edede 100644
--- a/Completion/Core/compinit
+++ b/Completion/Core/compinit
@@ -326,6 +326,7 @@ your setup should be available in the file:
 
     \`${HOME}/.zsh-styles'
 
+Note that the values for the style may not be fully correct.
 
 Have fun
 
@@ -373,7 +374,7 @@ Have fun
 compstyle '*:options' prefix-hidden yes"
       ;;    
     group_matches)
-      tmp="'*:matches' group 'yes'"
+      tmp="'*' group-name ''"
       ;;
     colors_path)
       tmp="'*:colors' path ${(qq)val}"
diff --git a/Completion/Debian/_apt b/Completion/Debian/_apt
index 72b28e907..80f9d8ab6 100644
--- a/Completion/Debian/_apt
+++ b/Completion/Debian/_apt
@@ -325,9 +325,9 @@ _describe -o option tmp2 -- tmp3 -S='
     bool_prefix=($bool_prefix)
 
     local expl_opt expl_bool expl_configfile
-    _description expl_opt option
-    _description expl_bool 'bool value'
-    _description expl_configfile 'config file'
+    _description options expl_opt option
+    _description values expl_bool 'boolean value'
+    _description files expl_configfile 'config file'
 
     local current_option tmp1 tmp2 tmp3
 
@@ -388,8 +388,8 @@ _apt-get () {
 
   _apt-get () {
     local expl_action expl_packages
-    _description expl_action 'action'
-    _description expl_packages 'package'
+    _description actions expl_action 'action'
+    _description packages expl_packages 'package'
 
     _apt-get_sm
   }
@@ -426,10 +426,10 @@ _apt-cache () {
 
   _apt-cache () {
     local expl_action expl_packages expl_pkg_cache expl_src_cache
-    _description expl_action 'action'
-    _description expl_packages 'package'
-    _description expl_pkg_cache 'package cache'
-    _description expl_src_cache 'source cache'
+    _description actions expl_action 'action'
+    _description packages expl_packages 'package'
+    _description files expl_pkg_cache 'package cache'
+    _description files expl_src_cache 'source cache'
 
     _apt-cache_sm
   }
@@ -455,8 +455,8 @@ _apt-cdrom () {
 
   _apt-cdrom () {
     local expl_action expl_mount_point
-    _description expl_action 'action'
-    _description expl_mount_point 'mount point'
+    _description actions expl_action 'action'
+    _description files expl_mount_point 'mount point'
 
     _apt-cdrom_sm
   }
@@ -481,9 +481,9 @@ _apt-config () {
 
   _apt-config () {
     local expl_action expl_shell_var expl_config_key
-    _description expl_action 'action'
-    _description expl_shell_var 'shell variable to assign'
-    _description expl_config_key 'configuration key'
+    _description actions expl_action 'action'
+    _description parameters expl_shell_var 'shell variable to assign'
+    _description configuration-keys expl_config_key 'configuration key'
 
     _apt-config_sm
   }
diff --git a/Completion/Linux/_rpm b/Completion/Linux/_rpm
index b31ea656f..fae8612a8 100644
--- a/Completion/Linux/_rpm
+++ b/Completion/Linux/_rpm
@@ -213,9 +213,9 @@ while [[ -n "$state" ]]; do
     ;;
   relocate)
     if compset -P '*\='; then
-      _description expl 'new path'
+      _description directories expl 'new path'
     else
-      _description expl 'old path'
+      _description directories expl 'old path'
     fi
 
     _tags directories || return 1
diff --git a/Completion/User/_bunzip2 b/Completion/User/_bunzip2
index 53f4388bc..48e56bf0f 100644
--- a/Completion/User/_bunzip2
+++ b/Completion/User/_bunzip2
@@ -2,5 +2,5 @@
 
 local expl
 
-_description expl 'compressed file'
+_description files expl 'compressed file'
 _files "$expl[@]" -g '*.bz2'
diff --git a/Completion/User/_bzip2 b/Completion/User/_bzip2
index 15dd6f090..0abdf4daa 100644
--- a/Completion/User/_bzip2
+++ b/Completion/User/_bzip2
@@ -2,5 +2,5 @@
 
 local expl
 
-_description expl 'file to compress'
+_description files expl 'file to compress'
 _files "$expl[@]" -g '*~*.bz2'
diff --git a/Completion/User/_compress b/Completion/User/_compress
index 24363be07..ccffeaeef 100644
--- a/Completion/User/_compress
+++ b/Completion/User/_compress
@@ -2,5 +2,5 @@
 
 local expl
 
-_description expl 'file to compress'
+_description files expl 'file to compress'
 _files "$expl[@]" -g '*~*.Z'
diff --git a/Completion/User/_dd b/Completion/User/_dd
index 3a980b48d..fb78f194a 100644
--- a/Completion/User/_dd
+++ b/Completion/User/_dd
@@ -10,10 +10,10 @@ if compset -P 1 'conv\='; then
       compadd "$expl[@]" -qS, -q \
               ascii ebcdic ibm block unblock lcase ucase swab noerror sync
 elif compset -P 1 'if\='; then
-  _description expl 'input file'
+  _description files expl 'input file'
   _files "$expl[@]"
 elif compset -P 1 'of\='; then
-  _description expl 'output file'
+  _description files expl 'output file'
   _files "$expl[@]"
 else
   _wanted values expl option &&
diff --git a/Completion/User/_dvi b/Completion/User/_dvi
index 4d36e237e..40794e246 100644
--- a/Completion/User/_dvi
+++ b/Completion/User/_dvi
@@ -89,7 +89,7 @@ dvitodvi)
     "$args[@]"
   ;;
 *)
-  _description expl 'DVI file'
+  _description files expl 'DVI file'
   _files "$expl[@]" -g '*.(dvi|DVI)'
   ;;
 esac
diff --git a/Completion/User/_gdb b/Completion/User/_gdb
index d037b83d9..a095370ab 100644
--- a/Completion/User/_gdb
+++ b/Completion/User/_gdb
@@ -12,7 +12,7 @@ if compset -P '-(cd|directory)='; then
 elif compset -P '-tty='; then
   _wanted devices expl 'terminal device' && compadd "$expl[@]" - /dev/tty*
 elif compset -P '-(exec|se)='; then
-  _description expl executable
+  _description files expl executable
   _files "$expl[@]" -g '*(*)'
 elif compset -P '-(symbols|core|command)='; then
   _files
@@ -29,9 +29,9 @@ else
   case "$prev" in
   (-d)     _files -/ && return 0 ;;
   (-[csx]) _files && return 0 ;;
-  (-e)     _description expl executable
+  (-e)     _description files expl executable
            _files "$expl[@]" -g '*(*)' && return 0 ;;
-  (-b)     _wanted values expl -V expl 'baud rate' &&
+  (-b)     _wanted -V values expl 'baud rate' &&
                compadd "$expl[@]" 0 50 75 110 134 150 200 300 600 1200 1800 \
 			          2400 4800 9600 19200 38400 57600 115200 \
 			          230400 && return 0 ;;
@@ -46,7 +46,7 @@ else
   if [[ $#w -gt 1 ]]; then
     _alternative 'files:: _files' "processes:: _pids -m ${w[1]:t}"
   else
-    _description expl executable
+    _description files expl executable
     _files "$expl[@]" -g '*(*)'
   fi
 fi
diff --git a/Completion/User/_gprof b/Completion/User/_gprof
index a69a078ba..80de70bb4 100644
--- a/Completion/User/_gprof
+++ b/Completion/User/_gprof
@@ -41,12 +41,12 @@ if [[ -n "$state" ]]; then
   
     if [[ -n "$pair" ]]; then
       if compset -P '*/'; then
-        _description expl 'call arc to function'
+        _description functions expl 'call arc to function'
       else
-        _description expl 'call arc from function'
+        _description functions expl 'call arc from function'
       fi
     else
-      _description expl function
+      _description functions expl function
     fi
     compadd "$expl[@]" -M 'r:|_=* r:|=*' - "$_gprof_funcs[@]" && ret=0
   else
diff --git a/Completion/User/_gs b/Completion/User/_gs
index 14f544425..35a1d5388 100644
--- a/Completion/User/_gs
+++ b/Completion/User/_gs
@@ -39,7 +39,7 @@ else
             compadd "$expl[@]" - "${(@)${=${$(gs -h)##* devices:}%%Search path:*}:#}" && ret=0
         ;;
       *OutputFile\=)
-        _description expl 'output file'
+        _description files expl 'output file'
         _files "$expl[@]" && ret=0
         ;;
       *)
diff --git a/Completion/User/_gunzip b/Completion/User/_gunzip
index 78e62c4cc..9c512bd30 100644
--- a/Completion/User/_gunzip
+++ b/Completion/User/_gunzip
@@ -2,5 +2,5 @@
 
 local expl
 
-_description expl 'compressed file'
+_description files expl 'compressed file'
 _files "$expl[@]" -g '*.[gG][z]'
diff --git a/Completion/User/_gzip b/Completion/User/_gzip
index 07b51dead..e87682666 100644
--- a/Completion/User/_gzip
+++ b/Completion/User/_gzip
@@ -2,5 +2,5 @@
 
 local expl
 
-_description expl 'file to compress'
+_description files expl 'file to compress'
 _files "$expl[@]" -g '*~*.[gG][zZ]'
diff --git a/Completion/User/_mh b/Completion/User/_mh
index e4d042dc2..bdd4c74b3 100644
--- a/Completion/User/_mh
+++ b/Completion/User/_mh
@@ -36,7 +36,7 @@ elif compset -P 1 '[+@]' || [[ "$prev" = -draftfolder ]]; then
   fi
 
   # painless, or what?
-  _description expl 'MH folder'
+  _description files expl 'MH folder'
   _path_files "$expl[@]" -W mhpath -/
 elif [[ "$prev" = -(editor|(whatnow|rmm|show|more)proc) ]]; then
   _command_names -e
@@ -50,7 +50,7 @@ elif [[ "$prev" = -(form|audit|filter) ]]; then
   [[ -d $mhlib ]] || { mhlib=$(mhparam mhlproc); mhlib=$mhlib:h; }
   mhfpath=($mymhdir $mhlib)
 
-  _description expl 'MH template file'
+  _description files expl 'MH template file'
   _files "$expl[@]" -W mhfpath -g '*(.)'
 elif [[ "$prev" = -(no|)cc ]]; then
   _wanted -C "$prev" values expl 'CC address' &&
diff --git a/Completion/User/_mutt b/Completion/User/_mutt
index 98c59b2e0..c2af49107 100644
--- a/Completion/User/_mutt
+++ b/Completion/User/_mutt
@@ -28,10 +28,10 @@ if [[ "$state" = userhost ]]; then
   _tags hosts || return 1
 
   if compset -P '*@'; then
-    _description expl 'remote host name'
+    _description hosts expl 'remote host name'
     _hosts "$expl[@]" -q -S, && return 0
   else
-    _description expl 'login name'
+    _description users expl 'login name'
     _users "$expl[@]" -q -S@ && return 0
    fi
  fi
diff --git a/Completion/User/_netscape b/Completion/User/_netscape
index 9dc3873a0..23601de12 100644
--- a/Completion/User/_netscape
+++ b/Completion/User/_netscape
@@ -78,7 +78,7 @@ if [[ "$state" = "urls" ]]; then
             license logo memory-cache mozilla plugins && ret=0
   else
     if _tags prefixes; then
-      _description expl 'URL prefix'
+      _description prefixes expl 'URL prefix'
       compadd "$expl[@]" -S '' about: mocha: javascript:
       _urls "$@" && ret=0
     fi
diff --git a/Completion/User/_nslookup b/Completion/User/_nslookup
index 13500ff2c..1aeae4306 100644
--- a/Completion/User/_nslookup
+++ b/Completion/User/_nslookup
@@ -66,9 +66,9 @@ if [[ -n "$compcontext" ]]; then
       _message "redirection not allowed for command \`$words[1]'"
       return 1
     elif [[ "$compstate[redirect]" = '>' ]]; then
-      _description expl 'write to file'
+      _description files expl 'write to file'
     elif [[ "$compstate[redirect]" = '>>' ]]; then
-      _description expl 'append to file'
+      _description files expl 'append to file'
     else
       _message "unknown redirection operator \`$compstate[redirect]'"
       return 1
@@ -107,7 +107,7 @@ if [[ -n "$compcontext" ]]; then
     return
     ;;
   view)
-    _description expl 'view file'
+    _description files expl 'view file'
     _files "$expl[@]"
     return
     ;;
@@ -144,9 +144,9 @@ if [[ -n "$state" ]]; then
   _tags hosts || return 1
 
   if compset -P '*/'; then
-    _description expl 'search list entry'
+    _description hosts expl 'search list entry'
   else
-    _description expl 'default domain name and first search list entry'
+    _description hosts expl 'default domain name and first search list entry'
   fi
   if [[ -n "$_vals_cache_multi" ]]; then
     _hosts "$expl[@]" -qS/ -r "/\\- \\t\\n$_vals_cache_multi"
diff --git a/Completion/User/_pack b/Completion/User/_pack
index a15cfa709..39539ee61 100644
--- a/Completion/User/_pack
+++ b/Completion/User/_pack
@@ -2,5 +2,5 @@
 
 local expl
 
-_description expl 'file to compress'
+_description files expl 'file to compress'
 _files "$expl[@]" -g '*~*.z'
diff --git a/Completion/User/_pbm b/Completion/User/_pbm
index 9eecd0390..7eff60c69 100644
--- a/Completion/User/_pbm
+++ b/Completion/User/_pbm
@@ -18,7 +18,7 @@ fi
   
 if [[ $# -ne 0 || $+_in_pbm -ne 0 ]]; then
   if (( ! $# )); then
-    _description expl 'picture file'
+    _description files expl 'picture file'
     set -- "$expl[@]"
   fi
   _files "$@" -g "$pat" || _files "$@" -g '*.(#i)p[bgp]m'
@@ -258,7 +258,7 @@ pgmtoppm)
   
     return ret
   elif [[ CURRENT -eq 3 && "$words[2]" = -map ]]; then
-    _description expl 'map file'
+    _description files expl 'map file'
     _files "$expl[@]" -g '*.(#i)ppm'
   else
     _pbm
@@ -516,9 +516,9 @@ ppmchange)
   _pbm && ret=0
   
   if (( CURRENT & 1 )); then
-    _description expl 'new color'
+    _description colors expl 'new color'
   else
-    _description expl 'old color'
+    _description colors expl 'old color'
   fi
   
   _x_color "$expl[@]" && ret=0
@@ -600,7 +600,7 @@ ppmquant)
   
     return ret
   elif [[ CURRENT -eq 3 && "$words[2]" = -map ]]; then
-    _description expl 'map file'
+    _description files expl 'map file'
     _files "$expl[@]" -g '*.(#i)ppm'
   else
     _pbm
@@ -742,7 +742,7 @@ rgb3toppm)
   fi
   
   if [[ -n "$expl" ]]; then
-    _description expl "$expl"
+    _description files expl "$expl"
     _files "$expl" -g '*.(#i)pgm'
   fi
   ;;
@@ -772,7 +772,7 @@ zeisstopnm)
   _arguments '(-pgm -ppm)'-p{g,p}m ':file: _pbm'
   ;;
 
-*) 
-  _description expl 'picture file'
+*)
+  _description files expl 'picture file'
   _files "$expl[@]" -g "$pat" || _files "$expl[@]" -g '*.(#i)p[bgp]m'
 esac
diff --git a/Completion/User/_pdf b/Completion/User/_pdf
index 795e8545b..efc511669 100644
--- a/Completion/User/_pdf
+++ b/Completion/User/_pdf
@@ -7,5 +7,5 @@ local expl
 # xpdf:
 #  pdfimages pdfinfo pdftopbm pdftops pdftotext xpdf
 
-_description expl 'PDF file'
+_description files expl 'PDF file'
 _files "$expl[@]" -g '*.(#i)pdf'
diff --git a/Completion/User/_ps b/Completion/User/_ps
index 086443586..c8d1bd53a 100644
--- a/Completion/User/_ps
+++ b/Completion/User/_ps
@@ -9,5 +9,5 @@ local expl
 #  fixscribeps fixtpps fixwfwps fixwpps fixwwps includeres psbook psmerge
 #  psnup psresize psselect pstops
 
-_description expl 'postscript file'
+_description files expl 'postscript file'
 _files "$expl[@]" -g '*.(#i)(ps|eps)'
diff --git a/Completion/User/_pspdf b/Completion/User/_pspdf
index b4dadb3d0..7dbccbf48 100644
--- a/Completion/User/_pspdf
+++ b/Completion/User/_pspdf
@@ -6,7 +6,7 @@ local ret=1 expl
 #  gs gsbj gsdj gsdj500 gslj gslp gsnd ps2ascii
 
 _ps && ret=0
-_description expl 'PDF file'
+_description files expl 'PDF file'
 _path_files "$expl[@]" -g '*.(#i)pdf'
 
 return ret
diff --git a/Completion/User/_ssh b/Completion/User/_ssh
index 4318caf96..9b07a62cf 100644
--- a/Completion/User/_ssh
+++ b/Completion/User/_ssh
@@ -57,7 +57,7 @@ _ssh () {
                     ret=0
             ;;
           *(#i)globalknownhostsfile*)
-            _description expl 'global file with known hosts'
+            _description files expl 'global file with known hosts'
             _files "$expl[@]" && ret=0
             ;;
           *(#i)hostname*)
@@ -65,7 +65,7 @@ _ssh () {
                 _ssh_hosts "$expl[@]" && ret=0
             ;;
           *(#i)identityfile*)
-            _description expl 'SSH identity file'
+            _description files expl 'SSH identity file'
             _files "$expl[@]" && ret=0
             ;;
           *(#i)(local|remote)forward*)
@@ -82,7 +82,7 @@ _ssh () {
 	        compadd "$expl[@]" yes no ask
             ;;
           *(#i)userknownhostsfile*)
-            _description expl 'user file with known hosts'
+            _description files expl 'user file with known hosts'
             _files "$expl[@]" && ret=0
             ;;
           *(#i)user*)
@@ -90,7 +90,7 @@ _ssh () {
                 _ssh_users "$expl[@]" && ret=0
             ;;
           *(#i)xauthlocation*)
-            _description expl 'xauth program'
+            _description files expl 'xauth program'
             _files "$expl[@]" -g '*(*)' && ret=0
             ;;
           esac
diff --git a/Completion/User/_strip b/Completion/User/_strip
index 529176fdd..378eafe99 100644
--- a/Completion/User/_strip
+++ b/Completion/User/_strip
@@ -2,5 +2,5 @@
 
 local expl
 
-_description expl executable
+_description files expl executable
 _files "$expl[@]" -g '*(*)'
diff --git a/Completion/User/_tar_archive b/Completion/User/_tar_archive
index 9ddf434f5..2c2696481 100644
--- a/Completion/User/_tar_archive
+++ b/Completion/User/_tar_archive
@@ -11,7 +11,7 @@ local expl
 
 [[ $# -eq 0 && $+_tar_cmd -ne 0 ]] && set "$_tar_cmd"
 
-_description expl 'archive file'
+_description files expl 'archive file'
 
 if [[ "$1" = *[tx]* ]]; then
   if [[ "$1" = *[zZ]* ]]; then
diff --git a/Completion/User/_tex b/Completion/User/_tex
index d270c785a..4775d1bbc 100644
--- a/Completion/User/_tex
+++ b/Completion/User/_tex
@@ -2,5 +2,5 @@
 
 local expl
 
-_description expl 'TeX or LaTeX file'
+_description files expl 'TeX or LaTeX file'
 _files "$expl[@]" -g '*.(tex|TEX|texinfo|texi)'
diff --git a/Completion/User/_tiff b/Completion/User/_tiff
index 27ab33227..a0fb0d4b4 100644
--- a/Completion/User/_tiff
+++ b/Completion/User/_tiff
@@ -10,7 +10,7 @@ fi
 
 if [[ $# -ne 0 || $+_in_tiff -ne 0 ]]; then
   if (( ! $# )); then
-    _description expl 'picture file'
+    _description files expl 'picture file'
     set -- "$expl[@]"
   fi
   _path_files "$@" -g "$pat" || _files "$@" -g '*.(#i)tiff'
@@ -166,7 +166,7 @@ pal2rgb)
     ':output file:_files -g \*.\(\#i\)tiff' && ret=0
   ;;
 *)
-  _description expl 'picture file'
+  _description files expl 'picture file'
   _files "$expl[@]" -g "$pat" && ret=0
 esac
 
diff --git a/Completion/User/_uncompress b/Completion/User/_uncompress
index f352ca15a..a0ac14484 100644
--- a/Completion/User/_uncompress
+++ b/Completion/User/_uncompress
@@ -2,5 +2,5 @@
 
 local expl
 
-_description expl 'compressed file'
+_description files expl 'compressed file'
 _files "$expl[@]" -g '*.Z'
diff --git a/Completion/User/_unpack b/Completion/User/_unpack
index fb8867560..7345c2e94 100644
--- a/Completion/User/_unpack
+++ b/Completion/User/_unpack
@@ -2,5 +2,5 @@
 
 local expl
 
-_description expl 'compressed file'
+_description files expl 'compressed file'
 _files "$expl[@]" -g '*.z'
diff --git a/Completion/User/_users_on b/Completion/User/_users_on
index 3d35af02b..0589e7059 100644
--- a/Completion/User/_users_on
+++ b/Completion/User/_users_on
@@ -5,7 +5,7 @@ local expl
 _tags users || return 1
 
 if which users >/dev/null; then
-  _description expl 'users logged on'
+  _description users expl 'users logged on'
   compadd "$@" "$expl[@]" - $(users) && return 0
 else
   # Other methods of finding out users logged on should be added here
diff --git a/Completion/X/_x_window b/Completion/X/_x_window
index bf0ad4d33..139210f32 100644
--- a/Completion/X/_x_window
+++ b/Completion/X/_x_window
@@ -9,11 +9,11 @@ list=( "${(@)${(M@)${(@f)$(xwininfo -root -tree)}:#[ 	]#0x[0-9a-f]# \"*}##[ 	]#}
 if [[ "$1" = -n ]]; then
   shift
 
-  _description expl 'window name'
+  _description windows expl 'window name'
   compadd "$@" "$expl[@]" -d list - "${(@)${(@)list#*\"}%%\"*}"
 else
   [[ "$1" = - ]] && shift
 
-  _description expl 'window ID'
+  _description windows expl 'window ID'
   compadd "$@" "$expl[@]" -d list - "${(@)list%% *}"
 fi
diff --git a/Completion/X/_xmodmap b/Completion/X/_xmodmap
index e1594b949..da0029a16 100644
--- a/Completion/X/_xmodmap
+++ b/Completion/X/_xmodmap
@@ -55,7 +55,7 @@ if [[ -n "$state" ]]; then
     pointer*)
       if compset -P '*=[ 	]#'; then
         compset -P '*[ 	]'
-        _description expl 'button code'
+        _description values expl 'button code'
         compadd "$expl[@]" -qS ' ' 1 2 3 4 5 default
         return
       else
diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo
index ee194e592..fcfd77cc0 100644
--- a/Doc/Zsh/compsys.yo
+++ b/Doc/Zsh/compsys.yo
@@ -473,7 +473,7 @@ simple and a verbose form and use the tt(verbose) style to decide
 which form should be used. To make all such functions always use the
 verbose form one can simply call
 
-example(compstyle '*' description yes)
+example(compstyle '*' verbose yes)
 
 in one of the startup files like tt(.zshrc) (after the call to the
 tt(compinit) function). This definition simply means that the
@@ -486,7 +486,7 @@ and the command lines of the processes (the latter is achieved by
 calling the tt(ps) command). To make this builtin list the matches
 only as numbers one could call:
 
-example(compstyle '*::kill:*' description no)
+example(compstyle '*::kill:*' verbose no)
 
 And if one wants to see the command lines for processes but not the
 job texts one could use the fact that the tag name is appended to the
@@ -494,7 +494,7 @@ context name when styles are looked up and instead of the previous
 call use (remember that the function for the tt(kill) builtin command
 uses the tags tt(jobs) and tt(processes)): 
 
-example(compstyle '*::kill:*:jobs' description no)
+example(compstyle '*::kill:*:jobs' verbose no)
 
 As said above, the patterns given to the tt(compstyle) function are
 tested in the order in which they were given. But that isn't
@@ -634,9 +634,6 @@ for names of manual pages
 item(tt(maps))(
 for map names (e.g. YP maps)
 )
-item(tt(matches))(
-used to look up the tt(group) style
-)
 item(tt(messages))(
 used to look up the tt(format) style for messages
 )
@@ -809,11 +806,6 @@ generating filenames as matches to find out if the cursor will be left
 after the first ambiguous pathname component even when menucompletion
 is used.
 )
-item(tt(verbose))(
-This is used in several contexts to decide if only a simple or a
-verbose list of matches should be generated. For example some commands 
-show descriptions for option names if this style is true.
-)
 item(tt(disable-stat))(
 This is used with the tt(cvs) tag by the function completing for the
 tt(cvs) command to decide if the tt(stat) module should be used to
@@ -848,10 +840,47 @@ The value is used like the one for tt(complete) and if it evaluates to
 substitution (see the tt(substitute) style) or the original string
 from the line.
 )
-item(tt(group))(
-This is used with the tt(matches) tag. If it is `true', matches of
-different types will be put in different groups, so that they are
-listed separately and not mixed when using menu completion.
+item(tt(group-name))(
+The completion system can put different types of matches in different
+groups which are then displayed separately in the list of possible
+completions. This style can be use to give the names for these groups
+for particular tags. For example, in command position the completion
+system generates names of builtin and external commands, names of
+aliases and shell functions and reserved words as possible
+completions. To have the external commands and shell functions listed
+separately, one can set:
+
+example(compstyle '*:-command-:commands' group-name commands
+compstyle '*:-command-:functions' group-name functions)
+
+This also means that if the same name is used for different types of
+matches, then those matches will be displayed together in the same
+group.
+
+If the name given is the empty string, then the name of the tag for
+the matches will be used as the name of the group. So, to have all
+different types of matches displayed separately, one can just set:
+
+example(compstyle '*' group-name '')
+
+All matches for which no group name is defined will be put in a group
+named `tt(-default-)'.
+)
+item(tt(group-order))(
+This style is to be used together with the tt(group-name) style. Once
+different types of matches are put into different groups, this style
+can be used to define in which order these groups should appear in the 
+list. The strings in the value are taken as group names and the named
+groups will be shown in the order in which their names appear in the
+value. All groups whose names are not given in the value of this style 
+will appear in the order defined by the function generating the
+matches.
+
+For example, to have names of builtin commands, shell functions and
+external commands appear in this order when completing in command
+position one would set:
+
+example(compstyle '*:-command-' group-order builtins functions commands)
 )
 item(tt(groups))(
 A style holding the names of the groups that should be completed. If
@@ -1149,6 +1178,11 @@ commands such as tt(talk) and tt(finger) and should contain other
 people's accounts. Finally, this may also used by some commands with
 the tt(accounts) tag.
 )
+item(tt(verbose))(
+This is used in several contexts to decide if only a simple or a
+verbose list of matches should be generated. For example some commands 
+show descriptions for option names if this style is true.
+)
 item(tt(word))(
 To find out if listing should be performed on its own, the tt(_list)
 completer normally compares the contents of the line with the contents
@@ -1549,25 +1583,27 @@ one can write a pattern completion function that keeps other functions
 from being tried simply by setting this parameter to any value.
 )
 item(tt(_description))(
-This function gets two arguments: the name of an array and a
+This function gets two or three arguments: a group name,
+the name of an array and a
 string. It tests if the style tt(format) for the tt(descriptions) tag is
 set and if it is, it stores some options in the array that can then be 
 given to the tt(compadd) builtin command to make the
 value of the tt(format) style for the tt(descriptions) tag (with the
-sequence `tt(%d)' replaced by the string given as the second argument)
+sequence `tt(%d)' replaced by the string given as the last argument)
 be displayed above the matches added. These options also will make
-sure that the matches are placed in a separate group (the second
-argument is used as the name of the group) if the style tt(group) for
-the tt(matches) tag is set to a non-empty string. Normally a sorted
+sure that the matches are placed in a separate group if the style
+tt(group) for the tt(matches) tag is set to `true'. The first argument 
+will be used as the name of the group and should in most cases be the
+name of a tag. Normally a sorted
 group will be used for this (with the `tt(-J)' option), but if a
 option starting with `tt(-V)' or `tt(-J)' is given, that option will
 be included in the array, so that it is possible to make the group
-unsorted by given the option `tt(-V)', `tt(-V1)', or `tt(-V2)'.
+unsorted by giving the option `tt(-V)', `tt(-V1)', or `tt(-V2)'.
 
 In most cases, this function will be used like this:
 
 example(local expl
-_description expl file
+_description expl file  # same as `files expl file'
 compadd "$expl[@]" - "$files[@]")
 )
 item(tt(_message))(
@@ -1621,8 +1657,10 @@ and if that tag is currently requested, the return value is zero (and
 non-zero otherwise).
 
 If more than one argument is given, tt(_requested) calls the
-tt(_description) function with all arguments except the first
-one. This is often useful to do both the testing of the tag and
+tt(_description) function with all arguments and if the first argument 
+is a option string starting with tt(-J) or tt(-V), the argument after
+it is taken as the name of the tag.
+This is often useful to do both the testing of the tag and
 getting the description for the matches one is about to add at
 once. E.g.:
 
@@ -1640,8 +1678,8 @@ In many contexts only one type of matches can be generated but even
 then it should be tested if the tag representing those matches is
 requested by the user. This function makes that easier.
 
-Like tt(_requested) it gets a tag and arguments for tt(_description)
-as arguments. With the tag it calls tt(_tags) and if that returns zero 
+Like tt(_requested) it gets arguments as for tt(_description).
+With the tag it calls tt(_tags) and if that returns zero 
 (i.e. the tag is requested by the user) it calls tt(_description). So, 
 if you want to offer only one tag and immediatly want to use the
 description built, you can just do:
diff --git a/Etc/completion-style-guide b/Etc/completion-style-guide
index f5ec8ff14..62792eada 100644
--- a/Etc/completion-style-guide
+++ b/Etc/completion-style-guide
@@ -63,13 +63,13 @@ Then, before adding the matches, see if matches of that type are
 requested by the user in the current context. If you will add only one 
 type of matches, this is very simple. You can use the function `_tags' 
 or the function `_wanted' for this. `_tags' is normally used to offer
-multiple types of matche by giving the tags for them as arguments. But 
-it any case its return value is zero only if at least one of these
+multiple types of matches by giving the tags for them as arguments. But 
+in any case its return value is zero only if at least one of these
 types is requested by the user, so you can just do:
 
   _tags names || return 1
 
-  _description expl 'name'
+  _description names expl 'name'
   compadd "$expl[@]" - alice bob
 
 Since this sequence of command is used so often, the `_wanted'
@@ -83,7 +83,7 @@ matches should be added. So the example becomes:
 Note that you can also give the `-J' and `-V' options with the
 optional `1' or `2' following them supported by `_description':
 
-  _wanted names -V2 expl 'name' && compadd ...
+  _wanted -V2 names expl 'name' && compadd ...
 
 The more complicated case is where you can offer multiple types of
 matches. In this case the user should be able to say which types he
@@ -97,7 +97,7 @@ for this uses `_tags' and `_requested':
 
   while _tags; do
     if _requested friends; then
-      _description expl friend
+      _description friends expl friend
       compad "$expl[@]" alice bob && ret=0
     fi
     _requested users && _users && ret=0
@@ -192,10 +192,10 @@ to get user-configured values. This is done using the function
 
 Basically styles map names to a bunch of strings (the `value'). In
 many cases you want to treat the value as a boolean, so let's start
-with that. To test if, for example, the style `description' is set for 
+with that. To test if, for example, the style `verbose' is set for 
 the tag `options' in the context you are currently in, you can just do:
 
-  if _style options description; then
+  if _style options verbose; then
     # yes, it is set...
   fi
 
@@ -240,9 +240,9 @@ automatically be set up appropriately at the time when you have a
 chance to call `_style'.
 
 Some random comments about style names. Use the ones already in use if 
-possible. Especially, use the `description' style if you can add
+possible. Especially, use the `verbose' style if you can add
 matches in a simple and a verbose way. Use the verbose form only if
-the `description' style is `true' for the current context. Also, if
+the `verbose' style is `true' for the current context. Also, if
 the matches you want to add have a common prefix which is somehow
 special, use the `prefix-needed' and `prefix-hidden' styles. The first 
 one says if the user has to give the prefix on the line to make these
@@ -280,20 +280,20 @@ throughout the completion system) and do:
 
   local expl
 
-  _description expl <descr>
+  _description tag expl <descr>
   compadd "$expl@]" - <matches ...>
 
 Note that this function also accepts `-V' und `-J', optionally (in the 
 same word) followed by `1' or `2' to describe the type of group you
 want to use. For example:
 
-  _description expl '...'
+  _description tag expl '...'
   compadd "$expl[@]" -V1 foo - ...    # THIS IS WRONG!!!
 
 is *not* the right way to use a unsorted group. Instead do the
 simpler:
 
-  _description -V1 expl '...'
+  _description -V1 tag expl '...'
   compadd "$expl[@]" - ...
 
 and everything will work fine.
@@ -303,16 +303,16 @@ multiple calls to `_description' and add them with multiple calls to
 `compadd'. But in almost all cases you should then add them using
 different tags anyway, so, see above.
 
-And since often a tag directly corresponds to a group of matches,
-you'll often be using the tags function that allow you to give the
+And since a tag directly corresponds to a group of matches, you'll
+often be using the tags function that allow you to give the
 explanation to the same function that is used to test if the tags are
 requested (again: see above). Just as a reminder:
 
-  _wanted <tag> [ -V[1,2] | -J[1,2] ] expl <descr>
+  _wanted [ -V[1,2] | -J[1,2] ] <tag> expl <descr>
 
 and
 
-  _requested <tag> [ -V[1,2] | -J[1,2] ] expl <descr>
+  _requested [ -V[1,2] | -J[1,2] ] <tag> expl <descr>
 
 is all you need to make your function work correctly with both tags
 and description at the same time.
diff --git a/Src/Zle/compcore.c b/Src/Zle/compcore.c
index f37bdef54..193da880e 100644
--- a/Src/Zle/compcore.c
+++ b/Src/Zle/compcore.c
@@ -1495,6 +1495,25 @@ addmatches(Cadata dat, char **argv)
     LinkList aparl = NULL, oparl = NULL, dparl = NULL;
     Brinfo bp, bpl = brbeg, obpl, bsl = brend, obsl;
 
+    if (!*argv) {
+	SWITCHHEAPS(compheap) {
+	    HEAPALLOC {
+		/* Select the group in which to store the matches. */
+		gflags = (((dat->aflags & CAF_NOSORT ) ? CGF_NOSORT  : 0) |
+			  ((dat->aflags & CAF_UNIQALL) ? CGF_UNIQALL : 0) |
+			  ((dat->aflags & CAF_UNIQCON) ? CGF_UNIQCON : 0));
+		if (dat->group) {
+		    endcmgroup(NULL);
+		    begcmgroup(dat->group, gflags);
+		} else {
+		    endcmgroup(NULL);
+		    begcmgroup("default", 0);
+		}
+	    } LASTALLOC;
+	} SWITCHBACKHEAPS;
+
+	return 1;
+    }
     for (bp = brbeg; bp; bp = bp->next)
 	bp->curpos = ((dat->aflags & CAF_QUOTE) ? bp->pos : bp->qpos);
     for (bp = brend; bp; bp = bp->next)