From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 911 invoked from network); 5 Jul 2002 19:38:39 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 5 Jul 2002 19:38:39 -0000 Received: (qmail 27683 invoked by alias); 5 Jul 2002 19:38:23 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5143 Received: (qmail 27671 invoked from network); 5 Jul 2002 19:38:22 -0000 From: "Bart Schaefer" Message-Id: <1020705193746.ZM22908@candle.brasslantern.com> Date: Fri, 5 Jul 2002 19:37:45 +0000 In-Reply-To: <20020704124507.A32123@corelli.new.ox.ac.uk> Comments: In reply to Adam Spiers "substring version of history-complete-word?" (Jul 4, 12:45pm) References: <20020704124507.A32123@corelli.new.ox.ac.uk> X-Mailer: Z-Mail (5.0.0 30July97) To: Adam Spiers , zsh-users@sunsite.dk Subject: Re: substring version of history-complete-word? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Jul 4, 12:45pm, Adam Spiers wrote: } } Is there any way of performing completion of words from history based } on a substring rather than a prefix? With the proper value of the matcher-list style, it should "just work." E.g.: schaefer<507> echo tec schaefer<507> echo aztec.zanshin.com My particular settings cause words that match prefixes to be preferred over words that match substrings: schaefer<507> echo zan schaefer<507> echo zanshin@ Or: schaefer<507> echo com Completing history word compdump' commit compdump' commit (Hmm, I guess I don't have the remove-all-dups style set.) } Ideally, it would be retrievable incrementally in the same way as C-r } fetches whole lines. I don't have a suggestion for how to do this except using incremental menu selection (added to the CVS dev tree by Sven in zsh-workers/17366). I haven't figured out how to set the matcher-list style specifically for history completion, the above is all the result of my generic matchers. There's some pretty strange code for styles in _history_complete_word: if [[ -z "$curcontext" ]] then curcontext=history-words::: else curcontext="history-words${curcontext#*:}" fi [...] zstyle -t ":completion:${curcontext}:history-words" stop && stop=yes zstyle -T ":completion:${curcontext}:history-words" list || compstate[list]='' (So we have styles that look like *:history-words:*:history-words ?? Is that really intentional?) -- 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