4 * 18. Insertions from the standard input
7 r_rd(int argc, Rune **argv)
16 * print prompt, then read until double newline,
17 * then run the text just read as though it were
18 * a macro body, using the remaining arguments.
22 fprint(2, "%S", argv[1]);
24 fprint(2, "%c", 7/*BEL*/);
28 Binit(&bstdin, 0, OREAD);
32 while((s = Brdstr(&bstdin, '\n', 0)) != nil){
37 fmtprint(&fmt, "%s", s);
40 p = runefmtstrflush(&fmt);
42 warn("out of memory in %Crd", dot);
47 runmacro('.', argc, argv);
51 /* terminate exactly as if input had ended */
53 r_ex(int argc, Rune **argv)
65 addreq(L("rd"), r_rd, -1);
66 addreq(L("ex"), r_ex, 0);