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

Re: r problem



On Thu, 13 Sep 2001, Wayne Davison wrote:
> With the advent of my HIST_TMPSTORE flag, I could change the builtins
> to set this value and get rid of the command-line scan.  I'll look
> into this later to see if I think this is a good idea.

It's not.  That would be too much like what we used to have, and the
side-effects of dumping a history entry from inside a builtin function
are not something that I want to revisit.

So, we currently have the problem that I can define a function named "r"
and with HIST_NO_STORE set, invoking that function from the command-line
drops the command from the history.

One potential solution to this would be to change the history-line-drop
code to lookup "r" in a function list and avoid dropping "r" (but not
"builtin r") if we find it.  I don't know the function code well enough
to know if there is an inexpensive call that should_ignore_line() could
call for this or not.

Another solution is to leave things alone and let people use an alias to
redefine "r".  Like this:

    function r_func { echo foo }
    alias r=r_func

That's not as nice, but it works.  Comments?

..wayne..



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