From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19657 invoked from network); 22 Sep 2000 15:23:59 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 22 Sep 2000 15:23:59 -0000 Received: (qmail 24853 invoked by alias); 22 Sep 2000 15:23:02 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 12857 Received: (qmail 24846 invoked from network); 22 Sep 2000 15:23:01 -0000 From: "Bart Schaefer" Message-Id: <1000922151308.ZM7937@candle.brasslantern.com> Date: Fri, 22 Sep 2000 15:13:08 +0000 In-Reply-To: <001901c022f3$1cf94770$21c9ca95@mow.siemens.ru> Comments: In reply to "Andrej Borsenkow" "PATCH: _insert_all_matches bindable command" (Sep 20, 3:08pm) References: <001901c022f3$1cf94770$21c9ca95@mow.siemens.ru> X-Mailer: Z-Mail (5.0.0 30July97) To: "Andrej Borsenkow" , Subject: Re: PATCH: _insert_all_matches bindable command MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Sep 20, 3:08pm, Andrej Borsenkow wrote: } } - I could not find a way to supress suffix addition. It is weird as it is } added only to the last match anyway. Sven? This happens any time you insert multiple matches. Look at the code for the add-space style in _expand -- it deliberately changes the compadd command for each match in order to suppress the suffix or change it to a space. } sourceforge CVS server is down, so I just send the function itself BTW, for those of you who don't get sourceforge user update mailings, the scheduled downtime this weekend has been canceled, and will be sometime in October instead. } zstyle -s ":completion:${curcontext}:" old-list list } } # If there is already an old list, } # and either the style :insert-all-matches:old-list is `always', ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ :completion:insert-all-matches:* old-list ?? } # or it is not `never', then insert the existing list } # (even if it was generated by another widget). } # Else just call completion and insert whatever matches it generated } # TODO: does not work in menu selection } } } if [[ -n $compstate[old_list] && $list != never && } $LASTWIDGET != _complete_help && $WIDGET != _complete_help ]]; then It's never possible for $WIDGET to be _complete_help, is it? Both this function and _complete_help must be separately bound to keystrokes. You would only need to test $WIDGET if this were a completer like _expand. And you can do if [[ -n $compstate[old_list] ]] && $LASTWIDGET != _complete_help && ! zstyle -t ":completion:${curcontext}:" old-list never; then instead of separately fetching the value into $list and then testing it. } else } curcontext="$oldcurcontext" } _main_complete } ret=$? } compstate[insert]=all } return $ret } fi Why reset the current context? And why not just _main_complete && compstate[insert]=all ?? Do you really want to set compstate[insert] when the function is going to return nonzero? -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net