From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9963 invoked from network); 21 May 2004 09:17:03 -0000 Received: from thor.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.86) by ns1.primenet.com.au with SMTP; 21 May 2004 09:17:03 -0000 Received: (qmail 18221 invoked from network); 21 May 2004 09:16:31 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 21 May 2004 09:16:31 -0000 Received: (qmail 18440 invoked by alias); 21 May 2004 09:16:26 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 19970 Received: (qmail 18418 invoked from network); 21 May 2004 09:16:26 -0000 Received: from thor.dotsrc.org (HELO a.mx.sunsite.dk) (qmailr@130.225.247.86) by sunsite.dk with SMTP; 21 May 2004 09:16:23 -0000 Received: (qmail 17407 invoked from network); 21 May 2004 09:16:11 -0000 Received: from lhuumrelay3.lnd.ops.eu.uu.net (62.189.58.19) by a.mx.sunsite.dk with SMTP; 21 May 2004 09:16:09 -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 i4L9Fgv18136 for ; Fri, 21 May 2004 09:15:42 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 ; Fri, 21 May 2004 10:15:09 +0100 Received: from csr.com ([192.168.144.127]) by EXCHANGE02.csr.com with Microsoft SMTPSVC(5.0.2195.6713); Fri, 21 May 2004 10:17:43 +0100 To: zsh-workers@sunsite.dk Subject: Re: [PATCH] local history support, take 2 In-reply-to: "Wayne Davison"'s message of "Thu, 20 May 2004 18:37:38 PDT." <20040521013738.GC31267@blorf.net> Date: Fri, 21 May 2004 10:15:41 +0100 Message-ID: <5174.1085130941@csr.com> From: Peter Stephenson X-OriginalArrivalTime: 21 May 2004 09:17:43.0576 (UTC) FILETIME=[79093980:01C43F14] X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: ** X-Spam-Status: No, hits=2.1 required=6.0 tests=BAYES_90 autolearn=no version=2.63 X-Spam-Hits: 2.1 Wayne Davison wrote: > OK, I checked it in. I also started to work on an auto-pop feature > from a function. Attached is a patch that almost works right, but has a > couple areas that need to be improved. Perhaps someone can chime in > here with some advice on how to either do this the right way or fix the > problems. Is this going to be optional eventually? It's a little confusing having `fc -P' as well, otherwise. You can use them as a pair at the command line but I think it should be deliberate to select one behaviour or the other. You can also reject attempts to use `fc -P' if the history is marked for automatic restoration which gets around the other problem. > function bar { > fc -p > local HISTFILE=~/.newhist HISTSIZE=2223 > echo $HISTFILE $HISTSIZE > } > > However, in function bar the history-list push saves off the global > value of the HISTFILE and HISTSIZE variables, which are then made local. > When the function exits, the history-list pop first restores the global > values of the variables to the environment, and then the local-variable > restoration unsets HISTFILE and makes HISTSIZE=30 (the default value). > > Is this something we can easily fix? Perhaps with a different way of > saving the environment values? Or is this something where we tell users > that they can't both use "fc -p" and make the variables local? I think it needs to be documented that if you're using commands you shouldn't touch the variables by hand, otherwise confusion like this is inevitable. -- 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 **********************************************************************