zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@csr.com>
To: zsh-workers@sunsite.dk
Subject: Re: [PATCH] local history support, take 2
Date: Fri, 21 May 2004 10:15:41 +0100	[thread overview]
Message-ID: <5174.1085130941@csr.com> (raw)
In-Reply-To: "Wayne Davison"'s message of "Thu, 20 May 2004 18:37:38 PDT." <20040521013738.GC31267@blorf.net>

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 <pws@csr.com>                  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
**********************************************************************


  parent reply	other threads:[~2004-05-21  9:17 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-11 12:17 zcalc bug Matthias Kopfermann
2004-05-13 14:04 ` Thomas Köhler
2004-05-13 14:57   ` Peter Stephenson
2004-05-13 15:19     ` Matthias Kopfermann
2004-05-13 15:58       ` Peter Stephenson
2004-05-13 17:29         ` Matthias Kopfermann
2004-05-13 17:47           ` Peter Stephenson
2004-05-13 18:06             ` Matthias Kopfermann
2004-05-13 20:05               ` Peter Stephenson
2004-05-13 20:03     ` Wayne Davison
2004-05-14  9:23       ` Peter Stephenson
2004-05-15  0:22         ` Wayne Davison
2004-05-18 11:28           ` Peter Stephenson
2004-05-18 19:50             ` [PATCH] local history support, take 2 Wayne Davison
2004-05-18 21:32               ` Wayne Davison
2004-05-19  9:40               ` Peter Stephenson
2004-05-19 16:58                 ` Wayne Davison
2004-05-19 21:37                   ` Peter Stephenson
2004-05-21  1:37                     ` Wayne Davison
2004-05-21  1:44                       ` Wayne Davison
2004-05-21  9:15                       ` Peter Stephenson [this message]
2004-05-21 20:06                         ` Wayne Davison

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5174.1085130941@csr.com \
    --to=pws@csr.com \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).