From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 461 invoked from network); 12 Apr 2000 14:44:24 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 12 Apr 2000 14:44:24 -0000 Received: (qmail 1241 invoked by alias); 12 Apr 2000 14:44:03 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10701 Received: (qmail 1228 invoked from network); 12 Apr 2000 14:44:02 -0000 Message-Id: Date: Wed, 12 Apr 2000 15:43:57 +0100 (BST) From: kiddleo@frankie.logica.co.uk (Oliver Kiddle) To: zsh-workers@sunsite.auc.dk Subject: PATCH: use _arguments in _bindkey Attached is a patch to _bindkey to to make use of _arguments. I have also fixed a typo in to docs for bindkey. I'll attempt to commit this to cvs myself. Oliver Index: Completion/Builtins/_bindkey =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Builtins/_bindkey,v retrieving revision 1.1.1.11 diff -u -r1.1.1.11 _bindkey --- Completion/Builtins/_bindkey 2000/03/23 04:19:27 1.1.1.11 +++ Completion/Builtins/_bindkey 2000/04/12 14:37:35 @@ -7,10 +7,30 @@ # # Where appropriate, will complete keymaps instead of widgets. -local expl +local state expl line -if [[ "$words[2]" = -*[DAN]* || "$words[CURRENT-1]" = -*M ]]; then - _wanted -C -M keymaps expl keymap compadd - "$keymaps[@]" -else - _wanted widgets expl widget compadd -M 'r:|-=* r:|=*' - "${(@k)widgets}" -fi +_arguments -C -s \ + '(-v -a -M -l -D -A -N)-e[select emacs keymap and bind it to main]' \ + '(-e -a -M -l -D -A -N)-v[select viins keymap and bind it to main]' \ + '(-e -v -M -l -D -A -N)-a[select vicmd keymap]' \ + '(-e -v -a -l -D -A -N)-M[specify keymap to select]:keymap:->keymap' \ + '(-e -v -a -M -D -A -N -m -r -s -R *)-l[list existing keymap names]' \ + '(-e -v -a -d -A -N -m -r -s -R *)-L[output in form of bindkey commands]' \ + '(-e -v -a -l -D -A -N -m -r -s -R *)-d[delete existing keymaps and reset to default state]' \ + '(-e -v -a -M -l -d -A -N -m -r -s -R *)-D[delete named keymaps]:*:keymap:->keymap' \ + '(-e -v -a -M -l -L -d -D -N -m -r -s -R *)-A[create alias to keymap]:old-keymap:->keymap:new-keymap:->keymap' \ + '(-e -v -a -M -l -L -d -D -A -m -r -s -R *)-N[create new keymap]:new-keymap:->keymap:old-keymap to copy:->keymap' \ + '(-l -L -d -D -A -N -r -s -r -R *)-m[add builtin meta-key bindings to selected keymape]' \ + '(-l -L -d -D -A -N -m -s *)-r[unbind specified in-strings]:*:in-string' \ + '(-l -L -d -D -A -N -m -r *)-s[bind each in-string to each out-string]:*:key string' \ + '(-e -v -a -M -l -L -d -D -A -N -m)-R[interpret in-strings as ranges]' \ + '(-l -L -d -A -N -m -r -s)*::widgets:->widget' + +case $state in + keymap) + _wanted -C -M keymaps expl keymap compadd - "$keymaps[@]" + ;; + widget) + _wanted widgets expl widget compadd -M 'r:|-=* r:|=*' - "${(@k)widgets}" + ;; +esac Index: Doc/Zsh/mod_zle.yo =================================================================== RCS file: /cvsroot/zsh/zsh/Doc/Zsh/mod_zle.yo,v retrieving revision 1.2 diff -u -r1.2 mod_zle.yo --- Doc/Zsh/mod_zle.yo 2000/04/01 20:43:44 1.2 +++ Doc/Zsh/mod_zle.yo 2000/04/12 14:37:35 @@ -72,7 +72,7 @@ ) enditem() -To use a newly created keymamp, it should be linked to tt(main). Hence +To use a newly created keymap, it should be linked to tt(main). Hence the sequence of commands to create and use a new keymap `tt(mymap)' initialized from the tt(emacs) keymap (which remains unchanged) is: