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

PATCH: misc. completion stuff



This...

- improves completion for the tag-order and file-patterns styles
- adds the docs and _zstyle handling for the subst-glob-only style
- makes the _approximate version of compadd slightly faster

Bye
 Sven

diff -ru ../z.old/Completion/Builtins/_zstyle Completion/Builtins/_zstyle
--- ../z.old/Completion/Builtins/_zstyle	Mon Mar 27 10:50:05 2000
+++ Completion/Builtins/_zstyle	Mon Mar 27 10:51:19 2000
@@ -21,7 +21,7 @@
   disable-stat		 c:bool
   domains                c:
   expand		 c:
-  file-patterns		 c:
+  file-patterns		 c:filepat
   format		 c:
   glob			 c:
   group-name		 c:
@@ -55,12 +55,13 @@
   remove-all-dups	 c:bool
   single-ignored         c:single-ignored
   sort			 c:bool
-  tag-aliases            c:tag
-  tag-order		 c:tag
   special-dirs		 c:sdirs
   squeeze-slashes	 c:bool
   stop			 c:stop
+  subst-glob-only        c:
   substitute		 c:
+  tag-aliases            c:tag
+  tag-order		 c:tag
   users			 c:_users
   users-hosts		 c:user-host
   verbose		 c:bool
@@ -197,7 +198,24 @@
       ;;
 
     tag)
-      _wanted tags expl tag compadd - $taglist
+      compset -q
+      if compset -P '*:*:'; then
+        _message description
+      elif compset -P '*:'; then
+        _message 'tag alias'
+      else
+        _wanted tags expl tag compadd - $taglist
+      fi
+      ;;
+
+    filepat)
+      if compset -P '*:*:'; then
+        _message description
+      elif compset -P '*:'; then
+        _message tag
+      else
+        _message 'glob patterns'
+      fi
       ;;
 
     user-host)
diff -ru ../z.old/Completion/Core/_approximate Completion/Core/_approximate
--- ../z.old/Completion/Core/_approximate	Mon Mar 27 10:50:07 2000
+++ Completion/Core/_approximate	Mon Mar 27 10:51:19 2000
@@ -46,7 +46,7 @@
 # ignored prefix).
 
 compadd() {
-  [[ "$*" != *-([a-zA-Z/]#|)U* &&
+  [[ ${argv[(I)-[a-zA-Z]#U[a-zA-Z]#]} -eq 0 &&
      "${#:-$PREFIX$SUFFIX}" -le _comp_correct ]] && return
 
   if [[ "$PREFIX" = \~*/* ]]; then
diff -ru ../z.old/Doc/Zsh/compsys.yo Doc/Zsh/compsys.yo
--- ../z.old/Doc/Zsh/compsys.yo	Mon Mar 27 10:49:49 2000
+++ Doc/Zsh/compsys.yo	Mon Mar 27 10:51:20 2000
@@ -1380,6 +1380,15 @@
 style. But all keys matching the pattern given as its value will stop
 incremental completion and will then execute their usual function.
 )
+item(tt(subst-globs-only))(
+This is used by the tt(_expand) completer. As for the tt(glob) style,
+the value should be a value usable in a `tt($((...)))' arithmetical
+expression. If it evaluates to `tt(1)', the expansion will only be
+used if they resulted from globbing. If only the expansions described
+for the tt(substitute) style described below resulted in expanded
+strings and globbing did not change the set of expanded strings, the
+tt(_expand) completer will do nothing.
+)
 item(tt(substitute))(
 If this is unset or set to the empty string, the tt(_expand) completer
 will first try to expand all substitutions in the string (such as

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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