summary refs log tree commit diff
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2001-04-27 09:12:33 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2001-04-27 09:12:33 +0000
commit6f2112f23a4838fd1c52efd16c844142f5407394 (patch)
tree5b09e20b8a7acb079393480fe739e8b7add03942
parenta509b259f889404b3c821a19243ebde19d582aaf (diff)
downloadzsh-6f2112f23a4838fd1c52efd16c844142f5407394.tar.gz
zsh-6f2112f23a4838fd1c52efd16c844142f5407394.tar.xz
zsh-6f2112f23a4838fd1c52efd16c844142f5407394.zip
try to improve testing for suffix style in _expand; make _path_files fail to complete words like ...<pat>..<param-subst>... (14133)
-rw-r--r--ChangeLog7
-rw-r--r--Completion/Base/Completer/_expand7
-rw-r--r--Completion/Unix/Type/_path_files2
-rw-r--r--Doc/Zsh/compsys.yo16
4 files changed, 17 insertions, 15 deletions
diff --git a/ChangeLog b/ChangeLog
index 5fc82d5fe..89f75dbe4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2001-04-27  Sven Wischnowsky  <wischnow@zsh.org>
+
+	* 14133: Completion/Base/Completer/_expand,
+	Completion/Unix/Type/_path_files, Doc/Zsh/compsys.yo: try to
+	improve testing for suffix style in _expand; make _path_files
+	fail to complete words like ...<pat>..<param-subst>...
+
 2001-04-26  Bart Schaefer  <schaefer@zsh.org>
 
 	* 14129: Completion/Base/Completer/_approximate: Use a trap to
diff --git a/Completion/Base/Completer/_expand b/Completion/Base/Completer/_expand
index 8fcedea96..f3da119e1 100644
--- a/Completion/Base/Completer/_expand
+++ b/Completion/Base/Completer/_expand
@@ -28,8 +28,13 @@ fi
    ( "$word" = *\$[a-zA-Z0-9_]## && $+parameters[${word##*\$}] -eq 0 ) ]] &&
     return 1
 
+### I'm not sure about the pattern to use in the following test.
+# It once was:
+#  [[ "$word" = (\~*/|\$(|[=~#^+])[a-zA-Z0-9_\[\]]##[^a-zA-Z0-9_\[\]]|\$\{*\}?)[^\$\{\}\(\)\<\>?^*#~]# ]] &&
+
 zstyle -T ":completion:${curcontext}:" suffix &&
-  [[ "$word" = (\~*/|\$(|[=~#^+])[a-zA-Z0-9_\[\]]##[^a-zA-Z0-9_\[\]]|\$\{*\}?)[^\$\{\}\(\)\<\>?^*#~]# ]] &&
+  [[ "$word" = (\~*/|*\$(|[=~#^+])[a-zA-Z0-9_\[\]]##[^a-zA-Z0-9_\[\]]|*\$\{*\}?) &&
+     "${(e)word}" != *[][^~*?\<\>\{\}\|]* ]] &&
   return 1
 
 zstyle -t ":completion:${curcontext}:" accept-exact ||
diff --git a/Completion/Unix/Type/_path_files b/Completion/Unix/Type/_path_files
index ffaf0d77f..6a30cf2b8 100644
--- a/Completion/Unix/Type/_path_files
+++ b/Completion/Unix/Type/_path_files
@@ -190,7 +190,7 @@ eorig="$orig"
 
 # Now let's have a closer look at the string to complete.
 
-if [[ "$pre" = *(\`[^\`]#\`|\$)*/* && "$compstate[quote]" != \' ]]; then
+if [[ "$pre" = [^][*?#^\|\<\>]#(\`[^\`]#\`|\$)*/* && "$compstate[quote]" != \' ]]; then
 
   # If there is a parameter expansion in the word from the line, we try
   # to complete the beast by expanding the prefix and completing anything
diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo
index 040429d5d..ba7c148c7 100644
--- a/Doc/Zsh/compsys.yo
+++ b/Doc/Zsh/compsys.yo
@@ -1949,7 +1949,7 @@ The default is `true'.
 kindex(suffix, completion style)
 item(tt(suffix))(
 This is used by the tt(_expand) completer if the word starts with a
-tilde or parameter expansion. If it is set to `true', the word will
+tilde or contains a parameter expansion. If it is set to `true', the word will
 only be expanded if it doesn't have a suffix, i.e. if it is something
 like `tt(~foo)' or `tt($foo)', but not if it is `tt(~foo/)' or
 `tt($foo/bar)', unless that suffix itself contains characters eligible
@@ -2001,18 +2001,8 @@ of the tag in the context names used to look up styles.  If the
 var(label) starts with a hyphen, the var(tag) is prepended to the
 var(label) to form the name used for lookup.  This can be
 used to make the completion system try a certain tag more than once,
-supplying different style settings for each attempt.  For example,
-
-example(zstyle ':completion:*:*:-command-:*' \ 
-    tag-order 'functions:-non-comp'
-zstyle ':completion:*:functions-non-comp' \ 
-    ignored-patterns '_*')
-
-This makes completion in command position first try only names of shell
-functions that don't match the pattern `tt(_*)'. If that generates no
-matches, the default of trying all the other things that can be
-completed in command position is used, including the names of all
-shell functions.
+supplying different style settings for each attempt, see below for an
+example.
 
 The var(label) may optionally be followed by a second colon and a
 description.  This description will then be used for the `tt(%d)' in