From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28722 invoked from network); 5 Jun 2004 19:14:56 -0000 Received: from thor.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.86) by ns1.primenet.com.au with SMTP; 5 Jun 2004 19:14:56 -0000 Received: (qmail 12392 invoked from network); 5 Jun 2004 19:14:21 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 5 Jun 2004 19:14:21 -0000 Received: (qmail 8919 invoked by alias); 5 Jun 2004 19:14:10 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7485 Received: (qmail 8888 invoked from network); 5 Jun 2004 19:14:10 -0000 Received: from thor.dotsrc.org (HELO a.mx.sunsite.dk) (qmailr@130.225.247.86) by sunsite.dk with SMTP; 5 Jun 2004 19:14:07 -0000 Received: (qmail 11024 invoked from network); 5 Jun 2004 19:13:39 -0000 Received: from moonbase.zanshin.com (root@64.84.47.139) by a.mx.sunsite.dk with SMTP; 5 Jun 2004 19:13:36 -0000 Received: from toltec.zanshin.com (toltec.zanshin.com [64.84.47.166]) by moonbase.zanshin.com (8.12.11/8.12.11) with ESMTP id i55JDXUn028781 for ; Sat, 5 Jun 2004 12:13:33 -0700 Date: Sat, 5 Jun 2004 12:10:48 -0700 (PDT) From: Bart Schaefer Sender: schaefer@toltec.zanshin.com Reply-To: Bart Schaefer To: Zsh Users Subject: Re: contect sensitive remapping In-Reply-To: <20040525090231.GA5701@fruitcom.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=0.0 required=6.0 tests=BAYES_50 autolearn=no version=2.63 X-Spam-Hits: 0.0 [I'm just back from 3 weeks in Japan, and catching up on mail sort of in reverse order.] On Tue, 25 May 2004, Eric Smith wrote: > I would like to do a context sensitive remapping of . Unfortunately there's no such thing as context-sensitive key rebinding. There are certain "contexts" that change to new keymaps, but those are effectively recursive invocations of the editor, not contexts in the sense used by the completion system. So the best you can do is to redefine the accept-line widget to always test for this situation, invoke completion if need be, and then fall through to "zle .accept-line". > I guess this would be along the lines of a completion function You'd need an ordinary widget for the accept-line replacement, plus a completion widget to handle the context testing and possible completion. Call the completion widget from the accept-line replacement with the "zle" command. I'd start by getting ordinary completion to work as you want for the commands in question before attempting anything with accept-line.