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

PATCH: Re: #compdef tag and menu-select



I wrote:

> [ allow #compdef -k menu-select ... ]

Here is a more complete patch (no good trying that other patch it if
one has zmodload zsh/complist in .zshrc, sigh).

I'll commit this one.

Bye
 Sven

Index: Completion/Core/compdump
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Core/compdump,v
retrieving revision 1.4
diff -u -r1.4 compdump
--- Completion/Core/compdump	2000/05/25 14:48:38	1.4
+++ Completion/Core/compdump	2000/05/31 09:18:34
@@ -62,9 +62,14 @@
 # argument to zle does not begin with a `_').
 
 _d_bks=()
+_d_complist=
 zle -lL |
   while read -rA _d_line; do
     if [[ ${_d_line[3]} = _* && ${_d_line[5]} = _* ]]; then
+      if [[ -z "$_d_complist" && ${_d_line[4]} = .menu-select ]]; then
+        print 'zmodload -i zsh/complist'
+	d_complist=yes
+      fi
       print -r - ${_d_line}
       _d_bks=($_d_bks ${_d_line[3]})
     fi
Index: Completion/Core/compinit
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Core/compinit,v
retrieving revision 1.3
diff -u -r1.3 compinit
--- Completion/Core/compinit	2000/05/25 14:48:38	1.3
+++ Completion/Core/compinit	2000/05/31 09:18:34
@@ -232,6 +232,7 @@
 	fi
 	[[ $1 = _* ]] || 1="_$1"
 	[[ $2 = .* ]] || 2=".$2"
+        [[ $2 = .menu-select ]] && zmodload -i zsh/complist
 	zle -C "$1" "$2" "$func"
 	if [[ -n $new ]]; then
 	  bindkey "$3" | read -A opt
@@ -250,8 +251,10 @@
 
       # Define the widget.
       if [[ $1 = .* ]]; then
+        [[ $1 = .menu-select ]] && zmodload -i zsh/complist
 	zle -C "$func" "$1" "$func"
       else
+        [[ $1 = menu-select ]] && zmodload -i zsh/complist
 	zle -C "$func" ".$1" "$func"
       fi
       shift

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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