From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11783 invoked from network); 1 Oct 2009 21:07:39 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from new-brage.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.254.104) by ns1.primenet.com.au with SMTP; 1 Oct 2009 21:07:39 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 81883 invoked from network); 1 Oct 2009 20:58:45 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 1 Oct 2009 20:58:45 -0000 Received: (qmail 3737 invoked by alias); 1 Oct 2009 20:58:34 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 14446 Received: (qmail 3725 invoked from network); 1 Oct 2009 20:58:34 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 1 Oct 2009 20:58:34 -0000 Received: from n3b.bullet.mail.ac4.yahoo.com (n3b.bullet.mail.ac4.yahoo.com [76.13.13.73]) by bifrost.dotsrc.org (Postfix) with SMTP id 65FD78058CAB for ; Thu, 1 Oct 2009 22:58:26 +0200 (CEST) Received: from [76.13.13.26] by n3.bullet.mail.ac4.yahoo.com with NNFMP; 01 Oct 2009 20:58:25 -0000 Received: from [76.13.10.178] by t3.bullet.mail.ac4.yahoo.com with NNFMP; 01 Oct 2009 20:58:25 -0000 Received: from [127.0.0.1] by omp119.mail.ac4.yahoo.com with NNFMP; 01 Oct 2009 20:58:25 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 848472.33641.bm@omp119.mail.ac4.yahoo.com Received: (qmail 38657 invoked by uid 60001); 1 Oct 2009 20:58:25 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1254430705; bh=g2bIGolEg85oISFjdiXPO1SJ2ymNOvrnn/SZEwq8b4k=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=I8mCG8SLr/iZCmTMjtGP0V8SFtSeeD6BzM2eLretmqq7Tf7YKdxf7p4HYqCr72uLB1L2BsFexTim/HYCEm2z7fLpbKrzaB93i0hn+9BUTgFic8VokJo6pDUwBDB0V/6dwx1cGzNqsK+qtjIDVgw0Jv+xHpZqFzzfFNkEPKsRGp0= DomainKey-Signature:a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=B1bDUsFawr9FFMU/XKGU2qhVl40xgmPdpNCzSbwJhzTYFUjMH+ID8oS1nruN0yO8atP2kHnuIlIy5nxIfJ4fUrJDBarnLjycQ3IVRALYwvJ6b/Fqa+qgmzDbk2scoUF5+zAcGUj/OTydEEotFI25kpsRWNIKxwICzbxAR142Klc=; Message-ID: <541376.31256.qm@web65614.mail.ac4.yahoo.com> X-YMail-OSG: DRHPtMkVM1nDL0NoBxPt7uorozVHFG5ZV.ytLbCz3tN3Z4X_sMDp4fxghuMuRie3ofgSd5atUBOFOo_rz54.GXFE9HXmeotW5cmWA41m.RosS5YvLAWLHAO5QnDkPIujHSjYDNV_qa7zJ8rK9CnIOSUdK1_HDGwtt.y.FvkVDrNS74t1x6Tyt8DmtizA_cMv2z5oF_yIh63Y2.4q8THxGLG7oR1DiXN2qIRtR1_xitCDMHkzKr6uZ9cHWfx7atZtrC8Qzh6Wq52l53T6EfngU6ds8L_RkGyS.IAFUYTOrpNMeJL2pRRbhHbZsOizyxB9CVTeZZjw909uyXIriFBVQMdi_nzEPU_J5xkXjWNZg2lmIwcirUISxYna2OUIb6p91V6Ae3GSG10TjKd_PkdoShmS56mG1DDC8vXt8gEO6cwT3C2tEQ-- Received: from [77.251.55.98] by web65614.mail.ac4.yahoo.com via HTTP; Thu, 01 Oct 2009 13:58:25 PDT X-Mailer: YahooMailClassic/7.0.14 YahooMailWebService/0.7.347.3 Date: Thu, 1 Oct 2009 13:58:25 -0700 (PDT) From: Guido van Steen Subject: Re: matlab-history-beginning-search-backward To: Peter Stephenson Cc: zsh-users@sunsite.dk In-Reply-To: <200910010838.n918cMiM025545@news01.csr.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: ClamAV 0.94.2/9859/Thu Oct 1 17:14:27 2009 on bifrost X-Virus-Status: Clean Dear Peter, =0A=0AI am impressed by the code. It works well - apart from th= e =0Acursor stuff. I tried to understand it, but I failed. =0A=0AI have two= questions: =0A=0A* Which part of the code makes sure that the commands ret= rieved =0Afrom history are "shown" on the command line? =0A=0A* Why does th= e cursor position matter, and how can one make sure =0Athat the cursor move= s to the right position before the widget is =0Ainvoked? =0A=0ABest wishes,= =0A=0AGuido =0A=0A--- On Thu, 10/1/09, Peter Stephenson wrot= e:=0A=0A> From: Peter Stephenson =0A> Subject: Re: matlab-hist= ory-beginning-search-backward=0A> To: zsh-users@sunsite.dk=0A> Date: Thursd= ay, October 1, 2009, 10:38 AM=0A> Peter Stephenson wrote:=0A> > I stole a l= ot of it from=0A> > history-beginning-search-menu.=0A> =0A> ... and I've ju= st noticed because of that a couple of bits=0A> are nonsense ...=0A> =0A> >= local search=3D$LBUFFER MATCH MBEGIN MEND=0A> =0A> ... this assignment is = redundant ...=0A> =0A> > # Filter out any match that's the same as the=0A> = original.=0A> > # Note this isn't a pattern this time.=0A> > matches=3D(${m= atches:#${LBUFFER}})=0A> =0A> ... more importantly, because in this case $m= atches is an=0A> array of=0A> numbers this doesn't do anything (except stop= you from=0A> matching a=0A> history line whose number happens to match the= string to=0A> the left of the=0A> cursor).=A0 This filter would need to be= moved up to=0A> where the matching is=0A> originally done.=A0 It's minor, = though.=0A> =0A> -- =0A> Peter Stephenson =A0=0A> =A0 =A0 =A0 = =A0 =A0 Software Engineer=0A> Tel: +44 (0)1223 692070=A0 =A0 =A0 =A0 =A0=0A= > =A0 =A0 =A0 =A0=A0=A0Cambridge Silicon=0A> Radio Limited=0A> Churchill Ho= use, Cambridge Business Park, Cowley Road,=0A> Cambridge, CB4 0WZ, UK=0A> = =0A> =0A> =0A> =0A> Member of the CSR plc group of companies. CSR plc=0A> r= egistered in England and Wales, registered number 4187346,=0A> registered o= ffice Churchill House, Cambridge Business Park,=0A> Cowley Road, Cambridge,= CB4 0WZ, United Kingdom=0A> =0A=0A=0A