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

PATCH: small fixes for tags stuff



Fixes for some typos, first attempt at reducing the number of tags
used, the `-L' option to `compstyle' and improving the list-output of
`compstyle' and `compconf'.


I guess you are all waiting for the doc changes to appear... sorry, I
didn't have enough time yesterday.


And about 8645: sorry, and thanks, Tanaka!

Bye
 Sven

diff -u -r oldcompletion/Builtins/_hash Completion/Builtins/_hash
--- oldcompletion/Builtins/_hash	Tue Nov 16 09:00:30 1999
+++ Completion/Builtins/_hash	Tue Nov 16 09:02:14 1999
@@ -10,7 +10,7 @@
         compadd "$expl[@]" -q -S '=' - "${(@k)nameddirs}"
   fi
 elif compset -P 1 '*\='; then
-  _wanted -C value values executables expl 'executable file' &&
+  _wanted -C value values expl 'executable file' &&
       _files "$expl[@]" -g '*(*)'
 else
   _wanted -C name commands expl command &&
diff -u -r oldcompletion/Builtins/_sched Completion/Builtins/_sched
--- oldcompletion/Builtins/_sched	Tue Nov 16 09:00:31 1999
+++ Completion/Builtins/_sched	Tue Nov 16 09:02:14 1999
@@ -4,7 +4,7 @@
 
 if [[ CURRENT -eq 2 ]]; then
   if compset -P -; then
-    _wanted -C - entries expl 'scheduled jobs' || return 1
+    _wanted -C - jobs expl 'scheduled jobs' || return 1
 
     lines=(${(f)"$(sched)"})
     if _style entries description; then
diff -u -r oldcompletion/Builtins/_stat Completion/Builtins/_stat
--- oldcompletion/Builtins/_stat	Tue Nov 16 09:00:31 1999
+++ Completion/Builtins/_stat	Tue Nov 16 09:02:14 1999
@@ -5,10 +5,10 @@
 if [[ "$words[CURRENT-1]" = -[AH] ]]; then
   _arrays
 else
-  _tags elements files || return 1
+  _tags options files || return 1
 
   while _tags; do
-    _requested elements expl 'inode element' &&
+    _requested options expl 'inode element' &&
         { ! _style elements prefix-needed || [[ "$PREFIX[1]" = + ]] } &&
         compadd "$expl[@]" - +device +inode +mode +nlink +uid +gid +rdev \
                              +size +atime +mtime +ctime +blksize +block +link
diff -u -r oldcompletion/Core/compinit Completion/Core/compinit
--- oldcompletion/Core/compinit	Tue Nov 16 09:00:35 1999
+++ Completion/Core/compinit	Tue Nov 16 09:20:30 1999
@@ -343,28 +343,28 @@
 
     case "$name" in
     urls_path)
-      tmp="'*:urls' path '$val'"
+      tmp="'*:urls' path ${(qq)val}"
       ;;
     urls_localhttp)
-      tmp="'*:urls' local '${val//:/ }'"
+      tmp="'*:urls' local ${${(qqs.:.)val}}"
       ;;
     describe_options)
-      tmp="'*:options' description '$val'"
+      tmp="'*:options' description ${(qq)val}"
       ;;
     describe_values)
-      tmp="'*:values' description '$val'"
+      tmp="'*:values' description ${(qq)val}"
       ;;
     autodescribe_options)
-      tmp="'*:options' auto-description '$val'"
+      tmp="'*:options' auto-description ${(qq)val}"
       ;;
     description_format)
-      tmp="'*:descriptions' format '$val'"
+      tmp="'*:descriptions' format ${(qq)val}"
       ;;
     message_format)
-      tmp="'*:messages' format '$val'"
+      tmp="'*:messages' format ${(qq)val}"
       ;;
     warning_format)
-      tmp="'*:warnings' format '$val'"
+      tmp="'*:warnings' format ${(qq)val}"
       ;;
     option_prefix)
       tmp="'*:options' prefix-needed yes"
