From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17981 invoked from network); 31 Mar 2000 08:14:17 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 31 Mar 2000 08:14:17 -0000 Received: (qmail 10629 invoked by alias); 31 Mar 2000 08:14:10 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10353 Received: (qmail 10620 invoked from network); 31 Mar 2000 08:14:09 -0000 Date: Fri, 31 Mar 2000 10:14:03 +0200 (MET DST) Message-Id: <200003310814.KAA06936@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk Subject: PATCH: _history_complete_word I think _history_complete_word could use the new tag label stuff, too. There is something in this function I don't understand: There is always one match inserted immediately. That's ok for a function like this, but why does _h_c_w then test for `$compstate[insert] = menu'? It means that this is almost unusable without normally using menucompletion (one can't cycle through the matches). Or did setting compstate[insert] to a number once start menucompletion so that it reported `menu' in $compstate[insert] on the next invocation? But we can test it with $compstate[old_insert] now. No patch for this, because I'm not completely sure which behaviour is desired. Bye Sven diff -ru ../z.old/Completion/Commands/_history_complete_word Completion/Commands/_history_complete_word --- ../z.old/Completion/Commands/_history_complete_word Fri Mar 31 09:19:24 2000 +++ Completion/Commands/_history_complete_word Fri Mar 31 09:57:06 2000 @@ -67,30 +67,26 @@ } _history_complete_word_gen_matches () { - if zstyle -t ":completion:${curcontext}:history-words" list; then - if zstyle -t ":completion:${curcontext}:history-words" sort; then - _description history-words expl 'history word' - else - _description -V history-words expl 'history word' - fi - else - if zstyle -t ":completion:${curcontext}:history-words" sort; then - expl=() - else - expl=('-V' '') - fi - fi + local opt [[ -n "$_hist_stop" ]] && PREFIX="$_hist_old_prefix" - local rem_dups if zstyle -t ":completion:${curcontext}:history-words" remove-all-dups; then - rem_dups='' + opt=- else - rem_dups='-1' + opt=-1 fi + if zstyle -t ":completion:${curcontext}:history-words" sort; then + opt="${opt}J" + else + opt="${opt}V" + fi + + _wanted "$opt" history-words expl 'history word' \ + compadd -Q - "$historywords[@]" - compadd "$expl[@]" $rem_dups -Q - "${(@)historywords:#[\$'\"]*}" + zstyle -t ":completion:${curcontext}:history-words" list || + compstate[list]= _hist_menu_length="$compstate[nmatches]" -- Sven Wischnowsky wischnow@informatik.hu-berlin.de