From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13232 invoked from network); 20 May 2005 14:24:52 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 20 May 2005 14:24:52 -0000 Received: (qmail 75416 invoked from network); 20 May 2005 14:24:47 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 20 May 2005 14:24:47 -0000 Received: (qmail 26238 invoked by alias); 20 May 2005 14:24:40 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8877 Received: (qmail 26224 invoked from network); 20 May 2005 14:24:39 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 20 May 2005 14:24:39 -0000 Received: (qmail 74383 invoked from network); 20 May 2005 14:24:39 -0000 Received: from dep.let.rug.nl (129.125.8.60) by a.mx.sunsite.dk with SMTP; 20 May 2005 14:24:33 -0000 Received: from dep.let.rug.nl ([129.125.8.60]) by dep.let.rug.nl (SMSSMTP 4.1.0.19) with SMTP id M2005052016223730367 for ; Fri, 20 May 2005 16:22:37 +0200 Received: from loki (postfix@loki.let.rug.nl [129.125.8.86]) by dep.let.rug.nl (8.12.10/8.12.10) with ESMTP id j4KEMaVk011366 for ; Fri, 20 May 2005 16:22:36 +0200 (MEST) Received: by loki (Postfix, from userid 7006) id C5119E8FE; Fri, 20 May 2005 16:24:32 +0200 (CEST) Date: Fri, 20 May 2005 16:24:29 +0200 From: Francisco Borges To: Zsh users list Subject: Re: [zsh] Re: retrieving the results of last command? Message-ID: <20050520142429.GA1926@let.rug.nl> Mail-Followup-To: Zsh users list References: <20050520121834.GA32499@let.rug.nl> <1049.1116593698@csr.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <1049.1116593698@csr.com> X-Operating-System: Linux/2.6.8-1-686 (i686) X-Editor: GNU Emacs 22.0.50.1 Organization: Alfa Informatica - Rijksuniversiteit Groningen User-Agent: Mutt/1.5.6+20040907i X-Whitelist: OK X-Scanned-By: milter-spamc/0.25.321 (dep.let.rug.nl [129.125.8.60]); Fri, 20 May 2005 16:22:37 +0200 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by dep.let.rug.nl id j4KEMaVk011366 X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.6 required=6.0 tests=BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.6 =BB On Fri, May 20, 2005 at 01:54PM +0100, Peter Stephenson wrote: > You can simplify retrieving the command by using the parameter history > from the zsh/parameter library, which contains the history indexed > by the history line number, and the standard parameter HISTCMD which > gives the current history line number. > > Normal "insert" widgets append stuff to the left of the cursor > rather than replacing RBUFFER. > > You whould be able to do this: > > zmodload -i zsh/parameter > insert-last-command-output() { > LBUFFER+=3D"$(eval $history[$((HISTCMD-1))])" > } Thanks a lot for the corrections and explantion! Cheers, Francisco.