From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5832 invoked from network); 22 Apr 2006 11:05:13 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,FORGED_RCVD_HELO autolearn=ham version=3.1.1 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 22 Apr 2006 11:05:13 -0000 Received: (qmail 20595 invoked from network); 22 Apr 2006 11:04:58 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 22 Apr 2006 11:04:58 -0000 Received: (qmail 6319 invoked by alias); 22 Apr 2006 11:04:48 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10165 Received: (qmail 6309 invoked from network); 22 Apr 2006 11:04:47 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 22 Apr 2006 11:04:47 -0000 Received: (qmail 19268 invoked from network); 22 Apr 2006 11:04:47 -0000 Received: from wproxy.gmail.com (64.233.184.226) by a.mx.sunsite.dk with SMTP; 22 Apr 2006 11:04:46 -0000 Received: by wproxy.gmail.com with SMTP id i23so470534wra for ; Sat, 22 Apr 2006 04:04:42 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=ATO9/ae0+rU+6W1DCQupLZt2SrEGdgolJVV+D0qNOznAFYPdAWHtaIOCcabQ+tZkNFLrxj1+DlSTiOhdvBkrOGYRaxKQjGIcv1brjepsoemKrQFn9AMAaDqcIbmozYaklZgyIgNf033CpP/D1di0CEW2uVxDTbfSSUpzt3Zceps= Received: by 10.64.143.3 with SMTP id q3mr600888qbd; Sat, 22 Apr 2006 04:04:42 -0700 (PDT) Received: by 10.64.142.16 with HTTP; Sat, 22 Apr 2006 04:04:42 -0700 (PDT) Message-ID: Date: Sat, 22 Apr 2006 13:04:42 +0200 From: "Nikolai Weibull" Sender: nikolai.weibull@gmail.com To: "Bart Schaefer" Subject: Re: Problem with motion commands defined using match-word-by-style used with vi-delete Cc: "Zsh Users" In-Reply-To: <060421220035.ZM7625@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <060421220035.ZM7625@torch.brasslantern.com> On 4/22/06, Bart Schaefer wrote: > On Apr 22, 1:10am, Nikolai Weibull wrote: > } > } [...] $curcontext is set to zle:vi-delete, not, for example, > } zle:forward-word-match. > } > } It seems that this issue can be quite hard to fix, considering how > } vi-delete is currently implemented. But perhaps there's an easy > } solution that I was unable to spot. > > Try applying this same small change to each of the *-match functions: > > --- 8< --- > @@ -3,7 +3,7 @@ > > autoload match-words-by-style > > -local curcontext=3D":zle:$WIDGET" word > +local curcontext=3D":zle:$WIDGETFUNC" word > local -a matched_words > integer count=3D${NUMERIC:-1} > > --- 8< --- > > I didn't actually try that because I'm not a vi mode user and I'm in > a hurry :-/ but it seems like it should do the trick. If it doesn't, > try ${WIDGETFUNC%-match} instead. Hm, that sets curcontext to :zle:forward-word-match (or :zle:forward-word), which means it won't be possible to use zstyles anymore. The following is what I'm using: autoload -U forward-word-match autoload -U backward-word-match zle -N forward-parameter forward-word-match zle -N backward-parameter backward-word-match zstyle ':zle:forward-parameter' word-style shell zstyle ':zle:backward-parameter' word-style shell bindkey -a ")" forward-parameter bindkey -a "(" backward-parameter > } Until then I'm going to use my own vi-delete > > Creating a vi-delete-match function seems like the next best thing. That's what I meant (I think) :-). nikolai