From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1367 invoked from network); 19 May 2004 09:41:34 -0000 Received: from thor.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.86) by ns1.primenet.com.au with SMTP; 19 May 2004 09:41:34 -0000 Received: (qmail 23635 invoked from network); 19 May 2004 09:41:16 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 19 May 2004 09:41:16 -0000 Received: (qmail 926 invoked by alias); 19 May 2004 09:41:13 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 19960 Received: (qmail 914 invoked from network); 19 May 2004 09:41:13 -0000 Received: from thor.dotsrc.org (HELO a.mx.sunsite.dk) (qmailr@130.225.247.86) by sunsite.dk with SMTP; 19 May 2004 09:41:10 -0000 Received: (qmail 23358 invoked from network); 19 May 2004 09:41:09 -0000 Received: from lhuumrelay3.lnd.ops.eu.uu.net (62.189.58.19) by a.mx.sunsite.dk with SMTP; 19 May 2004 09:40:58 -0000 Received: from MAILSWEEPER01.csr.com (mailhost1.csr.com [62.189.183.235]) by lhuumrelay3.lnd.ops.eu.uu.net (8.11.0/8.11.0) with ESMTP id i4J9eQv00458 for ; Wed, 19 May 2004 09:40:26 GMT Received: from EXCHANGE02.csr.com (unverified [192.168.137.45]) by MAILSWEEPER01.csr.com (Content Technologies SMTPRS 4.3.12) with ESMTP id for ; Wed, 19 May 2004 10:39:54 +0100 Received: from csr.com ([192.168.144.127]) by EXCHANGE02.csr.com with Microsoft SMTPSVC(5.0.2195.6713); Wed, 19 May 2004 10:42:21 +0100 To: zsh-workers@sunsite.dk Subject: Re: [PATCH] local history support, take 2 In-reply-to: "Wayne Davison"'s message of "Tue, 18 May 2004 12:50:47 PDT." <20040518195047.GA2578@blorf.net> Date: Wed, 19 May 2004 10:40:25 +0100 Message-ID: <20778.1084959625@csr.com> From: Peter Stephenson X-OriginalArrivalTime: 19 May 2004 09:42:21.0715 (UTC) FILETIME=[953FD630:01C43D85] X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: ** X-Spam-Status: No, hits=2.3 required=6.0 tests=BAYES_70 autolearn=no version=2.63 X-Spam-Hits: 2.3 Wayne Davison wrote: > > Something else that occurs to me is that it would be useful to have the > > history automatically popped when you leave the function scope. > > That would certainly be nice. It was the reason behind my original > "setopt localoptions tmphist" idea (which wasn't very flexible). I > haven't tried to do this yet, though. I might get a moment to look at this bit if you don't. > I think it would be nice to both have a pop option and to have that > option automatically get executed on leaving a function scope if the > user didn't already run it. The reason I'm thinking I want an explicit > option is so I can push/pop the history interactively. Fine, if you've got a use for it. I had a vague feeling people using it from the command line would expect something a bit more flexible, like pushd/popd, which was beyond what I was thinking about. > I reordered my suggested options to make them a little more flexible: > > history -p [[[HISTFILE] HISTSIZE] SAVEHIST] I suspect you mean history -p [HISTFILE [HISTSIZE [SAVEHIST]]] or it's a little bit tricky to work out. > Here's my latest patch. Looks fine. Some comments on the details: I get an error if the HISTFILE on the command line doesn't exist. Presumably it should be silently created. The file was created anyway, but the error in the test function I used left me in the empty new history; that problem will go away with the local proposal. Probably there should be an error if there are too many arguments to `history -p' or `history -P'. -- Peter Stephenson Software Engineer CSR Ltd., Science Park, Milton Road, Cambridge, CB4 0WH, UK Tel: +44 (0)1223 692070 ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com **********************************************************************