@@ -376,43 +376,43 @@
       tmp="'*:matches' group 'yes'"
       ;;
     colors_path)
-      tmp="'*:colors' path '$val'"
+      tmp="'*:colors' path ${(qq)val}"
       ;;
     path_expand)
-      tmp="'*:paths' expand '$val'"
+      tmp="'*:paths' expand ${(qq)val}"
       ;;
     path_cursor)
-      tmp="'*:paths' cursor '$val'"
+      tmp="'*:paths' cursor ${(qq)val}"
       ;;
     (approximate|incremental|predict|list|oldlist|match)_*)
-      tmp="':${name%%_*}' ${${name#*_}//_/-} '$val'"
+      tmp="':${name%%_*}' ${${name#*_}//_/-} ${(qq)val}"
       ;;
     correct_*)
       cmt="# This one is a bit ugly. You may want to use only \`*:correct'
 # if you also have the \`correctword_*' or \`approximate_*' keys.
 "
-      tmp="':(correct(|-word)|approximate)' ${name#*_} '$val'"
+      tmp="':(correct(|-word)|approximate)' ${name#*_} ${(qq)val}"
       ;;
     correctword_*)
-      tmp="':correct-word' ${name#correctword_} '$val'"
+      tmp="':correct-word' ${name#correctword_} ${(qq)val}"
       ;;
     expand_*)
       cmt="# This one is a bit ugly. You may want to use only \`*:expand'
 # if you also have the \`expandword_*' keys.
 "
-      tmp="':expand(|expand-word)' ${name#*_} '$val'"
+      tmp="':expand(|expand-word)' ${name#*_} ${(qq)val}"
       ;;
     expandword_*)
-      tmp="':expand-word' ${name#expandword_} '$val'"
+      tmp="':expand-word' ${name#expandword_} ${(qq)val}"
       ;;
     history_*)
-      tmp="'*:history-entries' ${name#history_} '$val'"
+      tmp="'*:history-entries' ${name#history_} ${(qq)val}"
       ;;
     completer)
-      tmp="'*' completer ${val//:/ }"
+      tmp="'*' completer ${${(qqs.:.)val}}"
       ;;
     last_prompt)
-      tmp="'*' last-prompt '$val'"
+      tmp="'*' last-prompt ${(qq)val}"
       ;;
     esac
     [[ -n "$tmp" ]] && style="${style}${cmt}compstyle ${tmp}
