Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] local history support, take 2



On Wed, May 19, 2004 at 10:40:25AM +0100, Peter Stephenson wrote:
> I might get a moment to look at this bit if you don't.

Feel free.  I had one idea on how to implement this:

The pushhiststack() function how returns the value of histsave_stack_pos
(i.e. the 1-relative spot where we stored the item).  This could be put
into a local variable named HISTPOP when `fc -p` was called for the
first time in a function.  Then, when HISTPOP got deleted, zsh would
call a new routine that would pop the list down through that value
(saving each history file on the way).

There may well be better ways to implement this than that, though (i.e.
not using the environment).

> I suspect you mean
> 
>     history -p [HISTFILE [HISTSIZE [SAVEHIST]]]

Yes, I certainly did.

When I went to document the new options, I noted that the entire
description of the "history" command is that it is the same as `fc -l'.
Because of this, I decided to switch the -p/-P options over to fc.

> I get an error if the HISTFILE on the command line doesn't exist.

Thanks -- fixed.

> Probably there should be an error if there are too many arguments

Yes, I had planned to do that, and it is now done.

You can fetch the latest patch from here:

    http://www.blorf.net/localhistory.patch

Shall I go ahead and check this in?  Or do we want to consider this a
bit more?  For instance, if you want to suggest a more pushd/popd style
command set for interactive use, let me know.

..wayne..



Messages sorted by: Reverse Date, Date, Thread, Author