From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15148 invoked from network); 7 Oct 2006 02:31:50 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.6 (2006-10-03) 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.6 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 7 Oct 2006 02:31:50 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 56446 invoked from network); 7 Oct 2006 02:31:43 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 7 Oct 2006 02:31:43 -0000 Received: (qmail 1720 invoked by alias); 7 Oct 2006 02:31:35 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10805 Received: (qmail 1711 invoked from network); 7 Oct 2006 02:31:34 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 7 Oct 2006 02:31:34 -0000 Received: (qmail 55209 invoked from network); 7 Oct 2006 02:31:34 -0000 Received: from vms040pub.verizon.net (206.46.252.40) by a.mx.sunsite.dk with SMTP; 7 Oct 2006 02:31:33 -0000 Received: from torch.brasslantern.com ([71.116.118.106]) by vms040.mailsrvcs.net (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) with ESMTPA id <0J6Q00FPAV0JDV07@vms040.mailsrvcs.net> for zsh-users@sunsite.dk; Fri, 06 Oct 2006 21:31:32 -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 k972VVBL029395 for ; Fri, 06 Oct 2006 19:31:31 -0700 Received: (from schaefer@localhost) by torch.brasslantern.com (8.13.1/8.13.1/Submit) id k972VVdA029394 for zsh-users@sunsite.dk; Fri, 06 Oct 2006 19:31:31 -0700 Date: Fri, 06 Oct 2006 19:31:30 -0700 From: Bart Schaefer Subject: Re: ZLE widget to run gdb on command line In-reply-to: <20061006145222.GA32307@namib.cs.utk.edu> To: zsh-users@sunsite.dk Message-id: <061006193131.ZM29393@torch.brasslantern.com> MIME-version: 1.0 X-Mailer: OpenZMail Classic (0.9.2 24April2005) Content-type: text/plain; charset=us-ascii References: <20061006145222.GA32307@namib.cs.utk.edu> Comments: In reply to Chris Johnson "ZLE widget to run gdb on command line" (Oct 6, 10:52am) On Oct 6, 10:52am, Chris Johnson wrote: } } print -s ${(z)BUFFER} } BUFFER="gdb !!0 -x =(echo run !!1*)" } zle expand-history } zle accept-line This is a useful idea, but you have a whole function scope to play with. No need to resort to expanding strings from the history. set -- "${(@z)BUFFER}" BUFFER="gdb $argv[1] -x =(print -r run ${(q)argv[2-]})" zle accept-line If you want the original line to appear in the history, insert print -s -- "$@" after the "set" command.