From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12080 invoked from network); 2 Oct 2009 08:48:55 -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.4 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; 2 Oct 2009 08:48:55 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 73750 invoked from network); 2 Oct 2009 08:48:41 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 2 Oct 2009 08:48:41 -0000 Received: (qmail 19409 invoked by alias); 2 Oct 2009 08:48:33 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 14448 Received: (qmail 19388 invoked from network); 2 Oct 2009 08:48:32 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 2 Oct 2009 08:48:32 -0000 Received: from cluster-d.mailcontrol.com (cluster-d.mailcontrol.com [85.115.60.190]) by bifrost.dotsrc.org (Postfix) with ESMTPS id 63211808ECB9 for ; Fri, 2 Oct 2009 10:48:26 +0200 (CEST) Received: from cameurexb01.EUROPE.ROOT.PRI ([193.128.72.68]) by rly45d.srv.mailcontrol.com (MailControl) with ESMTP id n928mOaI022081 for ; Fri, 2 Oct 2009 09:48:24 +0100 Received: from news01.csr.com ([10.99.50.25]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.3959); Fri, 2 Oct 2009 09:48:23 +0100 Received: from news01.csr.com (localhost.localdomain [127.0.0.1]) by news01.csr.com (8.14.2/8.13.4) with ESMTP id n928mNOS006173 for ; Fri, 2 Oct 2009 09:48:23 +0100 Received: from csr.com (pws@localhost) by news01.csr.com (8.14.2/8.14.2/Submit) with ESMTP id n928mNG3006169 for ; Fri, 2 Oct 2009 09:48:23 +0100 Message-Id: <200910020848.n928mNG3006169@news01.csr.com> X-Authentication-Warning: news01.csr.com: pws owned process doing -bs To: zsh-users@sunsite.dk Subject: Re: matlab-history-beginning-search-backward In-reply-to: <541376.31256.qm@web65614.mail.ac4.yahoo.com> References: <541376.31256.qm@web65614.mail.ac4.yahoo.com> Comments: In-reply-to Guido van Steen message dated "Thu, 01 Oct 2009 13:58:25 -0700." Date: Fri, 02 Oct 2009 09:48:23 +0100 From: Peter Stephenson X-OriginalArrivalTime: 02 Oct 2009 08:48:23.0900 (UTC) FILETIME=[19D5F9C0:01CA433D] Content-Type: text/plain MIME-Version: 1.0 X-Scanned-By: MailControl A-06-00-00 (www.mailcontrol.com) on 10.68.0.155 X-Virus-Scanned: ClamAV 0.94.2/9861/Fri Oct 2 03:51:01 2009 on bifrost X-Virus-Status: Clean Guido van Steen wrote: > * Which part of the code makes sure that the commands retrieved > from history are "shown" on the command line? Assigning to HISTNO moves to the given line number in the history. zsh remembers edits to history lines until you hit on the line you actually want to execute; the next time you look at the history it's back the way it was. > * Why does the cursor position matter, and how can one make sure > that the cursor moves to the right position before the widget is > invoked? As far as the widget is concerned, the cursor position only matters at the start in order to find the string to the left which is used for the search. If you execute the widget again (forward or backward) without any other command in between it will use the same search string (no matter where the cursor is). If you move the cursor (or in fact execute any other command) and execute the widget again it will look again at the string to the left. Some people like the cursor placed specially after the execution of history commands; this function doesn't have any support for that, so it's always left at the end. -- Peter Stephenson Software Engineer Tel: +44 (0)1223 692070 Cambridge Silicon Radio Limited Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom