From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11095 invoked from network); 2 Dec 1999 19:03:35 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 2 Dec 1999 19:03:35 -0000 Received: (qmail 12234 invoked by alias); 2 Dec 1999 19:03:12 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8861 Received: (qmail 12187 invoked from network); 2 Dec 1999 19:03:10 -0000 From: "Bart Schaefer" Message-Id: <991202181650.ZM16635@candle.brasslantern.com> Date: Thu, 2 Dec 1999 18:16:50 +0000 In-Reply-To: <19991130182221.A474@dman.com> Comments: In reply to Clint Adams "posixism and unrelated spellcheck editing" (Nov 30, 6:22pm) References: <19991130182221.A474@dman.com> X-Mailer: Z-Mail (5.0.0 30July97) To: zsh-workers@sunsite.auc.dk Subject: Re: posixism and unrelated spellcheck editing MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Nov 30, 6:22pm, Clint Adams wrote: } Subject: posixism and unrelated spellcheck editing } } The first is POSIX options to the "command" builtin, basically } overloading it with a modified "whence" under EMULATE_SH or } perhaps when POSIX_BUILTINS is set and not otherwise. I don't think there's any way to "overload" in this way. Precommand modifiers are handled significantly differently; you can have either the zsh behavior or the POSIX behavior, but not both. } It would be easier to differentiate the two meanings into } BINF_COMMAND and something else while parsing, but that doesn't } seem possible without some special handling. No, I don't recommend messing with this. } So should BINF_COMMAND check to see if it's followed by } '-p', '-V', or '-v' and then modify its own cflags? No, definitely not. That would require hacking up exec.c, which is the wrong place to be dealing with this. I suggest that you handle this by creating a "posix_command" module [1] which, when zmodload'd, removes the "command" precommand modifier and replaces it with its own "command" builtin. (I think that's possible; if it isn't I don't know why it shouldn't be.) If you want to have the builtin from this module attempt to emulate the zsh behavior in the case where none of '-p', '-V', or '-v' is set, it's a bit harder. I already struggled with this in eval_autoload() and came up with a brute-force solution that won't work in the "command" case. What's needed is a utility function to convert an argv directly into a LinkNode list that could be stuffed into the `args' field of a Cmd. [1] Maybe there's even reason enough to create a "posix" module that does all sorts of posix-shell-compliant stuff. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com