summaryrefslogtreecommitdiff
path: root/appl/cmd/m4.b
diff options
context:
space:
mode:
authorCharles.Forsyth <devnull@localhost>2009-04-20 16:43:43 +0000
committerCharles.Forsyth <devnull@localhost>2009-04-20 16:43:43 +0000
commit11c5a36b342b52487be9ec5fda0d5adeec61037f (patch)
tree523c026487ddedcd94f04e729351d750a7f2b56b /appl/cmd/m4.b
parent64047388f80c4b4daa68a5568c2b8a4ad5d63816 (diff)
20090420-1743
Diffstat (limited to 'appl/cmd/m4.b')
-rw-r--r--appl/cmd/m4.b16
1 files changed, 16 insertions, 0 deletions
diff --git a/appl/cmd/m4.b b/appl/cmd/m4.b
index 9315bf55..f24427b6 100644
--- a/appl/cmd/m4.b
+++ b/appl/cmd/m4.b
@@ -65,6 +65,7 @@ init(nil: ref Draw->Context, args: list of string)
builtin("changecom", dochangecom);
builtin("changequote", dochangequote);
+ builtin("copydef", docopydef);
builtin("define", dodefine);
builtin("divert", dodivert);
builtin("divnum", dodivnum);
@@ -457,6 +458,20 @@ doundefine(args: array of string)
undefine(args[i]);
}
+docopydef(args: array of string)
+{
+ if(len args > 2 && args[1] != args[2]){
+ undefine(args[2]);
+ if((n := lookup(args[1])) != nil){
+ if(n.impl == nil)
+ define(args[2], n.repl);
+ else
+ builtin(args[2], n.impl);
+ }else
+ define(args[2], "");
+ }
+}
+
doeval(args: array of string)
{
if(len args > 1)
@@ -683,6 +698,7 @@ dosyscmd(args: array of string)
if(sh == nil)
raise sys->sprint("load: can't load %s: %r", Sh->PATH);
}
+ bout.flush();
sh->system(nil, args[1]);
}exception e{
"load:*" =>