From 881d24cd48b4c659760961991e0f029900c54a8e Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Wed, 17 Nov 1999 09:57:16 +0000 Subject: manual/8654 --- Completion/Base/_describe | 18 ++++++------------ Completion/Base/_first | 2 +- Completion/Base/_regex_arguments | 2 +- Completion/Builtins/_echotc | 2 +- Completion/Commands/_history_complete_word | 29 ++++++++++++++--------------- Completion/Core/compinit | 2 +- 6 files changed, 24 insertions(+), 31 deletions(-) (limited to 'Completion') diff --git a/Completion/Base/_describe b/Completion/Base/_describe index 181ccbfcb..f1fbbafc6 100644 --- a/Completion/Base/_describe +++ b/Completion/Base/_describe @@ -2,21 +2,15 @@ # This can be used to add options or values with descriptions as matches. -local _cmd _opt _expl _tmps _tmpd _tmpmd _tmpms _ret=1 _showd _nm _hide _args +local _opt _expl _tmps _tmpd _tmpmd _tmpms _ret=1 _showd _nm _hide _args local _type=values -_cmd="$words[1]" +# Get the option. -# Get the options. - -while getopts 'oc:' _opt; do - if [[ "$_opt" = o ]]; then - _type=options - else - _cmd="$OPTARG" - fi -done -shift OPTIND-1 +if [[ "$1" = -o ]]; then + _type=options + shift +fi # Do the tests. `showd' is set if the descriptions should be shown. diff --git a/Completion/Base/_first b/Completion/Base/_first index 7c070d743..0e281d061 100644 --- a/Completion/Base/_first +++ b/Completion/Base/_first @@ -50,7 +50,7 @@ # # We first search in the last ten words, then in the last # # twenty words, and so on... # while [[ i -le max ]]; do -# if _style history-entries sort; then +# if _style history-words sort; then # _description expl "history ($n)" # else # _description -V expl "history ($n)" diff --git a/Completion/Base/_regex_arguments b/Completion/Base/_regex_arguments index ba6d330da..918eafc5c 100644 --- a/Completion/Base/_regex_arguments +++ b/Completion/Base/_regex_arguments @@ -330,7 +330,7 @@ _regex_arguments () { local i state next local cache_dir - _style -s regex argument-path cache_dir + _style -s regex cache-path cache_dir [[ -z "$cache_dir" ]] && cache_dir="$HOME/.zsh/regex_arguments" local cache_file="$cache_dir/$1" local cache_test diff --git a/Completion/Builtins/_echotc b/Completion/Builtins/_echotc index 06b78408d..4051c1945 100644 --- a/Completion/Builtins/_echotc +++ b/Completion/Builtins/_echotc @@ -2,7 +2,7 @@ local expl -_wanted capabilities expl 'terminal capability' && +_wanted arguments expl 'terminal capability' && compadd "$expl[@]" \ al dc dl do le up al bl cd ce cl cr \ dc dl do ho is le ma nd nl se so up diff --git a/Completion/Commands/_history_complete_word b/Completion/Commands/_history_complete_word index ee6ac2de2..07db1eeb9 100644 --- a/Completion/Commands/_history_complete_word +++ b/Completion/Commands/_history_complete_word @@ -5,15 +5,15 @@ # by Adam Spiers, with help gratefully received from # Sven Wischnowsky and Bart Schaefer # -# Available configuration keys: +# Available styles: # -# :history-entries:list -- display lists of available matches -# :history-entries:stop -- prevent looping at beginning and end of matches -# during menu-completion -# :history-entries:sort -- sort matches lexically (default is to sort by age) -# :history-entries:remove-all-dups -- -# remove /all/ duplicate matches rather than just -# consecutives +# :history-words:list -- display lists of available matches +# :history-words:stop -- prevent looping at beginning and end of matches +# during menu-completion +# :history-words:sort -- sort matches lexically (default is to sort by age) +# :history-words:remove-all-dups -- +# remove /all/ duplicate matches rather than just +# consecutives # _history_complete_word () { @@ -25,9 +25,9 @@ _history_complete_word () { direction=newer fi - _style -s history-entries stop stop + _style -s history-words stop stop - _style history-entries list || compstate[list]='' + _style history-words list || compstate[list]='' if [[ -n "$compstate[old_list]" && ( -n "$stop" || "$compstate[insert]" = menu ) ]] ; then @@ -36,7 +36,6 @@ _history_complete_word () { if [[ compstate[old_insert] -eq $_hist_menu_length || "$_hist_stop" == 'oldest' ]]; then _hist_stop='oldest' - _style history-entries [[ "$stop" = verbose ]] && _message 'beginning of history reached' elif [[ "$_hist_stop" == 'newest' ]]; then @@ -68,14 +67,14 @@ _history_complete_word () { } _history_complete_word_gen_matches () { - if _style history-entries list; then - if _style history-entries sort; then + if _style history-words list; then + if _style history-words sort; then _description expl 'history word' else _description -V expl 'history word' fi else - if _style history-entries sort; then + if _style history-words sort; then expl=() else expl=('-V' '') @@ -85,7 +84,7 @@ _history_complete_word_gen_matches () { [[ -n "$_hist_stop" ]] && PREFIX="$_hist_old_prefix" local rem_dups - if _style history-entries remove-all-dups; then + if _style history-words remove-all-dups; then rem_dups='' else rem_dups='-1' diff --git a/Completion/Core/compinit b/Completion/Core/compinit index a16d43533..43c8db7e7 100644 --- a/Completion/Core/compinit +++ b/Completion/Core/compinit @@ -406,7 +406,7 @@ compstyle '*:options' prefix-hidden yes" tmp="':expand-word' ${name#expandword_} ${(qq)val}" ;; history_*) - tmp="'*:history-entries' ${name#history_} ${(qq)val}" + tmp="'*:history-words ${name#history_} ${(qq)val}" ;; completer) tmp="'*' completer ${${(qqs.:.)val}}" -- cgit 1.4.1