From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16803 invoked from network); 22 Apr 2006 18:36:08 -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=AWL,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 18:36:08 -0000 Received: (qmail 76195 invoked from network); 22 Apr 2006 18:36:00 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 22 Apr 2006 18:36:00 -0000 Received: (qmail 6922 invoked by alias); 22 Apr 2006 18:35:53 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10166 Received: (qmail 6913 invoked from network); 22 Apr 2006 18:35:52 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 22 Apr 2006 18:35:52 -0000 Received: (qmail 75166 invoked from network); 22 Apr 2006 18:35:52 -0000 Received: from vms044pub.verizon.net (206.46.252.44) by a.mx.sunsite.dk with SMTP; 22 Apr 2006 18:35:52 -0000 Received: from torch.brasslantern.com ([71.116.76.26]) by vms044.mailsrvcs.net (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) with ESMTPA id <0IY400LTNZNP1GI0@vms044.mailsrvcs.net> for zsh-users@sunsite.dk; Sat, 22 Apr 2006 13:35:50 -0500 (CDT) Received: from torch.brasslantern.com (localhost.localdomain [127.0.0.1]) by torch.brasslantern.com (8.13.1/8.13.1) with ESMTP id k3MIZj33009248 for ; Sat, 22 Apr 2006 11:35:49 -0700 Received: (from schaefer@localhost) by torch.brasslantern.com (8.13.1/8.13.1/Submit) id k3MIZiJQ009247 for zsh-users@sunsite.dk; Sat, 22 Apr 2006 11:35:44 -0700 Date: Sat, 22 Apr 2006 11:35:44 -0700 From: Bart Schaefer Subject: Re: Problem with motion commands defined using match-word-by-style used with vi-delete In-reply-to: To: "Zsh Users" Message-id: <060422113544.ZM9246@torch.brasslantern.com> MIME-version: 1.0 X-Mailer: OpenZMail Classic (0.9.2 24April2005) Content-type: text/plain; charset=us-ascii References: <060421220035.ZM7625@torch.brasslantern.com> Comments: In reply to "Nikolai Weibull" "Re: Problem with motion commands defined using match-word-by-style used with vi-delete" (Apr 22, 1:04pm) On Apr 22, 1:04pm, Nikolai Weibull wrote: } } > +local curcontext=":zle:$WIDGETFUNC" word } } 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: } } zle -N forward-parameter forward-word-match } zle -N backward-parameter backward-word-match Oh, I see. I didn't realize you meant you'd invented a completely new widget name. I assumed you were referring to e.g. zle -N forward-word forward-word-match zle -N backward-word backward-word-match Note that you have to be careful (as you were) that the new names you bind to {forward,backward}-word-match contain the corresponding string "forward" or "backward", and that you always bind both of them. If you don't, negative values of $NUMERIC will cause errors. } > } 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) :-). Yes, I was agreeing with you. On further checking, however, the value of $WIDGETFUNC within the widget called by vi-delete appears to be ".internal" which means that although it's possible to determine *when* one of these functions has been called from vi-delete, it's not possible to determine under which name it was called. So a custom vi-delete replacement appears to be required, and perhaps we should consider adding one to the distribution. The same is going to be true of vi-change and any other widget that combines with a motion widget in this way.