Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: assorted minor completion function changes



This is an assortment of trivial changes that were sitting in my git
repository, some since quite some time ago. There's a missing (-.)
qualifier, a couple of -s options to _arguments. _vim completing for
exim isn't helpful when exim is the MTA and not some vim version of ex
that I've never seen anywhere with the name exim. nmh has gained a few
extra commands.

Oliver

diff --git a/Completion/Unix/Command/_clay b/Completion/Unix/Command/_clay
index 71f05bf..581338b 100644
--- a/Completion/Unix/Command/_clay
+++ b/Completion/Unix/Command/_clay
@@ -38,5 +38,5 @@ _arguments -C \
   "-e:compile and run <source> (implies -run)" \
   "-M-:import <module>.*; for -e" \
   "-v[display version info]" \
-  ":program file:_files -g '*.clay'"
+  ":program file:_files -g '*.clay(-.)'"
 
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index 5b78a2b..7b59d00 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -5188,7 +5188,7 @@ _git_commands () {
   local -a aliases
   __git_extract_aliases
   local cmdtype len dup sep
-  local -a allcmds allmatching alts disp
+  local -a allcmds allmatching alts disp expl
 
   zstyle -s ":completion:${curcontext}:" list-separator sep || sep=--
   for cmdtype in $cmdtypes aliases; do
@@ -5202,7 +5202,8 @@ _git_commands () {
     allcmds+=( ${(P)${:-${cmdtype}_m}} )
   done
   zstyle -T ":completion:${curcontext}:" verbose && disp=(-ld '${cmdtype}_d')
-  compadd -O allmatching -a allcmds
+  _description '' expl '' # get applicable matchers
+  compadd "$expl[@]" -O allmatching -a allcmds
   len=${#${(O)allmatching//?/.}[1]} # length of longest match
   for cmdtype in aliases $cmdtypes; do
     local -a ${cmdtype}_d
diff --git a/Completion/Unix/Command/_ifconfig b/Completion/Unix/Command/_ifconfig
index 49b0188..0c81bce 100644
--- a/Completion/Unix/Command/_ifconfig
+++ b/Completion/Unix/Command/_ifconfig
@@ -65,7 +65,7 @@ esac
 
 _arguments -C "$args[@]" \
   '-a[apply to all interfaces]' \
-  '1:network interface:_net_interfaces' \
+  '1:network interface:_net_interfaces -r ": \t\n\-"' \
   '::address family:(atalk ether inet inet6 ax25 ddp ipx netrom)' \
   '*:option:->options' && ret=0
   
diff --git a/Completion/Unix/Command/_kvno b/Completion/Unix/Command/_kvno
index 285aab3..782d9e6 100644
--- a/Completion/Unix/Command/_kvno
+++ b/Completion/Unix/Command/_kvno
@@ -11,8 +11,7 @@ _arguments -C \
   ':principal:->principal' && ret=0
 
 if [[ $state = principal ]]; then
-  if [[ -prefix host/ ]]; then
-    compset -P host/
+  if compset -P host/; then
     _hosts && ret=0
   else
     _alternative \
diff --git a/Completion/Unix/Command/_mh b/Completion/Unix/Command/_mh
index 4817798..3eddd41 100644
--- a/Completion/Unix/Command/_mh
+++ b/Completion/Unix/Command/_mh
@@ -1,4 +1,4 @@
-#compdef ali anno burst comp dist flist flists folder folders forw inc mark mhlist mhmail mhn mhparam mhpath mhshow mhstore msgchk next packf pick prev refile repl rmf rmm scan show sortm whom
+#compdef ali anno burst comp dist flist flists fmttest folder folders forw fnext fprev inc mark mhfixmsg mhlist mhmail mhn mhparam mhpath mhshow mhstore msgchk new next packf pick prev refile repl rmf rmm scan show sortm whom
 
 if [[ -z $commands[mhpath] ]]; then
   _message "MH commands are not available"
@@ -73,7 +73,9 @@ elif [[ $service = mhparam ]]; then
 elif [[ $service = ali ]]; then
   _email_addresses -n MH
 elif compset -P '*:'; then
-  _message -e number 'number of messages'
+  _alternative \
+    'sequences:sub-sequence:(first last cur prev next)'
+    'number: : _message -e number "number of messages"'
 else
   # Generate sequences.
   local foldnam folddir f sequences mhneg ret=1
@@ -95,6 +97,7 @@ else
   sequences=( ${${(f)"$(mark $foldnam 2>/dev/null)"}%%:*} )
   mhneg="$(mhparam Sequence-Negation)" && sequences=( {,$mhneg}$^sequences )
   sequences+=( all first last prev next )
+  [[ $service = mhpath ]] && sequences+=( new )
   _tags sequences
   while _tags; do
     while _next_label sequences expl sequence; do
diff --git a/Completion/Unix/Command/_rm b/Completion/Unix/Command/_rm
index 4728ad4..4d0dbdb 100644
--- a/Completion/Unix/Command/_rm
+++ b/Completion/Unix/Command/_rm
@@ -40,7 +40,7 @@ fi
 local curcontext=$curcontext state line ret=1
 declare -A opt_args
 
-_arguments -C $opts \
+_arguments -C -s $opts \
   $args && ret=0
 
 case $state in
diff --git a/Completion/Unix/Command/_ssh b/Completion/Unix/Command/_ssh
index b7b7e41..c2514a1 100644
--- a/Completion/Unix/Command/_ssh
+++ b/Completion/Unix/Command/_ssh
@@ -105,7 +105,7 @@ _ssh () {
     ;;
   ssh-keygen)
     cmds=( -p -i -e -y -c -l -B -D -U )
-    _arguments \
+    _arguments -s \
       '-q[silence ssh-keygen]' \
       "($cmds -P)-b[specify number of bits in key]:bits in key" \
       "($cmds -P)-t[specify the type of the key to create]:key type:(rsa1 rsa dsa ecdsa ed25519)" \
diff --git a/Completion/Unix/Command/_stty b/Completion/Unix/Command/_stty
index f40cd85..b5545eb 100644
--- a/Completion/Unix/Command/_stty
+++ b/Completion/Unix/Command/_stty
@@ -14,5 +14,5 @@ else
 	      parmrk inpck istrip inlcr igncr icrnl iuclc ixon ixany ixoff \
               imaxbel isig icanon xcase echo echoe echok echonl noflsh \
               tostop echoctl echoprt echoke flusho pending iexten opost \
-	      olcuc onlcr ocrnl onocr onlret ofill ofdel 
+	      olcuc onlcr ocrnl onocr onlret ofill ofdel raw sane
 fi
diff --git a/Completion/Unix/Command/_vim b/Completion/Unix/Command/_vim
index 007671b..dbc946c 100644
--- a/Completion/Unix/Command/_vim
+++ b/Completion/Unix/Command/_vim
@@ -1,4 +1,4 @@
-#compdef vim exim gvim gex gview nvim rvim rview rgvim rgview evim eview vimdiff gvimdiff
+#compdef vim gvim gex gview nvim rvim rview rgvim rgview evim eview vimdiff gvimdiff
 
 (( $+functions[_vim_files] )) ||
 _vim_files () {
diff --git a/Completion/Unix/Type/_pdf b/Completion/Unix/Type/_pdf
index 60cee84..5fda42a 100644
--- a/Completion/Unix/Type/_pdf
+++ b/Completion/Unix/Type/_pdf
@@ -1,4 +1,4 @@
-#compdef pdf2dsc pdf2ps pdfimages pdfinfo pdftopbm pdftops pdftotext pdfopt pdffonts kpdf apvlv epdfview
+#compdef pdf2dsc pdf2ps pdfimages pdfinfo pdftopbm pdftops pdftotext pdfopt pdffonts kpdf apvlv epdfview mupdf
 
 local expl ext=''
 
diff --git a/Completion/Zsh/Context/_brace_parameter b/Completion/Zsh/Context/_brace_parameter
index 4097895..9eb3465 100644
--- a/Completion/Zsh/Context/_brace_parameter
+++ b/Completion/Zsh/Context/_brace_parameter
@@ -152,7 +152,7 @@ if [[ $PREFIX = *'${('[^\)]# ]]; then
     "F:join arrays with newlines"
     "g:process echo array sequences (needs options)"
     "i:sort case-insensitively"
-    "k:subsitute keys of associative arrays"
+    "k:substitute keys of associative arrays"
     "L:lower case all letters"
     "n:sort decimal integers numerically"
     "o:sort in ascending order (lexically if no other sort option)"



Messages sorted by: Reverse Date, Date, Thread, Author