@@ -433,17 +433,30 @@
 # This will be improved if needed. Promised.
 
 compstyle() {
+  local long
+
+  if [[ "$1" = -L ]]; then
+    long=yes
+    shift
+  fi
+
   if (( ! $# )); then
-    local pats styles vals pat style
+    local pats styles vals pat style pre eq
 
     compstyles -G pats
 
     for pat in "$pats[@]"; do
-      print "$pat"
+      if [[ -n "$long" ]]; then
+        pre="compstyle ${(qq)pat} "
+      else
+        print "$pat"
+	pre='    '
+	eq=' ='
+      fi
       compstyles -G styles "$pat"
       for style in "$styles[@]"; do
         compstyles -G vals "$pat" "$style"
-        print "    $style = $vals"
+        print "${pre}${style}${eq}" "${(@qq)vals}"
       done
     done
 
diff -u -r oldcompletion/User/_cvs Completion/User/_cvs
--- oldcompletion/User/_cvs	Tue Nov 16 09:00:40 1999
+++ Completion/User/_cvs	Tue Nov 16 09:02:15 1999
@@ -575,7 +575,7 @@
     local omit
     omit=(${pref}*(D:t))
     eval 'entries=(${entries:#('${(j:|:)${(@)omit:q}}')})'
-    _tags direcories && compadd "$@" -P "$qpref" - ${entries:q} ||
+    _tags directories && compadd "$@" -P "$qpref" - ${entries:q} ||
     _cvs_directories "$@"
   else
     _files "$@"
diff -u -r oldcompletion/User/_urls Completion/User/_urls
--- oldcompletion/User/_urls	Tue Nov 16 09:00:43 1999
+++ Completion/User/_urls	Tue Nov 16 09:02:15 1999
@@ -54,7 +54,7 @@
 ipre="$IPREFIX"
 
 if ! compset -P '(#b)([-+.a-z0-9]#):' &&
-   _wanted argument prefixes expl 'URL prefix'; then
+   _wanted -C argument prefixes expl 'URL prefix'; then
   [[ -d $urls_path/bookmark ]] &&
     compadd "$@" "$expl[@]" -S '' bookmark: && ret=0
   compadd "$@" "$expl[@]" -S '' file: ftp:// gopher:// http:// && ret=0
@@ -65,7 +65,7 @@
 case "$scheme" in
   http|ftp|gopher)
     if ! compset -P //; then
-      _wanted -C "$scheme" slashes expl 'end of prefix' &&
+      _wanted -C "$scheme" prefixes expl 'end of prefix' &&
           compadd "$expl[@]" "$@" -S '' //
       return
     fi
@@ -86,11 +86,11 @@
   bookmark)
     if [[ -f "$urls_path/$scheme/$PREFIX$SUFFIX" &&
 	  -s "$urls_path/$scheme/$PREFIX$SUFFIX" ]]; then
-      _wanted -C bookmark caches expl biikmarks &&
+      _wanted -C bookmark bookmarks expl bookmarks &&
           compadd "$expl[@]" "$@" -QU - \
               "$ipre$(<"$urls_path/$scheme/$PREFIX$SUFFIX")" && ret=0
     else
-      if _wanted -C bookmark files 'bookmark'; then
+      if _wanted -C bookmark files expl 'bookmark'; then
         _path_files -W "$urls_path/$scheme" "$expl[@]" -S '' -g '*(^/)' && 
             ret=0
         _path_files -W "$urls_path/$scheme" -S/ -r '/' -/ && ret=0
diff -u -r oldcompletion/User/_user_at_host Completion/User/_user_at_host
--- oldcompletion/User/_user_at_host	Tue Nov 16 09:00:43 1999
+++ Completion/User/_user_at_host	Tue Nov 16 09:02:15 1999
@@ -5,9 +5,9 @@
 
   compset -P 1 '*@'
 
-  _wanted -C user-at hosts expl "hostnames for $user" &&
+  _wanted -C user-at hosts expl "host for $user" &&
       _combination accounts_users_hosts users="$user" hosts "$expl[@]" "$@"
 else
-  _wanted users expl "usernames" &&
+  _wanted users expl "user" &&
       _combination accounts_users_hosts users -S@ -q "$expl[@]" "$@"
 fi
diff -u -r oldcompletion/User/_whois Completion/User/_whois
--- oldcompletion/User/_whois	Tue Nov 16 09:00:44 1999
+++ Completion/User/_whois	Tue Nov 16 09:02:15 1999
@@ -204,7 +204,7 @@
   if (( CURRENT == 1 )); then
     local expl
 
-    _wanted string expl string && compadd "$expl[@]" HELP DOMAIN HOST
+    _wanted strings expl string && compadd "$expl[@]" HELP DOMAIN HOST
   else
     _message 'string'
   fi
@@ -215,7 +215,7 @@
   if (( CURRENT == 1 )); then
     local expl
 
-    _wanted string expl string && compadd HELP DOM NET HOST PERSON CONN COM
+    _wanted strings expl string && compadd HELP DOM NET HOST PERSON CONN COM
   else
     _message 'string'
   fi
diff -u -r oldcompletion/X/_xutils Completion/X/_xutils
--- oldcompletion/X/_xutils	Tue Nov 16 09:00:46 1999
+++ Completion/X/_xutils	Tue Nov 16 09:02:15 1999
@@ -67,7 +67,7 @@
       esac
     else
       _alternative \
-          'families:name family:compadd -S: - inet dnet nis krb' \
+          'types:name family:compadd -S: - inet dnet nis krb' \
 	  'hosts:: _hosts' && ret=0
     fi
     return ret

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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