From: "Bart Schaefer" <schaefer@candle.brasslantern.com>
To: zsh-workers@sunsite.auc.dk
Subject: Re: posixism and unrelated spellcheck editing
Date: Thu, 2 Dec 1999 18:16:50 +0000 [thread overview]
Message-ID: <991202181650.ZM16635@candle.brasslantern.com> (raw)
In-Reply-To: <19991130182221.A474@dman.com>
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
prev parent reply other threads:[~1999-12-02 19:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-11-30 23:22 Clint Adams
1999-12-02 18:16 ` Bart Schaefer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=991202181650.ZM16635@candle.brasslantern.com \
--to=schaefer@candle.brasslantern.com \
--cc=zsh-workers@sunsite.auc.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).