Hi. On Sat 2009-04-11 12:31, Andrey Borzenkov <arvidjaar@xxxxxxxxx> proclaimed: > It does here so you must be doing something differently. > > {pts/3}% _etherwake() { > typeset -a etherwake_desc; > etherwake_desc=('00\:0c\:6e\:74\:16\:77:host1' > '00\:1b\:63\:31\:4a\:6b:host2'); > _describe etherwake etherwake_desc; > } > {pts/3}% compdef _etherwake etherwake > {pts/3}% etherwake 00:0c:6e:74:16:77 > Completing etherwake > 00:0c:6e:74:16:77 -- host1 > 00:1b:63:31:4a:6b -- host2 > > > > It will > > complete the leading ``00:'' part, but then it stops. > > You have to "setopt menucomplete" to make it display lists immediately. > Default it to insert longest common prefix and wait for you to > disambiguate. This works for my other (non self written) completions, i.e. cd /s<Tab> will show me a menu with ``sbin/ selinux/ srv/ sys/'' I have the following settings in my ~/.zsh/* files: setopt auto_list setopt auto_menu zstyle ':completion:*' add-space true zstyle ':completion:*' completer _expand _complete _list zstyle ':completion:*' menu select=2 zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} zstyle ':completion:*' use-cache on zstyle ':completion:*' cache-path ~/.zsh/cache zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' zstyle ':completion:*:descriptions' format '%B%UComplete-o-matic%u %d%b' zstyle ':completion:*' group-name '' zstyle ':completion:*:-command-' group-order builtins functions commands zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31' I hope I did not miss any relevant settings. I added a ``setopt menucomplete'', and now it works. But this also changes the completion behaviour: previously, I would get the menu shown on my first <Tab>, but nothing yet selected, the second <Tab> did that. With ``setopt menucomplete'', the first <Tab> selects. I am not sure if I like that... Could I get my old behaviour somehow, with a menu of my etherwake completion showing up after the second <Tab>? > > Pressing <Tab> > > again after that won't bring up the completion menu, as zsh does for > > my other completions, even if I manually enter a `0' or `1' to > > distinguish the both available arguments. > > Enter where? Anyway, this is completely different problem. Now > *completion* is correct but *display* not :) Enter on the command line, right after the ``00:'' part that the completer put there. > Could you show you options and styles (setopt; zstyle -L)? Sure: alwaystoend autopushd nobeep chaselinks completeinword correct extendedglob noglobalexport nohistbeep histfindnodups histignorealldups histignoredups histsavenodups interactive interactivecomments nolistbeep listpacked longlistjobs markdirs menucomplete monitor nonomatch promptsubst pushdignoredups pushdsilent pushdtohome sharehistory shinstdin transientrprompt vi zle zstyle ':completion:*' add-space true zstyle ':completion:*' cache-path /home/yogan/.zsh/cache zstyle ':completion:*:sudo:*' command-path /usr/local/sbin /usr/local/bin /usr/sbin /usr/bin /sbin /bin /usr/X11R6/bin zstyle ':completion:*' completer _expand _complete _list zstyle ':completion:*:descriptions' format '%B%UComplete-o-matic%u %d%b' zstyle ':completion:*' group-name '' zstyle ':completion:*:-command-' group-order builtins functions commands zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31' zstyle ':completion:*' list-colors 'rs=0' 'di=01;34' 'ln=04' 'hl=44;37' 'pi=40;33' 'so=40;35' 'do=40;31' 'bd=40;33;01' 'cd=40;33;01' 'or=40;31;01' 'su=37;41' 'sg=30;43' 'ca=30;41' 'tw=30;44' 'ow=31;44' 'st=37;44' 'ex=01;32' '*.tar=01;31' '*.tgz=01;31' '*.arj=01;31' '*.taz=01;31' '*.lzh=01;31' '*.lzma=01;31' '*.zip=01;31' '*.z=01;31' '*.Z=01;31' '*.dz=01;31' '*.gz=01;31' '*.bz2=01;31' '*.bz=01;31' '*.tbz2=01;31' '*.tz=01;31' '*.deb=01;31' '*.rpm=01;31' '*.jar=01;31' '*.rar=01;31' '*.ace=01;31' '*.zoo=01;31' '*.cpio=01;31' '*.7z=01;31' '*.rz=01;31' '*.jpg=01;35' '*.jpeg=01;35' '*.JPG=01;35' '*.JPEG=01;35' '*.gif=01;35' '*.bmp=01;35' '*.pbm=01;35' '*.pgm=01;35' '*.ppm=01;35' '*.tga=01;35' '*.xbm=01;35' '*.xpm=01;35' '*.tif=01;35' '*.tiff=01;35' '*.png=01;35' '*.svg=01;35' '*.svgz=01;35' '*.mng=01;35' '*.pcx=01;35' '*.xcf=01;35' '*.mov=00;32' '*.MOV=00;32' '*.mpg=00;32' '*.MPG=00;32' '*.mpeg=00;32' '*.MPEG=00;32' '*.m2v=00;32' '*.mkv=00;32' '*.ogm=00;32' '*.mp4=00;32' '*.m4v=00;32' '*.mp4v=00;32' '*.vob=00;32' '*.qt=00;32' '*.nuv=00;32' '*.wmv=00;32' '*.asf=00;32' '*.rm=00;32' '*.rmvb=00;32' '*.flc=00;32' '*.avi=00;32' '*.AVI=00;32' '*.fli=00;32' '*.flv=00;32' '*.gl=00;32' '*.dl=00;32' '*.xwd=00;32' '*.yuv=00;32' '*.axv=00;32' '*.anx=00;32' '*.ogv=00;32' '*.ogx=00;32' '*.aac=01;36' '*.au=01;36' '*.flac=01;36' '*.mid=01;36' '*.midi=01;36' '*.mka=01;36' '*.mp3=01;36' '*.mpc=01;36' '*.ogg=01;36' '*.ra=01;36' '*.wav=01;36' '*.m4a=01;36' '*.axa=01;36' '*.oga=01;36' '*.spx=01;36' '*.xspf=01;36' '*.class=01;33' '*.o=01;33' '*.so=01;33' '*.ko=01;33' '*.pdf=00;32' '*.dvi=00;32' '*.ps=00;32' '*.txt=01;37' '*.nfo=01;37' '*.log=01;31' '*Makefile=00;33' '*.make=00;33' '*.cmake=00;33' '*README=07;32' '*README.TXT=07;32' '*README.Debian=07;32' '*readme=07;32' '*readme.txt=07;32' '*INSTALL=04;32' '*NEWS=04;37' '*NOTES=04;37' '*TODO=04;37' '*COPYING=04;37' '*AUTHORS=04;37' '*PATCHES=04;37' '*STYLE=04;37' '*LICENCE=04;37' '*LICENSE=04;37' '*VERSION=04;37' '*BUGS=04;37' '*HISTORY=04;37' '*CHANGES=04;37' '*CHANGELOG=04;37' '*ChangeLog=04;37' '*Changelog=04;37' '*.swp=01;30' '*.aux=01;30' '*.tmp=01;30' zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' zstyle ':completion:*' menu 'select=2' zstyle ':completion:*' use-cache on Btw, you don't have to Cc: me, I am on the list. Greetings, Frank -- Frank Blendinger | fb(at)intoxicatedmind.net | GPG: 0x0BF2FE7A Fingerprint: BB64 F2B8 DFD8 BF90 0F2E 892B 72CF 7A41 0BF2 FE7A
Attachment:
signature.asc
Description: Digital signature