about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2001-10-19 10:28:07 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2001-10-19 10:28:07 +0000
commit2a0862bc40493312db83b368b8ba927e9183b5b9 (patch)
tree51871e5a226ef1845fc1aac2a20dbd2967ced4c5
parent62829b856d9c6b054f3c6338a20f9d5c04d79d42 (diff)
downloadzsh-2a0862bc40493312db83b368b8ba927e9183b5b9.tar.gz
zsh-2a0862bc40493312db83b368b8ba927e9183b5b9.tar.xz
zsh-2a0862bc40493312db83b368b8ba927e9183b5b9.zip
fix: make _describe handle (...) arguments correctly; use _file_descriptors after -t in conditions; don't display empty descriptions in _file_descriptors (16085)
-rw-r--r--ChangeLog9
-rw-r--r--Completion/Base/Utility/_describe12
-rw-r--r--Completion/Zsh/Context/_condition2
-rw-r--r--Completion/Zsh/Type/_file_descriptors10
4 files changed, 28 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 4b9012a8f..95919c14c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2001-10-19  Sven Wischnowsky  <wischnow@zsh.org>
+
+	* 16085: Completion/Base/Utility/_describe,
+	Completion/Zsh/Context/_condition,
+	Completion/Zsh/Type/_file_descriptors: fix: make _describe
+	handle (...) arguments correctly; use _file_descriptors after
+	-t in conditions; don't display empty descriptions in
+	_file_descriptors
+
 2001-10-18  Oliver Kiddle  <opk@zsh.org>
 
 	* 16080: Src/builtin.c, Doc/Zsh/builtins.yo, Test/B03print.ztst:
diff --git a/Completion/Base/Utility/_describe b/Completion/Base/Utility/_describe
index 9ad04c224..fea3ee569 100644
--- a/Completion/Base/Utility/_describe
+++ b/Completion/Base/Utility/_describe
@@ -54,7 +54,11 @@ while _tags; do
       while (( $# )); do
     
         _strs="_a_$_try$_i"
-        eval local "_a_$_try$_i;_a_$_try$_i"'=( "${'$1'[@]}" )'
+        if [[ "$1" = \(*\) ]]; then
+          eval local "_a_$_try$_i;_a_$_try$_i"'='$1
+        else
+          eval local "_a_$_try$_i;_a_$_try$_i"'=( "${'$1'[@]}" )'
+        fi
         _argv[_i]="_a_$_try$_i"
         shift
         (( _i++ ))
@@ -63,7 +67,11 @@ while _tags; do
           _mats=
         else
           _matss="_a_$_try$_i"
-          eval local "_a_$_try$_i;_a_$_try$_i"'=( "${'$1'[@]}" )'
+          if [[ "$1" = \(*\) ]]; then
+            eval local "_a_$_try$_i;_a_$_try$_i"'='$1
+          else
+            eval local "_a_$_try$_i;_a_$_try$_i"'=( "${'$1'[@]}" )'
+          fi
           _argv[_i]="_a_$_try$_i"
           shift
           (( _i++ ))
diff --git a/Completion/Zsh/Context/_condition b/Completion/Zsh/Context/_condition
index b6a4eff7a..46f8467b7 100644
--- a/Completion/Zsh/Context/_condition
+++ b/Completion/Zsh/Context/_condition
@@ -6,6 +6,8 @@ if [[ "$prev" = -o ]]; then
   _tags -C -o options && _options
 elif [[ "$prev" = -([a-hkprsuwxLOGSN]|[no]t|ef) ]]; then
   _tags -C "$prev" files && _files
+elif [[ "$prev" = -t ]]; then
+  _file_descriptors
 else
   if [[ "$PREFIX" = -* ]] ||
      ! zstyle -T ":completion:${curcontext}:options" prefix-needed; then
diff --git a/Completion/Zsh/Type/_file_descriptors b/Completion/Zsh/Type/_file_descriptors
index 3331be82c..3ea94a7b7 100644
--- a/Completion/Zsh/Type/_file_descriptors
+++ b/Completion/Zsh/Type/_file_descriptors
@@ -19,7 +19,11 @@ if zstyle -T ":completion:${curcontext}:" verbose && [[ -e /proc/$$/fd ]]; then
       list=( ${list[@]} "$i $sep $(ls -l /proc/$$/fd/$i|sed 's/.*-> //' )" )
     done
   fi
-  _wanted file-descriptors expl 'file descriptors' compadd "$@" -d list -a fds
-else
-  _wanted file-descriptors expl 'file descriptors' compadd "$@" -a fds
+
+  if (( $list[(I)* $sep ?*] )); then
+    _wanted file-descriptors expl 'file descriptors' compadd "$@" -d list -a fds
+    return
+  fi
 fi
+
+_wanted file-descriptors expl 'file descriptors' compadd "$@" -a fds