zsh-workers
 help / color / mirror / code / Atom feed
From: Wayne Davison <wayned@users.sourceforge.net>
To: Peter Stephenson <pws@csr.com>
Cc: zsh-workers@sunsite.dk
Subject: Re: [PATCH] local history support, take 2
Date: Fri, 21 May 2004 13:06:00 -0700	[thread overview]
Message-ID: <20040521200600.GA12822@blorf.net> (raw)
In-Reply-To: <5174.1085130941@csr.com>

On Fri, May 21, 2004 at 10:15:41AM +0100, Peter Stephenson wrote:
> Is this going to be optional eventually?

Yeah, I think that it should be optional just to be more flexible -- I
can imagine someone wanting to call a push in a function without the
auto-pop being forced upon them.  I've added your earlier suggestion of
the option "-a" to indicate that an automatic pop is desired.

> You can also reject attempts to use `fc -P' if the history is marked
> for automatic restoration which gets around the other problem.

Actually, manually popping an automatic history doesn't cause any
problems in the current code (the auto-pop of the history list happens
prior to the restoration of local variables, so the early pop causes no
problems that aren't present for the auto-pop).

> 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.

It's fine if the user tweaks the values after a history push because
they're just manipulating the current history buffer.  The only problem
comes in if they declare a variable to be local in a way that conflicts
with the restoration order.  I'm advising users to either omit marking
the variables as local, or to declare them local at the top of the
function and use the automatic-pop form of fc.  (The other sequence that
works fine is calling a non-automatic `fc -p' prior to localization, and
then calling `fc -P' from outside the function, but I don't think we
need to tell the user that.)

I've checked in my updated version.  We can continue to improve it, as
desired, but I think it works quite well now.

..wayne..


      reply	other threads:[~2004-05-21 20:06 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
2004-05-21 20:06                         ` Wayne Davison [this message]

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=20040521200600.GA12822@blorf.net \
    --to=wayned@users.sourceforge.net \
    --cc=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).