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

Re: spaceflag question; remhist() going away



On Mon, 17 Jul 2000, Bart Schaefer wrote:
> I like the existing aliasing solution better; under what circumstances
> would you want to match more of the command line than the command name?

The matching rule would allow more general command-name rules, plus
line-oriented rules that name-oriented support don't allow.  For
instance:  ignoring lines that are just 1 or 2 chars long; ignoring
the make command unless it had an argument or was a part of a compound
statement; ignoring the history command, but only if it is not a part
of a compound statement (such as having its output piped into a
script); ignoring lines that begin with whitespace (including tab)
without having any extra alias-checking rules done; ignoring a lynx
command that uses the -auth option; etc.

The plus side is that a line-matching rule is much more flexible.  The
down side is that a user has to understand complex patterns to be able
to use it effectively.  Some good examples would get the casual user
going, though.

> } so I don't plan to re-implement this space-starting-alias
> } functionality (at least, not right away).
> 
> I hope you change your mind.

I have been considering how to do this even while not planning to
fiddle with it right away.  I think the easiest way to get it done
would be to have the history code look up the line's first word in
the aliases, and check it for a space.  This might be slightly more
restrictive than the old code which (I believe) would ignore the
line if any command in a sequence of commands was aliased to start
with a space, but that functionality doesn't strike me as very
desirable anyway (since compound commands are often the ones you
most want to save).

Since this functionality was never documented and since nobody using
the 3.1.x codebase has (apparently) ever missed it, I'm wondering if
we should just leave it out.  It shouldn't be hard to add the check I
described above if we think we need it, though, so after I get the
pattern stuff implemented, I may just go ahead and take a look at it.

Anyone else want to add their opinion to the subject?

..wayne..



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