summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Completion/Builtins/_zstyle1
-rw-r--r--Completion/Core/_description13
-rw-r--r--Completion/Core/_expand1
-rw-r--r--Doc/Zsh/compsys.yo11
5 files changed, 28 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 06aef3737..9451c75bf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2000-05-08  Sven Wischnowsky  <wischnow@informatik.hu-berlin.de>
 
+	* 11244: Completion/Builtins/_zstyle, Completion/Core/_description,
+ 	Completion/Core/_expand, Doc/Zsh/compsys.yo: make _expand call
+ 	_complete when called from _expand_word; add ignore-line style to
+ 	ignore words already on the line
+	
 	* 11242: Completion/Builtins/_pids, Completion/Builtins/_zstyle,
  	Completion/Commands/_complete_help, Completion/Core/_all_labels,
  	Completion/Core/_approximate, Completion/Core/_expand,
diff --git a/Completion/Builtins/_zstyle b/Completion/Builtins/_zstyle
index 995c8c6f2..9f5bf9352 100644
--- a/Completion/Builtins/_zstyle
+++ b/Completion/Builtins/_zstyle
@@ -36,6 +36,7 @@ styles=(
   hosts			 c:_hosts
   hosts-ports		 c:host-port
   users-hosts-ports	 c:user-host-port
+  ignore-line            c:bool
   ignore-parents         c:ignorepar
   ignored-patterns	 c:
   insert-ids             c:insert-ids
diff --git a/Completion/Core/_description b/Completion/Core/_description
index 6ee1026bd..9ea478ec5 100644
--- a/Completion/Core/_description
+++ b/Completion/Core/_description
@@ -29,9 +29,16 @@ zstyle -s ":completion:${curcontext}:$1" matcher match &&
     opts=($opts -M "${(q)match}")
 [[ -n "$_matcher" ]] && opts=($opts -M "${(q)_matcher}")
 
-if [[ -z "$_comp_no_ignore" ]] &&
-   zstyle -a ":completion:${curcontext}:$1" ignored-patterns _comp_ignore; then
-  opts=( $opts -F _comp_ignore )
+if [[ -z "$_comp_no_ignore" ]]; then
+  if zstyle -a ":completion:${curcontext}:$1" ignored-patterns _comp_ignore; then
+    opts=( $opts -F _comp_ignore )
+    zstyle -t ":completion:${curcontext}:$1" ignore-line &&
+        _comp_ignore=( "$_comp_ignore[@]" "$words[@]}" )
+  elif zstyle -t ":completion:${curcontext}:$1" ignore-line; then
+    _comp_ignore=( "$words[@]}]" )
+  else
+    _comp_ignore=()
+  fi
 else
   _comp_ignore=()
 fi
diff --git a/Completion/Core/_expand b/Completion/Core/_expand
index 985f21899..987a597c7 100644
--- a/Completion/Core/_expand
+++ b/Completion/Core/_expand
@@ -30,6 +30,7 @@ if [[ "$force" = *c* ]] ||
    { zstyle -s ":completion:${curcontext}:" completions expr &&
      [[ "${(e):-\$[$expr]}" -eq 1 ]] }; then
   compstate[insert]=all
+  [[ "$curcontext" = expand-word:* ]] && _complete && return 0
   return 1
 fi
 
diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo
index c741959ce..cdfb681bc 100644
--- a/Doc/Zsh/compsys.yo
+++ b/Doc/Zsh/compsys.yo
@@ -1175,6 +1175,17 @@ depending on the information already on the line, so that if, for
 example, the hostname is already typed, only those ports will be
 completed for which pairs with the hostname from the line exist.
 )
+kindex(ignore-line, completion style)
+item(tt(ignore-line))(
+This style is tested for the tags used when generating matches. If it
+is set to `true', then none of the words that are already on the line
+will be considered possible completions.
+
+Note that you almost certainly don't want to set this for a general
+context such as `tt(:completion:*)'. This because it would disallow
+completion of, for example, options multiple times even if the command
+in question accepts the option more than once.
+)
 kindex(ignore-parents, completion style)
 item(tt(ignore-parents))(
 The style is tested for the tt(files) tag to determine whether to ignore