From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13922 invoked from network); 17 Jul 2000 18:30:13 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 17 Jul 2000 18:30:13 -0000 Received: (qmail 27075 invoked by alias); 17 Jul 2000 18:30:01 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 12283 Received: (qmail 27042 invoked from network); 17 Jul 2000 18:29:59 -0000 Date: Mon, 17 Jul 2000 11:29:25 -0700 (PDT) From: Wayne Davison X-Sender: wayne@phong.blorf.net To: Bart Schaefer Cc: Zsh Workers Subject: Re: spaceflag question; remhist() going away In-Reply-To: <1000717164610.ZM22230@candle.brasslantern.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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..