From 14810d6df13e0564a606b74e4c4e918e80862e25 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Sat, 24 Jul 1999 14:01:54 +0000 Subject: zsh-3.1.6-test-3 --- Completion/Core/compinit | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'Completion/Core/compinit') diff --git a/Completion/Core/compinit b/Completion/Core/compinit index 63e4c0860..808c20f5b 100644 --- a/Completion/Core/compinit +++ b/Completion/Core/compinit @@ -114,7 +114,8 @@ fi # whose name is given as the first argument be autoloaded. When defining # a function for command names the `-n' option may be given and keeps # the definitions from overriding any previous definitions for the -# commands. +# commands; with `-k', the `-n' option prevents compdef from rebinding +# a key sequence which is already bound. # For deleting definitions, the `-d' option must be given. Without the # `-p' option, this deletes definitions for functions for the commands # whose names are given as arguments. If combined with the `-p' option @@ -202,6 +203,10 @@ compdef() { # And bind the keys... for i; do + if [[ -n $new ]]; then + bindkey "$i" | read -A opt + [[ $opt[-1] = undefined-key ]] || continue + fi bindkey "$i" "$func" done ;; @@ -354,7 +359,7 @@ if [[ -z "$_i_done" ]]; then shift _i_line case $_i_tag in (\#compdef) - if [[ $_i_line[1] = -[pk] ]]; then + if [[ $_i_line[1] = -[pk](n|) ]]; then compdef ${_i_line[1]}a "${_i_file:t}" "${(@)_i_line[2,-1]}" else compdef -na "${_i_file:t}" "${_i_line[@]}" -- cgit 1.4.1