From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15664 invoked from network); 15 Jun 2006 16:19:34 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.3 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 15 Jun 2006 16:19:34 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 44038 invoked from network); 15 Jun 2006 16:19:28 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 15 Jun 2006 16:19:28 -0000 Received: (qmail 5205 invoked by alias); 15 Jun 2006 16:19:17 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10375 Received: (qmail 5196 invoked from network); 15 Jun 2006 16:19:16 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 15 Jun 2006 16:19:16 -0000 Received: (qmail 42230 invoked from network); 15 Jun 2006 16:19:16 -0000 Received: from cluster-d.mailcontrol.com (217.69.20.190) by a.mx.sunsite.dk with SMTP; 15 Jun 2006 16:19:15 -0000 Received: from cameurexb01.EUROPE.ROOT.PRI ([62.189.241.200]) by rly12d.srv.mailcontrol.com (MailControl) with ESMTP id k5FGJAVF031769 for ; Thu, 15 Jun 2006 17:19:10 +0100 Received: from news01.csr.com ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.1830); Thu, 15 Jun 2006 17:18:13 +0100 Received: from news01.csr.com (localhost.localdomain [127.0.0.1]) by news01.csr.com (8.13.4/8.13.4) with ESMTP id k5FGJBGF022074 for ; Thu, 15 Jun 2006 17:19:11 +0100 Received: from csr.com (pws@localhost) by news01.csr.com (8.13.4/8.13.4/Submit) with ESMTP id k5FGJBFb022067 for ; Thu, 15 Jun 2006 17:19:11 +0100 Message-Id: <200606151619.k5FGJBFb022067@news01.csr.com> X-Authentication-Warning: news01.csr.com: pws owned process doing -bs To: zsh-users@sunsite.dk (Zsh users list) Subject: Re: java class names completion widget In-reply-to: <200606151938.36646.kos@supportwizard.com> References: <200606052240.27880.kos@supportwizard.com> <200606071047.k57AljuP028426@news01.csr.com> <200606151938.36646.kos@supportwizard.com> Date: Thu, 15 Jun 2006 17:19:10 +0100 From: Peter Stephenson X-OriginalArrivalTime: 15 Jun 2006 16:18:13.0798 (UTC) FILETIME=[4D4CD460:01C69097] Content-Type: text/plain MIME-Version: 1.0 X-Scanned-By: MailControl A-07-00-10 (www.mailcontrol.com) on 10.68.0.122 Konstantin Sobolev wrote: > It works, but how can I force it to use menu completion instead of cycling? > Playing with > zstyle ':completion:*' menu select > gives a bit weird effect: > (with descriptions turned on) I was hoping you weren't going to ask that... I think a change of tack is the easiest way. Instead of hacking the _expand completer, which has some odd settings, the following goes through the normal completer; the trick with _generic is to allow us to use a widget bound to a key but still use the normal completion logic. Then we simply do the expansion by hand and add the results unconditionally, i.e. without additional matching (compadd -U). This may have side effects but it seems basically OK. _expand_java_path now contains: #autoload local MATCH MBEGIN MEND pref suf pref="**/${PREFIX//(#m)[[:upper:]]/${MATCH}[^[:upper:]]#}" suf="${SUFFIX//(#m)[[:upper:]]/${MATCH}[^[:upper:]]#}*.java" local expl local -a exp exp=(${~pref}${~suf}(N)) if (( ${#exp} )); then _wanted java-files expl 'java source file (search)' \ compadd -U -a exp else return 1 fi and .zshrc now requires the following setup: zle -C expand-java-path complete-word _generic zstyle ':completion:expand-java-path:*' completer _expand_java_path bindkey '^xj' expand-java-path -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070 To access the latest news from CSR copy this link into a web browser: http://www.csr.com/email_sig.php