-line *fendcore; /* First address in line pointer space */
-char file[FNSIZE]; /* Working file name */
-char genbuf[LBSIZE]; /* Working buffer when manipulating linebuf */
-bool hush; /* Command line option - was given, hush up! */
-char *globp; /* (Untyped) input string to command mode */
-bool holdcm; /* Don't cursor address */
-bool inglobal; /* Inside g//... or v//... */
-char *initev; /* Initial : escape for visual */
-bool inopen; /* Inside open or visual */
-char *input; /* Current position in cmd line input buffer */
-bool intty; /* Input is a tty */
-short io; /* General i/o unit (auto-closed on error!) */
-short lastc; /* Last character ret'd from cmd input */
-bool laste; /* Last command was an "e" (or "rec") */
-char lastmac; /* Last macro called for ** */
-char lasttag[TAGSIZE]; /* Last argument to a tag command */
-char *linebp; /* Used in substituting in \n */
-char linebuf[LBSIZE]; /* The primary line buffer */
-bool listf; /* Command should run in list mode */
-char *loc1; /* Where re began to match (in linebuf) */
-char *loc2; /* First char after re match (") */
-line names['z'-'a'+2]; /* Mark registers a-z,' */
-int notecnt; /* Count for notify (to visual from cmd) */
-bool numberf; /* Command should run in number mode */
-char obuf[BUFSIZ]; /* Buffer for tty output */
-short ospeed; /* Output speed (from gtty) */
-int otchng; /* Backup tchng to find changes in macros */
-short peekc; /* Peek ahead character (cmd mode input) */
-char *pkill[2]; /* Trim for put with ragged (LISP) delete */
-bool pfast; /* Have stty -nl'ed to go faster */
-int pid; /* Process id of child */
-int ppid; /* Process id of parent (e.g. main ex proc) */
-jmp_buf resetlab; /* For error throws to top level (cmd mode) */
-int rpid; /* Pid returned from wait() */
-bool ruptible; /* Interruptible is normal state */
-bool shudclob; /* Have a prompt to clobber (e.g. on ^D) */
-int status; /* Status returned from wait() */
-int tchng; /* If nonzero, then [Modified] */
-short tfile; /* Temporary file unit */
-bool vcatch; /* Want to catch an error (open/visual) */
-jmp_buf vreslab; /* For error throws to a visual catch */
-int xchng; /* Suppresses multiple "No writes" in !cmd */
+var line *fendcore; /* First address in line pointer space */
+var char file[FNSIZE]; /* Working file name */
+var char genbuf[LBSIZE]; /* Working buffer when manipulating linebuf */
+var bool hush; /* Command line option - was given, hush up! */
+var char *globp; /* (Untyped) input string to command mode */
+var bool holdcm; /* Don't cursor address */
+var bool inappend; /* in ex command append mode */
+var bool inglobal; /* Inside g//... or v//... */
+var char *initev; /* Initial : escape for visual */
+var bool inopen; /* Inside open or visual */
+var char *input; /* Current position in cmd line input buffer */
+var bool intty; /* Input is a tty */
+var short io; /* General i/o unit (auto-closed on error!) */
+extern short lastc; /* Last character ret'd from cmd input */
+var bool laste; /* Last command was an "e" (or "rec") */
+var char lastmac; /* Last macro called for ** */
+var char lasttag[TAGSIZE]; /* Last argument to a tag command */
+var char *linebp; /* Used in substituting in \n */
+var char linebuf[LBSIZE]; /* The primary line buffer */
+var bool listf; /* Command should run in list mode */
+var char *loc1; /* Where re began to match (in linebuf) */
+var char *loc2; /* First char after re match (") */
+var line names['z'-'a'+2]; /* Mark registers a-z,' */
+var int notecnt; /* Count for notify (to visual from cmd) */
+var bool numberf; /* Command should run in number mode */
+var char obuf[BUFSIZ]; /* Buffer for tty output */
+var short oprompt; /* Saved during source */
+extern short ospeed; /* Output speed (from gtty) */
+var int otchng; /* Backup tchng to find changes in macros */
+var short peekc; /* Peek ahead character (cmd mode input) */
+var char *pkill[2]; /* Trim for put with ragged (LISP) delete */
+var bool pfast; /* Have stty -nl'ed to go faster */
+var int pid; /* Process id of child */
+var int ppid; /* Process id of parent (e.g. main ex proc) */
+var jmp_buf resetlab; /* For error throws to top level (cmd mode) */
+var int rpid; /* Pid returned from wait() */
+var bool ruptible; /* Interruptible is normal state */
+var bool seenprompt; /* 1 if have gotten user input */
+var bool shudclob; /* Have a prompt to clobber (e.g. on ^D) */
+var int status; /* Status returned from wait() */
+var int tchng; /* If nonzero, then [Modified] */
+extern short tfile; /* Temporary file unit */
+var bool vcatch; /* Want to catch an error (open/visual) */
+var jmp_buf vreslab; /* For error throws to a visual catch */
+var bool writing; /* 1 if in middle of a file write */
+var int xchng; /* Suppresses multiple "No writes" in !cmd */