From bccfe3b1576c2a1eb1219ec3894d89998249fbcf Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Wed, 15 Dec 1999 02:28:14 +0000 Subject: zsh-workers/9048 --- Completion/Core/_sort_tags | 59 +++++++++++++++++++++++++++------------------- Completion/Core/compinit | 2 +- Completion/User/_mh | 8 +++---- 3 files changed, 39 insertions(+), 30 deletions(-) (limited to 'Completion') diff --git a/Completion/Core/_sort_tags b/Completion/Core/_sort_tags index 6f07eec1c..20897823a 100644 --- a/Completion/Core/_sort_tags +++ b/Completion/Core/_sort_tags @@ -1,28 +1,39 @@ #autoload -comptry arguments values -comptry options +local stags tag -case "$curcontext" in -# Some silly examples commented out: -# -# *::*p[bgpn]m:*) # change the order for file-completion -# comptry globbed-files directories -# comptry all-files -# ;; -# *::dvips::-o*) # automatic context set by _arguments -# comptry all-files -# return -# ;; -# *::kill:*) -# comptry processes -# return # this return ensures that we use only processes -# ;; -*) - comptry globbed-files - comptry directories - comptry all-files - ;; -esac +if zstyle -a ":completion${curcontext}" sort-tags stags; then -comptry "$@" + for tag in $stags; do + [[ $tag != '' ]] && comptry ${=tag} + done + +else + + comptry arguments values + comptry options + + case "$curcontext" in + # Some silly examples commented out: + # + # *::*p[bgpn]m:*) # change the order for file-completion + # comptry globbed-files directories + # comptry all-files + # ;; + # *::dvips::-o*) # automatic context set by _arguments + # comptry all-files + # return + # ;; + # *::kill:*) + # comptry processes + # return # this return ensures that we use only processes + # ;; + *) + comptry globbed-files + comptry directories + comptry all-files + ;; + esac + + comptry "$@" +fi diff --git a/Completion/Core/compinit b/Completion/Core/compinit index 59aa137b1..09fb68467 100644 --- a/Completion/Core/compinit +++ b/Completion/Core/compinit @@ -475,7 +475,7 @@ compstyle() { zstyle ':completion:*' verbose 'yes' zstyle ':completion:*' prefix-needed 'yes' zstyle ':completion:*' prefix-hidden 'no' -zstyle ':completion:correct' accept '2n' +zstyle ':completion:correct' max-errors '2' numeric zstyle ':completion:correct' prompt 'correct to:' zstyle ':completion:*' completer '_complete' zstyle ':completion*:default' list-colors no=0 fi=0 di=0 ln=0 pi=0 so=0 bd=0 cd=0 ex=0 diff --git a/Completion/User/_mh b/Completion/User/_mh index bdd4c74b3..f02aee9b5 100644 --- a/Completion/User/_mh +++ b/Completion/User/_mh @@ -35,9 +35,7 @@ elif compset -P 1 '[+@]' || [[ "$prev" = -draftfolder ]]; then mhpath=$(mhpath) fi - # painless, or what? - _description files expl 'MH folder' - _path_files "$expl[@]" -W mhpath -/ + _wanted files expl 'MH folder' && _path_files "$expl[@]" -W mhpath -/ elif [[ "$prev" = -(editor|(whatnow|rmm|show|more)proc) ]]; then _command_names -e elif [[ "$prev" = -file ]]; then @@ -50,8 +48,8 @@ elif [[ "$prev" = -(form|audit|filter) ]]; then [[ -d $mhlib ]] || { mhlib=$(mhparam mhlproc); mhlib=$mhlib:h; } mhfpath=($mymhdir $mhlib) - _description files expl 'MH template file' - _files "$expl[@]" -W mhfpath -g '*(.)' + _wanted files expl 'MH template file' && + _files "$expl[@]" -W mhfpath -g '*(.)' elif [[ "$prev" = -(no|)cc ]]; then _wanted -C "$prev" values expl 'CC address' && compadd "$expl[@]" all to cc me -- cgit 1.4.1