home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume11 / jove.pch / part01 / jove.pch.1
Encoding:
Text File  |  1987-09-15  |  50.5 KB  |  2,335 lines

  1. diff -c ojove/Makefile jove/Makefile
  2. *** ojove/Makefile    Thu Jul 16 09:14:01 1987
  3. --- jove/Makefile    Fri Jun 19 16:13:05 1987
  4. ***************
  5. *** 19,44 ****
  6.   
  7.   DESTDIR =
  8.   TMPDIR = /tmp
  9. ! LIBDIR = /u/jpayne/jovelib
  10. ! BINDIR = /u/jpayne/bin
  11. ! MANDIR = /u/jpayne/manl
  12.   MANEXT = l
  13.   SHELL = /bin/csh
  14.   
  15.   # These should all just be right if the above ones are.
  16.   JOVE = $(DESTDIR)$(BINDIR)/jove
  17. - RECOVER = $(DESTDIR)$(LIBDIR)/recover
  18.   TEACHJOVE = $(DESTDIR)$(BINDIR)/teachjove
  19.   JOVERC = $(DESTDIR)$(LIBDIR)/.joverc
  20.   CMDS.DOC = $(DESTDIR)$(LIBDIR)/cmds.doc
  21.   TEACH-JOVE = $(DESTDIR)$(LIBDIR)/teach-jove
  22. - PORTSRV = $(DESTDIR)$(LIBDIR)/portsrv
  23.   JOVEM = $(DESTDIR)$(MANDIR)/jove.$(MANEXT)
  24. - RECOVERM = $(DESTDIR)$(MANDIR)/recover.$(MANEXT)
  25.   TEACHJOVEM = $(DESTDIR)$(MANDIR)/teachjove.$(MANEXT)
  26.   
  27.   # Select the right libraries for your system.
  28. ! #    2.9BSD:    LIBS = -ltermcap -ljobs
  29.   #    v7:    LIBS = -ltermcap
  30.   #    4.1BSD:    LIBS = -ltermcap -ljobs
  31.   #    4.2BSD:    LIBS = -ltermcap
  32. --- 19,43 ----
  33.   
  34.   DESTDIR =
  35.   TMPDIR = /tmp
  36. ! LIBDIR = /nfs/socrates/usr/jpayne/jovelib
  37. ! BINDIR = /nfs/socrates/usr/jpayne/bin
  38. ! MANDIR = /nfs/socrates/usr/jpayne/manl
  39.   MANEXT = l
  40.   SHELL = /bin/csh
  41.   
  42.   # These should all just be right if the above ones are.
  43.   JOVE = $(DESTDIR)$(BINDIR)/jove
  44.   TEACHJOVE = $(DESTDIR)$(BINDIR)/teachjove
  45. + RECOVER = $(DESTDIR)$(LIBDIR)/recover
  46. + PORTSRV = $(DESTDIR)$(LIBDIR)/portsrv
  47.   JOVERC = $(DESTDIR)$(LIBDIR)/.joverc
  48.   CMDS.DOC = $(DESTDIR)$(LIBDIR)/cmds.doc
  49.   TEACH-JOVE = $(DESTDIR)$(LIBDIR)/teach-jove
  50.   JOVEM = $(DESTDIR)$(MANDIR)/jove.$(MANEXT)
  51.   TEACHJOVEM = $(DESTDIR)$(MANDIR)/teachjove.$(MANEXT)
  52.   
  53.   # Select the right libraries for your system.
  54. ! #    2.10BSD:LIBS = -ltermcap
  55.   #    v7:    LIBS = -ltermcap
  56.   #    4.1BSD:    LIBS = -ltermcap -ljobs
  57.   #    4.2BSD:    LIBS = -ltermcap
  58. ***************
  59. *** 49,71 ****
  60.   
  61.   # If you are not VMUNIX (vax running Berkeley Version 4), you must specify
  62.   # the -i flags (split I/D space) and maybe the -x option (for adb to work).
  63. ! #    2.9BSD:    LDFLAGS = -x -i
  64. ! #    v7:    LDFLAGS = -x -i
  65.   #    4.1BSD:    LDFLAGS =
  66.   #    4.2BSD:    LDFLAGS =
  67.   #    4.3BSD:    LDFLAGS =
  68.   #    SysV Rel. 2: LDFLAGS = -Ml
  69.   
  70. ! LDFLAGS =
  71.   
  72. ! CFLAGS = -O
  73.   
  74. ! OBJECTS = keymaps.o funcdefs.o abbrev.o ask.o buf.o c.o case.o ctype.o \
  75. !     delete.o disp.o extend.o fp.o fmt.o insert.o io.o iproc.o jove.o macros.o \
  76. !     malloc.o marks.o misc.o move.o paragraph.o proc.o re.o re1.o rec.o \
  77. !     scandir.o screen.o table.o term.o tune.o util.o vars.o version.o wind.o
  78.   
  79. ! JOVESRC = funcdefs.c abbrev.c ask.c buf.c c.c case.c ctype.c \
  80.       delete.c disp.c extend.c fp.c fmt.c insert.c io.c iproc.c \
  81.       jove.c macros.c malloc.c marks.c misc.c move.c paragraph.c \
  82.       proc.c re.c re1.c rec.c scandir.c screen.c table.c term.c util.c \
  83. --- 48,82 ----
  84.   
  85.   # If you are not VMUNIX (vax running Berkeley Version 4), you must specify
  86.   # the -i flags (split I/D space) and maybe the -x option (for adb to work).
  87. ! #    2.10BSD:LDFLAGS =
  88. ! #    v7:    LDFLAGS =
  89.   #    4.1BSD:    LDFLAGS =
  90.   #    4.2BSD:    LDFLAGS =
  91.   #    4.3BSD:    LDFLAGS =
  92.   #    SysV Rel. 2: LDFLAGS = -Ml
  93. + #
  94. + # SEPFLAG should be:
  95. + #    not on a PDP-11:        SEPFLAG =
  96. + #    PDP-11 with separate I&D:    SEPFLAG = -i
  97. + #    PDP-11 without separate I&D:    SEPFLAG = -n
  98.   
  99. ! LDFLAGS = -g
  100. ! SEPFLAG =
  101.   
  102. ! CFLAGS = -g
  103.   
  104. ! BASESEG = funcdefs.o keymaps.o argcount.o ask.o buf.o ctype.o delete.o \
  105. !       disp.o fmt.o insert.o io.o jove.o malloc.o marks.o misc.o re.o \
  106. !       screen.o table.o tune.o util.o vars.o version.o
  107. ! OVLAY1 = abbrev.o rec.o paragraph.o
  108. ! OVLAY2 = c.o wind.o fp.o move.o
  109. ! OVLAY3 = extend.o macros.o
  110. ! OVLAY4 = iproc.o re1.o
  111. ! OVLAY5 = proc.o scandir.o term.o case.o
  112.   
  113. ! OBJECTS = $(BASESEG) $(OVLAY1) $(OVLAY2) $(OVLAY3) $(OVLAY4) $(OVLAY5)
  114. ! JOVESRC = funcdefs.c abbrev.c argcount.c ask.c buf.c c.c case.c ctype.c \
  115.       delete.c disp.c extend.c fp.c fmt.c insert.c io.c iproc.c \
  116.       jove.c macros.c malloc.c marks.c misc.c move.c paragraph.c \
  117.       proc.c re.c re1.c rec.c scandir.c screen.c table.c term.c util.c \
  118. ***************
  119. *** 76,83 ****
  120.   HEADERS = ctype.h io.h jove.h re.h rec.h table.h temp.h termcap.h tune.h
  121.   
  122.   DOCS =    doc/cmds.doc.nr doc/example.rc doc/jove.1 doc/jove.2 doc/jove.3 \
  123. !     doc/jove.4 doc/jove.nr doc/recover.nr doc/system.rc doc/teach-jove \
  124. !     doc/teachjove.nr doc/README
  125.   
  126.   BACKUPS = $(HEADERS) $(JOVESRC) iproc-pipes.c iproc-ptys.c \
  127.       teachjove.c recover.c setmaps.c portsrv.c tune.template \
  128. --- 87,94 ----
  129.   HEADERS = ctype.h io.h jove.h re.h rec.h table.h temp.h termcap.h tune.h
  130.   
  131.   DOCS =    doc/cmds.doc.nr doc/example.rc doc/jove.1 doc/jove.2 doc/jove.3 \
  132. !     doc/jove.4 doc/jove.5 doc/jove.nr doc/system.rc \
  133. !     doc/teach-jove doc/teachjove.nr doc/README
  134.   
  135.   BACKUPS = $(HEADERS) $(JOVESRC) iproc-pipes.c iproc-ptys.c \
  136.       teachjove.c recover.c setmaps.c portsrv.c tune.template \
  137. ***************
  138. *** 87,93 ****
  139.   all:    xjove recover teachjove portsrv
  140.   
  141.   xjove:    $(OBJECTS)
  142. !     $(CC) $(LDFLAGS) -o xjove $(OBJECTS) version.o $(LIBS)
  143.       @-size xjove
  144.       @-date
  145.   
  146. --- 98,104 ----
  147.   all:    xjove recover teachjove portsrv
  148.   
  149.   xjove:    $(OBJECTS)
  150. !     $(CC) $(LDFLAGS) -o xjove $(OBJECTS) $(LIBS);
  151.       @-size xjove
  152.       @-date
  153.   
  154. ***************
  155. *** 131,138 ****
  156.   $(TEACH-JOVE): doc/teach-jove
  157.       install -c -m 644 doc/teach-jove $(TEACH-JOVE)
  158.   
  159. ! doc/cmds.doc:    doc/cmds.doc.nr doc/jove.4
  160. !     nroff doc/cmds.doc.nr doc/jove.4 > doc/cmds.doc
  161.   
  162.   $(CMDS.DOC): doc/cmds.doc
  163.       install -c -m 644 doc/cmds.doc $(CMDS.DOC)
  164. --- 142,149 ----
  165.   $(TEACH-JOVE): doc/teach-jove
  166.       install -c -m 644 doc/teach-jove $(TEACH-JOVE)
  167.   
  168. ! doc/cmds.doc:    doc/cmds.doc.nr doc/jove.4 doc/jove.5
  169. !     nroff doc/cmds.doc.nr doc/jove.4 doc/jove.5 > doc/cmds.doc
  170.   
  171.   $(CMDS.DOC): doc/cmds.doc
  172.       install -c -m 644 doc/cmds.doc $(CMDS.DOC)
  173. ***************
  174. *** 158,169 ****
  175.            -e 's;SHELL;$(SHELL);' doc/jove.nr > /tmp/jove.nr
  176.       install -m 644 /tmp/jove.nr $(JOVEM)
  177.   
  178. - $(RECOVERM): doc/recover.nr
  179. -     @sed -e 's;TMPDIR;$(TMPDIR);' \
  180. -          -e 's;LIBDIR;$(LIBDIR);' \
  181. -          -e 's;SHELL;$(SHELL);' doc/recover.nr > /tmp/recover.nr
  182. -     install -m 644 /tmp/recover.nr $(RECOVERM)
  183.   $(TEACHJOVEM): doc/teachjove.nr
  184.       @sed -e 's;TMPDIR;$(TMPDIR);' \
  185.            -e 's;LIBDIR;$(LIBDIR);' \
  186. --- 169,174 ----
  187. ***************
  188. *** 178,184 ****
  189.       @echo Done
  190.   
  191.   tags:
  192. !     ctags -w $(JOVESRC) $(HEADERS)
  193.   
  194.   ciall:
  195.       ci $(BACKUPS)
  196. --- 183,189 ----
  197.       @echo Done
  198.   
  199.   tags:
  200. !     ctags -w $(JOVESRC) $(HEADERS) iproc-ptys.c
  201.   
  202.   ciall:
  203.       ci $(BACKUPS)
  204. ***************
  205. *** 189,195 ****
  206.   jove.shar:
  207.       shar $(BACKUPS) > jove.shar
  208.   
  209. ! backup:
  210.       tar cf backup $(BACKUPS)
  211.   
  212.   tape-backup:
  213. --- 194,200 ----
  214.   jove.shar:
  215.       shar $(BACKUPS) > jove.shar
  216.   
  217. ! backup: $(BACKUPS)
  218.       tar cf backup $(BACKUPS)
  219.   
  220.   tape-backup:
  221. diff -c ojove/Ovmakefile jove/Ovmakefile
  222. *** ojove/Ovmakefile    Thu Jul 16 09:14:02 1987
  223. --- jove/Ovmakefile    Fri Jun 12 11:23:45 1987
  224. ***************
  225. *** 61,71 ****
  226.   
  227.   COFLAGS = -rworking -q
  228.   
  229. ! BASESEG = funcdefs.o keymaps.o ask.o buf.o ctype.o delete.o disp.o fmt.o fp.o \
  230. !       insert.o io.o jove.o malloc.o macros.o marks.o misc.o move.o re.o \
  231. !       screen.o table.o tune.o util.o vars.o version.o
  232. ! OVLAY1 = abbrev.o rec.o paragraph.o
  233. ! OVLAY2 = c.o wind.o
  234.   OVLAY3 = extend.o
  235.   OVLAY4 = iproc.o re1.o
  236.   OVLAY5 = proc.o scandir.o term.o case.o
  237. --- 61,71 ----
  238.   
  239.   COFLAGS = -rworking -q
  240.   
  241. ! BASESEG = funcdefs.o keymaps.o argcount.o ask.o buf.o ctype.o delete.o disp.o fmt.o fp.o \
  242. !       insert.o io.o jove.o malloc.o marks.o misc.o move.o re.o \
  243. !       screen.o table.o tune.o util.o version.o
  244. ! OVLAY1 = abbrev.o rec.o paragraph.o macros.o
  245. ! OVLAY2 = c.o wind.o vars.o
  246.   OVLAY3 = extend.o
  247.   OVLAY4 = iproc.o re1.o
  248.   OVLAY5 = proc.o scandir.o term.o case.o
  249. ***************
  250. *** 72,78 ****
  251.   
  252.   OBJECTS = $(BASESEG) $(OVLAY1) $(OVLAY2) $(OVLAY3) $(OVLAY4) $(OVLAY5)
  253.   
  254. ! C-FILES = funcdefs.c abbrev.c ask.c buf.c c.c case.c ctype.c delete.c disp.c \
  255.       extend.c fmt.c fp.c insert.c io.c iproc.c iproc-pipes.c iproc-ptys.c \
  256.       jove.c macros.c malloc.c marks.c misc.c move.c paragraph.c proc.c \
  257.       re.c re1.c rec.c scandir.c screen.c table.c term.c util.c vars.c version.c \
  258. --- 72,78 ----
  259.   
  260.   OBJECTS = $(BASESEG) $(OVLAY1) $(OVLAY2) $(OVLAY3) $(OVLAY4) $(OVLAY5)
  261.   
  262. ! C-FILES = funcdefs.c abbrev.c argcount.c ask.c buf.c c.c case.c ctype.c delete.c disp.c \
  263.       extend.c fmt.c fp.c insert.c io.c iproc.c iproc-pipes.c iproc-ptys.c \
  264.       jove.c macros.c malloc.c marks.c misc.c move.c paragraph.c proc.c \
  265.       re.c re1.c rec.c scandir.c screen.c table.c term.c util.c vars.c version.c \
  266. Common subdirectories: ojove/RCS and jove/RCS
  267. diff -c ojove/README jove/README
  268. *** ojove/README    Thu Jul 16 09:14:03 1987
  269. --- jove/README    Fri Feb  6 11:32:32 1987
  270. ***************
  271. *** 146,152 ****
  272.   reads an initialization file in the user's home directory, and "example.rc"
  273.   is mine.
  274.   
  275. ! The files "jove.[1234]" in DOC are the official JOVE manual.  I got
  276.   permission from Richard Stallman to use his manual for the original EMACS,
  277.   modifying it where necessary for JOVE.  Lots of work was done by Brian
  278.   Harvey on this manual.
  279. --- 146,152 ----
  280.   reads an initialization file in the user's home directory, and "example.rc"
  281.   is mine.
  282.   
  283. ! The files "jove.[12345]" in DOC are the official JOVE manual.  I got
  284.   permission from Richard Stallman to use his manual for the original EMACS,
  285.   modifying it where necessary for JOVE.  Lots of work was done by Brian
  286.   Harvey on this manual.
  287. diff -c ojove/abbrev.c jove/abbrev.c
  288. *** ojove/abbrev.c    Thu Jul 16 09:14:04 1987
  289. --- jove/abbrev.c    Fri Jun 12 10:50:08 1987
  290. ***************
  291. *** 102,110 ****
  292.       struct abbrev    *ap;
  293.   
  294.       DOTsave(&point);
  295. -     exp = 1;
  296.       WITH_TABLE(curbuf->b_major)
  297. !     BackWord();
  298.       while (curchar < point.p_char && ismword(c = linebuf[curchar])) {
  299.           if (AutoCaseAbbrev) {
  300.               if (isupper(c)) {
  301. --- 102,109 ----
  302.       struct abbrev    *ap;
  303.   
  304.       DOTsave(&point);
  305.       WITH_TABLE(curbuf->b_major)
  306. !     b_word(1);
  307.       while (curchar < point.p_char && ismword(c = linebuf[curchar])) {
  308.           if (AutoCaseAbbrev) {
  309.               if (isupper(c)) {
  310. ***************
  311. *** 112,118 ****
  312.                   c = tolower(c);
  313.               }
  314.           }
  315.           *wp++ = c;
  316.           curchar++;
  317.       }
  318. --- 111,116 ----
  319. ***************
  320. *** 124,141 ****
  321.           SetDot(&point);
  322.           return;
  323.       }
  324. !     DoTimes(DelPChar(), (wp - wordbuf));
  325.   
  326.       for (cp = ap->a_phrase; c = *cp; ) {
  327.           if (AutoCaseAbbrev) {
  328. !             Insert(islower(c) && UC_count &&
  329. !                    (cp == ap->a_phrase || (UC_count > 1 && (*(cp - 1) == ' '))) ?
  330. !                 toupper(c) : c);
  331. !         }
  332. !         else {
  333. !             Insert(c);
  334. !         }
  335. !         cp++;
  336.       }
  337.   
  338.       if (ap->a_cmdhook != 0)
  339. --- 122,137 ----
  340.           SetDot(&point);
  341.           return;
  342.       }
  343. !     del_char(BACKWARD, (wp - wordbuf));
  344.   
  345.       for (cp = ap->a_phrase; c = *cp; ) {
  346.           if (AutoCaseAbbrev) {
  347. !             insert_c(islower(c) && UC_count &&
  348. !                    (cp == ap->a_phrase || (UC_count > 1 && (cp[-1] == ' '))) ?
  349. !                 toupper(c) : c, 1);
  350. !         } else
  351. !             insert_c(c, 1);
  352. !         cp += 1;
  353.       }
  354.   
  355.       if (ap->a_cmdhook != 0)
  356. Only in jove: argcount.c
  357. diff -c ojove/ask.c jove/ask.c
  358. *** ojove/ask.c    Thu Jul 16 09:14:06 1987
  359. --- jove/ask.c    Fri Jul 10 09:25:49 1987
  360. ***************
  361. *** 15,20 ****
  362. --- 15,22 ----
  363.   #    include <sys/stat.h>
  364.   #endif
  365.   
  366. + int    DoEVexpand = NO;    /* should we expand evironment variables? */
  367.   int    Asking = NO;
  368.   char    Minibuf[LBSIZE];
  369.   private Line    *CurAskPtr = 0;    /* points at some line in mini-buffer */
  370. ***************
  371. *** 57,63 ****
  372.       SetBuf(saveb);
  373.   }
  374.   
  375. ! static char *
  376.   real_ask(delim, d_proc, def, prompt)
  377.   char    *delim,
  378.       *def,
  379. --- 59,106 ----
  380.       SetBuf(saveb);
  381.   }
  382.   
  383. ! /* look for any substrings of the form $foo in linebuf, and expand
  384. !    them according to their value in the environment (if possible) -
  385. !    this munges all over curchar and linebuf without giving it a second
  386. !    thought (I must be getting lazy in my old age) */
  387. ! private
  388. ! EVexpand()
  389. ! {
  390. !     register int    c;
  391. !     register char    *lp = linebuf,
  392. !             *ep;
  393. !     char    varname[128],
  394. !         *vp,
  395. !         *lp_start;
  396. !     Mark    *m = MakeMark(curline, curchar, M_FLOATER);
  397. !     while (c = *lp++) {
  398. !         if (c != '$')
  399. !             continue;
  400. !         lp_start = lp - 1;    /* the $ */
  401. !         vp = varname;
  402. !         while (c = *lp++) {
  403. !             if (!isword(c))
  404. !                 break;
  405. !             *vp++ = c;
  406. !         }
  407. !         *vp = '\0';
  408. !         /* if we find an env. variable with the right
  409. !            name, we insert it in linebuf, and then delete
  410. !            the variable name that we're replacing - and
  411. !             then we continue in case there are others ... */
  412. !         if (ep = getenv(varname)) {
  413. !             curchar = lp_start - linebuf;
  414. !             ins_str(ep, NO);
  415. !             del_char(FORWARD, strlen(varname) + 1);
  416. !             lp = linebuf + curchar;
  417. !         }
  418. !     }
  419. !     ToMark(m);
  420. !     DelMark(m);
  421. ! }
  422. ! private char *
  423.   real_ask(delim, d_proc, def, prompt)
  424.   char    *delim,
  425.       *def,
  426. ***************
  427. *** 72,79 ****
  428.       int    abort = 0,
  429.           no_typed = 0;
  430.       data_obj    *push_cmd = LastCmd;
  431. !     int    o_exp = exp,
  432. !         o_exp_p = exp_p;
  433.   
  434.       if (InAsk)
  435.           complain((char *) 0);
  436. --- 115,122 ----
  437.       int    abort = 0,
  438.           no_typed = 0;
  439.       data_obj    *push_cmd = LastCmd;
  440. !     int    o_a_v = arg_value(),
  441. !         o_i_an_a = is_an_arg();
  442.   
  443.       if (InAsk)
  444.           complain((char *) 0);
  445. ***************
  446. *** 95,102 ****
  447.           }
  448.   
  449.       for (;;) {
  450. !         exp = 1;
  451. !         exp_p = NO;
  452.           last_cmd = this_cmd;
  453.           init_strokes();
  454.   cont:        s_mess("%s%s", prompt, linebuf);
  455. --- 138,144 ----
  456.           }
  457.   
  458.       for (;;) {
  459. !         clr_arg_value();
  460.           last_cmd = this_cmd;
  461.           init_strokes();
  462.   cont:        s_mess("%s%s", prompt, linebuf);
  463. ***************
  464. *** 103,120 ****
  465.           Asking = curchar + prompt_len;
  466.           c = getch();
  467.           if ((c == EOF) || index(delim, c)) {
  468.               if (d_proc == 0 || (*d_proc)(c) == 0)
  469.                   goto cleanup;
  470.           } else switch (c) {
  471. !         case CTL(G):
  472.               message("[Aborted]");
  473.               abort++;
  474.               goto cleanup;
  475.   
  476. !         case CTL(N):
  477. !         case CTL(P):
  478.               if (CurAskPtr != 0) {
  479. !                 int    n = (c == CTL(P) ? -exp : exp);
  480.   
  481.                   CurAskPtr = next_line(CurAskPtr, n);
  482.                   if (CurAskPtr == curbuf->b_first && CurAskPtr->l_next != 0)
  483. --- 145,164 ----
  484.           Asking = curchar + prompt_len;
  485.           c = getch();
  486.           if ((c == EOF) || index(delim, c)) {
  487. +             if (DoEVexpand)
  488. +                 EVexpand();
  489.               if (d_proc == 0 || (*d_proc)(c) == 0)
  490.                   goto cleanup;
  491.           } else switch (c) {
  492. !         case CTL('G'):
  493.               message("[Aborted]");
  494.               abort++;
  495.               goto cleanup;
  496.   
  497. !         case CTL('N'):
  498. !         case CTL('P'):
  499.               if (CurAskPtr != 0) {
  500. !                 int    n = (c == CTL('P') ? -arg_value() : arg_value());
  501.   
  502.                   CurAskPtr = next_line(CurAskPtr, n);
  503.                   if (CurAskPtr == curbuf->b_first && CurAskPtr->l_next != 0)
  504. ***************
  505. *** 127,133 ****
  506.               }
  507.               break;
  508.   
  509. !         case CTL(R):
  510.               if (def)
  511.                   ins_str(def, NO);
  512.               else
  513. --- 171,177 ----
  514.               }
  515.               break;
  516.   
  517. !         case CTL('R'):
  518.               if (def)
  519.                   ins_str(def, NO);
  520.               else
  521. ***************
  522. *** 151,158 ****
  523.       pop_env(savejmp);
  524.   
  525.       LastCmd = push_cmd;
  526. !     exp_p = o_exp_p;
  527. !     exp = o_exp;
  528.       no_typed = (linebuf[0] == '\0');
  529.       strcpy(Minibuf, linebuf);
  530.       SetBuf(saveb);
  531. --- 195,202 ----
  532.       pop_env(savejmp);
  533.   
  534.       LastCmd = push_cmd;
  535. !     set_arg_value(o_a_v);
  536. !     set_is_an_arg(o_i_an_a);
  537.       no_typed = (linebuf[0] == '\0');
  538.       strcpy(Minibuf, linebuf);
  539.       SetBuf(saveb);
  540. ***************
  541. *** 212,218 ****
  542.       return real_ask(delim, d_proc, def, prompt);
  543.   }
  544.   
  545. ! /* VARARGS2 */
  546.   
  547.   yes_or_no_p(fmt, va_alist)
  548.   char    *fmt;
  549. --- 256,262 ----
  550.       return real_ask(delim, d_proc, def, prompt);
  551.   }
  552.   
  553. ! /* VARARGS1 */
  554.   
  555.   yes_or_no_p(fmt, va_alist)
  556.   char    *fmt;
  557. ***************
  558. *** 230,236 ****
  559.           Asking = strlen(prompt);    /* so redisplay works */
  560.           c = getch();
  561.           Asking = NO;
  562. !         switch (Upper(c)) {
  563.           case 'Y':
  564.               return YES;
  565.   
  566. --- 274,280 ----
  567.           Asking = strlen(prompt);    /* so redisplay works */
  568.           c = getch();
  569.           Asking = NO;
  570. !         switch (CharUpcase(c)) {
  571.           case 'Y':
  572.               return YES;
  573.   
  574. ***************
  575. *** 237,243 ****
  576.           case 'N':
  577.               return NO;
  578.   
  579. !         case CTL(G):
  580.               complain("[Aborted]");
  581.   
  582.           default:
  583. --- 281,287 ----
  584.           case 'N':
  585.               return NO;
  586.   
  587. !         case CTL('G'):
  588.               complain("[Aborted]");
  589.   
  590.           default:
  591. ***************
  592. *** 343,353 ****
  593.               (linebuf[curchar - 1] != '/') &&
  594.               (isdir(linebuf)));
  595.       if (the_same && !is_ntdir) {
  596. !         add_mess(n == 1 ? " [Unique]" : " [Ambiguous]");
  597.           SitFor(7);
  598.       }
  599.       if (is_ntdir)
  600. !         Insert('/');
  601.   }
  602.   
  603.   extern int    alphacomp();
  604. --- 387,397 ----
  605.               (linebuf[curchar - 1] != '/') &&
  606.               (isdir(linebuf)));
  607.       if (the_same && !is_ntdir) {
  608. !         add_mess((n == 1) ? " [Unique]" : " [Ambiguous]");
  609.           SitFor(7);
  610.       }
  611.       if (is_ntdir)
  612. !         insert_c('/', 1);
  613.   }
  614.   
  615.   extern int    alphacomp();
  616. ***************
  617. *** 438,444 ****
  618.   {
  619.       char    *ans,
  620.           prompt[128],
  621. !         *pretty_name = pr_name(def);
  622.   
  623.       if (prmt)
  624.           sprintf(prompt, prmt);
  625. --- 482,488 ----
  626.   {
  627.       char    *ans,
  628.           prompt[128],
  629. !         *pretty_name = pr_name(def, YES);
  630.   
  631.       if (prmt)
  632.           sprintf(prompt, prmt);
  633. diff -c ojove/buf.c jove/buf.c
  634. *** ojove/buf.c    Thu Jul 16 09:14:07 1987
  635. --- jove/buf.c    Tue Jun 23 13:50:25 1987
  636. ***************
  637. *** 26,33 ****
  638.   
  639.   TogMinor(bit)
  640.   {
  641. !     if (exp_p) {
  642. !         if (exp == 0)
  643.               curbuf->b_minor &= ~bit;
  644.           else
  645.               curbuf->b_minor |= bit;
  646. --- 26,33 ----
  647.   
  648.   TogMinor(bit)
  649.   {
  650. !     if (is_an_arg()) {
  651. !         if (arg_value() == 0)
  652.               curbuf->b_minor &= ~bit;
  653.           else
  654.               curbuf->b_minor |= bit;
  655. ***************
  656. *** 147,153 ****
  657.       offset = complete(bnames, prompt, RET_STATE);
  658.       if (offset == EOF)
  659.           complain((char *) 0);
  660. !     if (offset == ORIGINAL)
  661.           bname = Minibuf;
  662.       else if (offset == NULLSTRING) {
  663.           if (def)
  664. --- 147,153 ----
  665.       offset = complete(bnames, prompt, RET_STATE);
  666.       if (offset == EOF)
  667.           complain((char *) 0);
  668. !     if (offset == ORIGINAL || offset == AMBIGUOUS)
  669.           bname = Minibuf;
  670.       else if (offset == NULLSTRING) {
  671.           if (def)
  672. ***************
  673. *** 171,177 ****
  674.       SetBuf(do_select(curwind, bname));
  675.   }
  676.   
  677. ! static
  678.   defb_wind(b)
  679.   register Buffer *b;
  680.   {
  681. --- 171,177 ----
  682.       SetBuf(do_select(curwind, bname));
  683.   }
  684.   
  685. ! private
  686.   defb_wind(b)
  687.   register Buffer *b;
  688.   {
  689. ***************
  690. *** 186,202 ****
  691.   
  692.       do {
  693.           if (w->w_bufp == b) {
  694. !             if (one_windp())
  695.                   (void) do_select(w, alt);
  696.               else {
  697. !                 register Window    *save = w->w_next;
  698.   
  699.                   del_wind(w);
  700.                   w = save->w_prev;
  701.               }
  702. !         }                
  703.           w = w->w_next;
  704. !     } while (w != fwind);
  705.   }
  706.   
  707.   Buffer *
  708. --- 186,202 ----
  709.   
  710.       do {
  711.           if (w->w_bufp == b) {
  712. !             if (one_windp() || alt != Mainbuf)
  713.                   (void) do_select(w, alt);
  714.               else {
  715. !                 Window    *save = w->w_next;
  716.   
  717.                   del_wind(w);
  718.                   w = save->w_prev;
  719.               }
  720. !         }
  721.           w = w->w_next;
  722. !     } while (w != fwind || w->w_bufp == b);
  723.   }
  724.   
  725.   Buffer *
  726. ***************
  727. *** 275,281 ****
  728.               continue;
  729.           if (IsModified(b)) {
  730.               y_or_n = ask("No", "%s modified; should I save it? ", b->b_name);
  731. !             if (Upper(*y_or_n) == 'Y') {
  732.                   oldb = curbuf;
  733.                   SetBuf(b);
  734.                   SaveFile();
  735. --- 275,281 ----
  736.               continue;
  737.           if (IsModified(b)) {
  738.               y_or_n = ask("No", "%s modified; should I save it? ", b->b_name);
  739. !             if (CharUpcase(*y_or_n) == 'Y') {
  740.                   oldb = curbuf;
  741.                   SetBuf(b);
  742.                   SaveFile();
  743. ***************
  744. *** 499,505 ****
  745.   {
  746.       struct stat    stbuf;
  747.   
  748. !     if (b->b_fname == 0 || stat(b->b_fname, &stbuf) == -1) {
  749.           b->b_ino = 0;
  750.           b->b_mtime = 0;
  751.       } else {
  752. --- 499,505 ----
  753.   {
  754.       struct stat    stbuf;
  755.   
  756. !     if (b->b_fname == 0 || stat(pr_name(b->b_fname, NO), &stbuf) == -1) {
  757.           b->b_ino = 0;
  758.           b->b_mtime = 0;
  759.       } else {
  760. ***************
  761. *** 524,537 ****
  762.           bufname(b);
  763.           set_ino(b);
  764.           b->b_ntbf = 1;
  765. -         if (force) {
  766. -             Buffer    *oldb = curbuf;
  767. -             SetBuf(b);    /* this'll read the file */
  768. -             SetBuf(oldb);
  769. -         }
  770.       }
  771.   
  772.       if (w)
  773.           tiewind(w, b);
  774.       return b;
  775. --- 524,536 ----
  776.           bufname(b);
  777.           set_ino(b);
  778.           b->b_ntbf = 1;
  779.       }
  780. +     if (force) {
  781. +         Buffer    *oldb = curbuf;
  782.   
  783. +         SetBuf(b);    /* this'll read the file */
  784. +         SetBuf(oldb);
  785. +     }
  786.       if (w)
  787.           tiewind(w, b);
  788.       return b;
  789. ***************
  790. *** 549,563 ****
  791.   SetBuf(newbuf)
  792.   register Buffer    *newbuf;
  793.   {
  794. !     register Buffer    *oldb = curbuf;
  795.   
  796.       if (newbuf == curbuf || newbuf == 0)
  797.           return;
  798.   
  799.       lsave();
  800.       curbuf = newbuf;
  801. !     curline = newbuf->b_dot;
  802. !     curchar = newbuf->b_char;
  803.       getDOT();
  804.       /* Do the read now ... */
  805.       if (curbuf->b_ntbf)
  806. --- 548,570 ----
  807.   SetBuf(newbuf)
  808.   register Buffer    *newbuf;
  809.   {
  810. !     register Buffer    *oldb = curbuf,
  811. !             *b;
  812.   
  813.       if (newbuf == curbuf || newbuf == 0)
  814.           return;
  815.   
  816. +     /* check to see that we're selecting a valid buffer */
  817. +     for (b = world; b != 0; b = b->b_next)
  818. +         if (b == newbuf)
  819. +             break;
  820. +     if (b == 0)
  821. +         complain("Internal error: (%x) is not a valid buffer pointer!", newbuf);
  822.       lsave();
  823.       curbuf = newbuf;
  824. ! /*    curline = newbuf->b_dot;
  825. !     curchar = newbuf->b_char;    STUPID!! */
  826.       getDOT();
  827.       /* Do the read now ... */
  828.       if (curbuf->b_ntbf)
  829. diff -c ojove/c.c jove/c.c
  830. *** ojove/c.c    Thu Jul 16 09:14:09 1987
  831. --- jove/c.c    Wed Jun 24 12:43:21 1987
  832. ***************
  833. *** 167,180 ****
  834.       register char    c,
  835.               syntax = (dir == FORWARD) ? _Op : _Cl;
  836.   
  837. -     exp = 1;
  838.       if (dir == BACKWARD)
  839. !         BackChar();
  840.       c = linebuf[curchar];
  841.       for (;;) {
  842.           if (!skip_words && ismword(c)) {
  843.               WITH_TABLE(curbuf->b_major)
  844. !             (dir == FORWARD) ? ForWord() : BackWord();
  845.               END_TABLE();
  846.               break;
  847.           } else if (has_syntax(c, syntax)) {
  848. --- 167,179 ----
  849.       register char    c,
  850.               syntax = (dir == FORWARD) ? _Op : _Cl;
  851.   
  852.       if (dir == BACKWARD)
  853. !         b_char(1);
  854.       c = linebuf[curchar];
  855.       for (;;) {
  856.           if (!skip_words && ismword(c)) {
  857.               WITH_TABLE(curbuf->b_major)
  858. !             (dir == FORWARD) ? f_word(1) : b_word(1);
  859.               END_TABLE();
  860.               break;
  861.           } else if (has_syntax(c, syntax)) {
  862. ***************
  863. *** 181,187 ****
  864.               FindMatch(dir);
  865.               break;
  866.           }
  867. !         DoTimes(ForChar(), dir);
  868.           if (eobp() || bobp())
  869.               return;
  870.           c = linebuf[curchar];
  871. --- 180,186 ----
  872.               FindMatch(dir);
  873.               break;
  874.           }
  875. !         f_char(dir);
  876.           if (eobp() || bobp())
  877.               return;
  878.           c = linebuf[curchar];
  879. ***************
  880. *** 190,199 ****
  881.   
  882.   FSexpr()
  883.   {
  884. !     register int    num = exp;
  885.   
  886. !     if (exp < 0) {
  887. !         exp = -exp;
  888.           BSexpr();
  889.       }
  890.       while (--num >= 0)
  891. --- 189,198 ----
  892.   
  893.   FSexpr()
  894.   {
  895. !     register int    num = arg_value();
  896.   
  897. !     if (num < 0) {
  898. !         set_arg_value(-num);
  899.           BSexpr();
  900.       }
  901.       while (--num >= 0)
  902. ***************
  903. *** 202,211 ****
  904.   
  905.   FList()
  906.   {
  907. !     register int    num = exp;
  908.   
  909. !     if (exp < 0) {
  910. !         exp = -exp;
  911.           BList();
  912.       }
  913.       while (--num >= 0)
  914. --- 201,210 ----
  915.   
  916.   FList()
  917.   {
  918. !     register int    num = arg_value();
  919.   
  920. !     if (num < 0) {
  921. !         set_arg_value(-num);
  922.           BList();
  923.       }
  924.       while (--num >= 0)
  925. ***************
  926. *** 214,223 ****
  927.   
  928.   BSexpr()
  929.   {
  930. !     register int    num = exp;
  931.   
  932. !     if (exp < 0) {
  933. !         exp = -exp;
  934.           FSexpr();
  935.       }
  936.       while (--num >= 0)
  937. --- 213,222 ----
  938.   
  939.   BSexpr()
  940.   {
  941. !     register int    num = arg_value();
  942.   
  943. !     if (num < 0) {
  944. !         negate_arg_value();
  945.           FSexpr();
  946.       }
  947.       while (--num >= 0)
  948. ***************
  949. *** 226,235 ****
  950.   
  951.   BList()
  952.   {
  953. !     register int    num = exp;
  954.   
  955. !     if (exp < 0) {
  956. !         exp = -exp;
  957.           FList();
  958.       }
  959.       while (--num >= 0)
  960. --- 225,234 ----
  961.   
  962.   BList()
  963.   {
  964. !     register int    num = arg_value();
  965.   
  966. !     if (num < 0) {
  967. !         negate_arg_value();
  968.           FList();
  969.       }
  970.       while (--num >= 0)
  971. ***************
  972. *** 275,284 ****
  973.           (backslashed(linebuf, curchar)))
  974.           complain((char *) 0);
  975.       if (dir == FORWARD)
  976. !         ForChar();
  977.       bp = m_paren(c, dir, YES, NO);
  978.       if (dir == FORWARD)
  979. !         BackChar();
  980.       if (bp != 0)
  981.           SetDot(bp);
  982.       mp_error();    /* if there is an error the user wants to
  983. --- 274,283 ----
  984.           (backslashed(linebuf, curchar)))
  985.           complain((char *) 0);
  986.       if (dir == FORWARD)
  987. !         f_char(1);
  988.       bp = m_paren(c, dir, YES, NO);
  989.       if (dir == FORWARD)
  990. !         b_char(1);
  991.       if (bp != 0)
  992.           SetDot(bp);
  993.       mp_error();    /* if there is an error the user wants to
  994. ***************
  995. *** 482,488 ****
  996.           SetDot(match_c);
  997.       }
  998.       SetDot(&open_c_pt);
  999. !     open_c_mark = MakeMark(curline, curchar, FLOATER);
  1000.       indent_pos = calc_pos(linebuf, curchar);
  1001.       /* search for a close comment; delete it if it exits */
  1002.       SetDot(&close_c_pt);
  1003. --- 481,487 ----
  1004.           SetDot(match_c);
  1005.       }
  1006.       SetDot(&open_c_pt);
  1007. !     open_c_mark = MakeMark(curline, curchar, M_FLOATER);
  1008.       indent_pos = calc_pos(linebuf, curchar);
  1009.       /* search for a close comment; delete it if it exits */
  1010.       SetDot(&close_c_pt);
  1011. ***************
  1012. *** 489,497 ****
  1013.       if (close_at_dot == 0) {
  1014.           slen = strlen(close_pat);
  1015.           while (slen--)
  1016. !             DelPChar();
  1017.       }
  1018. !     entry_mark = MakeMark(curline, curchar, FLOATER);
  1019.       ToMark(open_c_mark);
  1020.       /* always separate the comment body from anything preceeding it */
  1021.       LineInsert(1);
  1022. --- 488,496 ----
  1023.       if (close_at_dot == 0) {
  1024.           slen = strlen(close_pat);
  1025.           while (slen--)
  1026. !             del_char(BACKWARD, 1);
  1027.       }
  1028. !     entry_mark = MakeMark(curline, curchar, M_FLOATER);
  1029.       ToMark(open_c_mark);
  1030.       /* always separate the comment body from anything preceeding it */
  1031.       LineInsert(1);
  1032. ***************
  1033. *** 502,511 ****
  1034.               if (!eolp())
  1035.                   LineInsert(1);
  1036.               else
  1037. !                 line_move(FORWARD, NO);
  1038.           } else if (*cp == ' ' || *cp == '\t') {
  1039.               if (linebuf[curchar] != *cp)
  1040. !                 Insert(*cp);
  1041.           } else
  1042.               /* Since we matched the open comment string on this
  1043.                  line, we don't need to worry about crossing line
  1044. --- 501,510 ----
  1045.               if (!eolp())
  1046.                   LineInsert(1);
  1047.               else
  1048. !                 line_move(FORWARD, 1, NO);
  1049.           } else if (*cp == ' ' || *cp == '\t') {
  1050.               if (linebuf[curchar] != *cp)
  1051. !                 insert_c(*cp, 1);
  1052.           } else
  1053.               /* Since we matched the open comment string on this
  1054.                  line, we don't need to worry about crossing line
  1055. ***************
  1056. *** 512,518 ****
  1057.                  boundaries. */
  1058.               curchar++;
  1059.       }
  1060. !     savedot = MakeMark(curline, curchar, FLOATER);
  1061.   
  1062.       /* We need to strip the line header pattern of leading white space
  1063.          since we need to match the line after all of its leading
  1064. --- 511,517 ----
  1065.                  boundaries. */
  1066.               curchar++;
  1067.       }
  1068. !     savedot = MakeMark(curline, curchar, M_FLOATER);
  1069.   
  1070.       /* We need to strip the line header pattern of leading white space
  1071.          since we need to match the line after all of its leading
  1072. ***************
  1073. *** 529,556 ****
  1074.           Bol();
  1075.           DelWtSpace();
  1076.           if (header_len && !strncmp(linebuf, cp, header_len))
  1077. !             DoTimes(DelNChar(), header_len);
  1078.           if (trailer_len) {
  1079.               Eol();
  1080.               if ((curchar > trailer_len) &&
  1081.                   (!strncmp(&linebuf[curchar - trailer_len],
  1082.                         l_trailer, trailer_len)))
  1083. !                 DoTimes(DelPChar(), trailer_len);
  1084.           }
  1085.           if (curline->l_next != 0)
  1086. !             line_move(FORWARD, NO);
  1087.           else
  1088.               break;
  1089.       } while (curline != entry_mark->m_line->l_next);
  1090.   
  1091. !     DoSetMark(savedot->m_line, savedot->m_char);
  1092.       ToMark(entry_mark);
  1093.       saveRMargin = RMargin;
  1094.       RMargin = saveRMargin - strlen(l_header) -
  1095.             strlen(l_trailer) - indent_pos + 2;
  1096. !     /* do not use the left margin */
  1097. !     exp_p = NO;
  1098. !     do_rfill();
  1099.       RMargin = saveRMargin;
  1100.       /* get back to the start of the comment */
  1101.       PopMark(); 
  1102. --- 528,553 ----
  1103.           Bol();
  1104.           DelWtSpace();
  1105.           if (header_len && !strncmp(linebuf, cp, header_len))
  1106. !             del_char(FORWARD, header_len);
  1107.           if (trailer_len) {
  1108.               Eol();
  1109.               if ((curchar > trailer_len) &&
  1110.                   (!strncmp(&linebuf[curchar - trailer_len],
  1111.                         l_trailer, trailer_len)))
  1112. !                 del_char(BACKWARD, trailer_len);
  1113.           }
  1114.           if (curline->l_next != 0)
  1115. !             line_move(FORWARD, 1, NO);
  1116.           else
  1117.               break;
  1118.       } while (curline != entry_mark->m_line->l_next);
  1119.   
  1120. !     do_set_mark(savedot->m_line, savedot->m_char);
  1121.       ToMark(entry_mark);
  1122.       saveRMargin = RMargin;
  1123.       RMargin = saveRMargin - strlen(l_header) -
  1124.             strlen(l_trailer) - indent_pos + 2;
  1125. !     do_rfill(NO);
  1126.       RMargin = saveRMargin;
  1127.       /* get back to the start of the comment */
  1128.       PopMark(); 
  1129. ***************
  1130. *** 567,579 ****
  1131.           else
  1132.               ins_str(l_trailer, NO);
  1133.           if (curline->l_next != 0)
  1134. !             line_move(FORWARD, NO);
  1135.           else 
  1136.               break;
  1137.       } while (curline != entry_mark->m_line->l_next);
  1138.       /* handle the close comment symbol */
  1139.       if (curline == entry_mark->m_line->l_next) {
  1140. !         line_move(BACKWARD, NO);
  1141.           Eol();
  1142.       }
  1143.       DelWtSpace();
  1144. --- 564,576 ----
  1145.           else
  1146.               ins_str(l_trailer, NO);
  1147.           if (curline->l_next != 0)
  1148. !             line_move(FORWARD, 1, NO);
  1149.           else 
  1150.               break;
  1151.       } while (curline != entry_mark->m_line->l_next);
  1152.       /* handle the close comment symbol */
  1153.       if (curline == entry_mark->m_line->l_next) {
  1154. !         line_move(BACKWARD, 1, NO);
  1155.           Eol();
  1156.       }
  1157.       DelWtSpace();
  1158. ***************
  1159. *** 588,599 ****
  1160.               LineInsert(1);
  1161.               n_indent(indent_pos);
  1162.           } else
  1163. !             Insert(*cp);
  1164.       }
  1165.       ToMark(open_c_mark);
  1166.       Eol();
  1167. !     exp_p = NO;
  1168. !     DelNChar();
  1169.   }
  1170.   
  1171.   #endif CMT_FMT
  1172. --- 585,595 ----
  1173.               LineInsert(1);
  1174.               n_indent(indent_pos);
  1175.           } else
  1176. !             insert_c(*cp, 1);
  1177.       }
  1178.       ToMark(open_c_mark);
  1179.       Eol();
  1180. !     del_char(FORWARD, 1);
  1181.   }
  1182.   
  1183.   #endif CMT_FMT
  1184. diff -c ojove/case.c jove/case.c
  1185. *** ojove/case.c    Thu Jul 16 09:14:09 1987
  1186. --- jove/case.c    Fri Jun 12 10:45:46 1987
  1187. ***************
  1188. *** 16,31 ****
  1189.   
  1190.       DOTsave(&b);
  1191.   
  1192. !     if (exp < 0) {
  1193.           restore++;
  1194. !         exp = -exp;
  1195. !         num = exp;
  1196. !         BackChar();    /* Cap previous EXP chars */
  1197. !     } else
  1198. !         num = exp;
  1199.           
  1200. -     exp = 1;    /* So all the commands are done once */
  1201.       while (num--) {
  1202.           if (upper(&linebuf[curchar])) {
  1203.               modify();
  1204. --- 16,28 ----
  1205.   
  1206.       DOTsave(&b);
  1207.   
  1208. !     num = arg_value();
  1209. !     if (num < 0) {
  1210.           restore++;
  1211. !         num = -num;
  1212. !         b_char(num);    /* Cap previous EXP chars */
  1213. !     }
  1214.           
  1215.       while (num--) {
  1216.           if (upper(&linebuf[curchar])) {
  1217.               modify();
  1218. ***************
  1219. *** 35,42 ****
  1220.               if (curline->l_next == 0)
  1221.                   break;
  1222.               SetLine(curline->l_next);
  1223. !         }
  1224. !         else
  1225.               curchar++;
  1226.       }
  1227.       if (restore)
  1228. --- 32,38 ----
  1229.               if (curline->l_next == 0)
  1230.                   break;
  1231.               SetLine(curline->l_next);
  1232. !         } else
  1233.               curchar++;
  1234.       }
  1235.       if (restore)
  1236. ***************
  1237. *** 51,65 ****
  1238.   
  1239.       DOTsave(&b);
  1240.   
  1241. !     if (exp < 0) {
  1242.           restore++;
  1243. !         exp = -exp;
  1244. !         num = exp;
  1245. !         BackWord();    /* Cap previous EXP words */
  1246. !     } else
  1247. !         num = exp;
  1248. !         
  1249. !     exp = 1;    /* So all the commands are done once */
  1250.   
  1251.       while (num--) {
  1252.           to_word(1);    /* Go to the beginning of the next word. */
  1253. --- 47,58 ----
  1254.   
  1255.       DOTsave(&b);
  1256.   
  1257. !     num = arg_value();
  1258. !     if (num < 0) {
  1259.           restore++;
  1260. !         num = -num;
  1261. !         b_word(num);        /* Cap previous EXP words */
  1262. !     }
  1263.   
  1264.       while (num--) {
  1265.           to_word(1);    /* Go to the beginning of the next word. */
  1266. ***************
  1267. *** 87,97 ****
  1268.       Bufpos    before;
  1269.   
  1270.       DOTsave(&before);
  1271. !     ForWord();    /* This'll go backward if negative argument. */
  1272.       case_reg(before.p_line, before.p_char, curline, curchar, up);
  1273.   }
  1274.   
  1275. ! static
  1276.   upper(c)
  1277.   register char    *c;
  1278.   {
  1279. --- 80,90 ----
  1280.       Bufpos    before;
  1281.   
  1282.       DOTsave(&before);
  1283. !     ForWord();    /* this'll go backward if negative argument */
  1284.       case_reg(before.p_line, before.p_char, curline, curchar, up);
  1285.   }
  1286.   
  1287. ! private
  1288.   upper(c)
  1289.   register char    *c;
  1290.   {
  1291. ***************
  1292. *** 121,127 ****
  1293.       (void) fixorder(&line1, &char1, &line2, &char2);
  1294.       DotTo(line1, char1);
  1295.   
  1296. -     exp = 1;
  1297.       for (;;) {
  1298.           if (curline == line2 && curchar == char2)
  1299.               break;
  1300. --- 114,119 ----
  1301. ***************
  1302. *** 130,136 ****
  1303.                   makedirty(curline);
  1304.                   modify();
  1305.               }
  1306. !         ForChar();
  1307.       }
  1308.   }
  1309.   
  1310. --- 122,128 ----
  1311.                   makedirty(curline);
  1312.                   modify();
  1313.               }
  1314. !         f_char(1);
  1315.       }
  1316.   }
  1317.   
  1318. diff -c ojove/ctype.c jove/ctype.c
  1319. *** ojove/ctype.c    Thu Jul 16 09:14:11 1987
  1320. --- jove/ctype.c    Wed Feb  4 11:37:21 1987
  1321. ***************
  1322. *** 89,91 ****
  1323. --- 89,111 ----
  1324.   {
  1325.       return ((CharTable[curbuf->b_major])[c]&(_W));
  1326.   }
  1327. + char CaseEquiv[] = {
  1328. +     '\000',    '\001',    '\002',    '\003',    '\004',    '\005',    '\006',    '\007',
  1329. +     '\010',    '\011',    '\012',    '\013',    '\014',    '\015',    '\016',    '\017',
  1330. +     '\020',    '\021',    '\022',    '\023',    '\024',    '\025',    '\026',    '\027',
  1331. +     '\030',    '\031',    '\032',    '\033',    '\034',    '\035',    '\036',    '\037',
  1332. +     '\040',    '!',    '"',    '#',    '$',    '%',    '&',    '\'',
  1333. +     '(',    ')',    '*',    '+',    ',',    '-',    '.',    '/',
  1334. +     '0',    '1',    '2',    '3',    '4',    '5',    '6',    '7',
  1335. +     '8',    '9',    ':',    ';',    '<',    '=',    '>',    '?',
  1336. +     '@',    'A',    'B',    'C',    'D',    'E',    'F',    'G',
  1337. +     'H',    'I',    'J',    'K',    'L',    'M',    'N',    'O',
  1338. +     'P',    'Q',    'R',    'S',    'T',    'U',    'V',    'W',
  1339. +     'X',    'Y',    'Z',    '[',    '\\',    ']',    '^',    '_',
  1340. +     '`',    'A',    'B',    'C',    'D',    'E',    'F',    'G',
  1341. +     'H',    'I',    'J',    'K',    'L',    'M',    'N',    'O',
  1342. +     'P',    'Q',    'R',    'S',    'T',    'U',    'V',    'W',
  1343. +     'X',    'Y',    'Z',    '{',    '|',    '}',    '~',    '\177'
  1344. + };
  1345. diff -c ojove/delete.c jove/delete.c
  1346. *** ojove/delete.c    Thu Jul 16 09:14:13 1987
  1347. --- jove/delete.c    Wed Jun 24 12:43:21 1987
  1348. ***************
  1349. *** 99,105 ****
  1350.   
  1351.   DelNChar()
  1352.   {
  1353. !     del_char(1);
  1354.   }
  1355.   
  1356.   /* Delete character backward */
  1357. --- 99,105 ----
  1358.   
  1359.   DelNChar()
  1360.   {
  1361. !     del_char(FORWARD, arg_value());
  1362.   }
  1363.   
  1364.   /* Delete character backward */
  1365. ***************
  1366. *** 107,134 ****
  1367.   DelPChar()
  1368.   {
  1369.       if (MinorMode(OverWrite)) {
  1370. !         int    count = min(exp, curchar);
  1371.   
  1372. !         DoTimes(BackChar(), count);
  1373. !         LastKeyStruck = ' ';    /* can you say gross? */
  1374. !         DoTimes(SelfInsert(), count);
  1375. !         DoTimes(BackChar(), count);
  1376.       } else        
  1377. !         del_char(0);
  1378.   }
  1379.   
  1380. ! /* Delete some characters.  If deleting `forward' then call for_char
  1381.      to the final position otherwise call back_char.  Then delete the
  1382.      region between the two with patchup(). */
  1383.   
  1384. ! del_char(forward)
  1385.   {
  1386.       Bufpos    before,
  1387.           after;
  1388. !     int    killp = (exp_p && abs(exp) > 1);
  1389.   
  1390.       DOTsave(&before);
  1391. !     (forward) ? ForChar() : BackChar();
  1392.       if (before.p_line == curline && before.p_char == curchar)
  1393.           complain((char *) 0);
  1394.       if (killp)
  1395. --- 107,138 ----
  1396.   DelPChar()
  1397.   {
  1398.       if (MinorMode(OverWrite)) {
  1399. !         int    count = min(arg_value(), curchar);
  1400.   
  1401. !         b_char(count);
  1402. !         /* overwrite with spaces */
  1403. !         set_arg_value(count);
  1404. !         LastKeyStruck = ' ';
  1405. !         SelfInsert();
  1406. !         b_char(count);
  1407.       } else        
  1408. !         del_char(BACKWARD, arg_value());
  1409.   }
  1410.   
  1411. ! /* Delete some characters.  If deleting forward then call for_char
  1412.      to the final position otherwise call back_char.  Then delete the
  1413.      region between the two with patchup(). */
  1414.   
  1415. ! del_char(dir, num)
  1416.   {
  1417.       Bufpos    before,
  1418.           after;
  1419. !     int    killp = (abs(num) > 1);
  1420.   
  1421.       DOTsave(&before);
  1422. !     (dir == FORWARD) ? f_char(num) : b_char(num);
  1423.       if (before.p_line == curline && before.p_char == curchar)
  1424.           complain((char *) 0);
  1425.       if (killp)
  1426. ***************
  1427. *** 249,258 ****
  1428.       register Mark    *dot;
  1429.       int    all;
  1430.   
  1431. -     exp = 1;
  1432.       if (!blnkp(&linebuf[curchar]))
  1433.           return;
  1434. !     dot = MakeMark(curline, curchar, FLOATER);
  1435.       all = !blnkp(linebuf);
  1436.       while (blnkp(linebuf) && curline->l_prev)
  1437.           SetLine(curline->l_prev);
  1438. --- 253,261 ----
  1439.       register Mark    *dot;
  1440.       int    all;
  1441.   
  1442.       if (!blnkp(&linebuf[curchar]))
  1443.           return;
  1444. !     dot = MakeMark(curline, curchar, M_FLOATER);
  1445.       all = !blnkp(linebuf);
  1446.       while (blnkp(linebuf) && curline->l_prev)
  1447.           SetLine(curline->l_prev);
  1448. ***************
  1449. *** 259,271 ****
  1450.       all |= (firstp(curline));
  1451.       Eol();
  1452.       DelWtSpace();
  1453. !     line_move(FORWARD, NO);
  1454.       while (blnkp(linebuf) && !eobp()) {
  1455.           DelWtSpace();
  1456. !         DelNChar();
  1457.       }
  1458.       if (!all && !eobp())
  1459. !         OpenLine();
  1460.       ToMark(dot);
  1461.       DelMark(dot);
  1462.   }
  1463. --- 262,274 ----
  1464.       all |= (firstp(curline));
  1465.       Eol();
  1466.       DelWtSpace();
  1467. !     line_move(FORWARD, 1, NO);
  1468.       while (blnkp(linebuf) && !eobp()) {
  1469.           DelWtSpace();
  1470. !         del_char(FORWARD, 1);
  1471.       }
  1472.       if (!all && !eobp())
  1473. !         open_lines(1);
  1474.       ToMark(dot);
  1475.       DelMark(dot);
  1476.   }
  1477. diff -c ojove/disp.c jove/disp.c
  1478. *** ojove/disp.c    Thu Jul 16 09:14:15 1987
  1479. --- jove/disp.c    Fri Jul 10 09:25:49 1987
  1480. ***************
  1481. *** 108,118 ****
  1482.           if (VisBell && VB)
  1483.               putstr(VB);
  1484.           else
  1485. ! #ifdef SYSV    /* release 2, at least */
  1486. !             putpad("$<20>\007", 1) ;
  1487. ! #else
  1488. !             putpad("20\007", 1);
  1489. ! #endif SYSV
  1490.       }
  1491.       flusho();
  1492.   }
  1493. --- 108,114 ----
  1494.           if (VisBell && VB)
  1495.               putstr(VB);
  1496.           else
  1497. !             putpad(BL, 1);
  1498.       }
  1499.       flusho();
  1500.   }
  1501. ***************
  1502. *** 787,793 ****
  1503.           ign_some = 0;
  1504.       char    line[132],
  1505.           *fmt = ModeFmt,
  1506. -         tmp[16],
  1507.           fillc,
  1508.           c;
  1509.       register Buffer    *thisbuf = w->w_bufp;
  1510. --- 783,788 ----
  1511. ***************
  1512. *** 889,902 ****
  1513.                   mode_app("[No file]");
  1514.               else {
  1515.                   if (c == 'f')
  1516. !                     mode_app(pr_name(thisbuf->b_fname));
  1517.                   else
  1518.                       mode_app(basename(thisbuf->b_fname));
  1519.               }
  1520.               break;
  1521.   
  1522.           case 'n':
  1523.               for (bp = world, n = 1; bp != 0; bp = bp->b_next, n++)
  1524.                   if (bp == thisbuf)
  1525.                       break;
  1526. --- 884,899 ----
  1527.                   mode_app("[No file]");
  1528.               else {
  1529.                   if (c == 'f')
  1530. !                     mode_app(pr_name(thisbuf->b_fname, YES));
  1531.                   else
  1532.                       mode_app(basename(thisbuf->b_fname));
  1533.               }
  1534.               break;
  1535.   
  1536.           case 'n':
  1537. +             {
  1538. +             char    tmp[16];
  1539.               for (bp = world, n = 1; bp != 0; bp = bp->b_next, n++)
  1540.                   if (bp == thisbuf)
  1541.                       break;
  1542. ***************
  1543. *** 904,909 ****
  1544. --- 901,907 ----
  1545.               sprintf(tmp, "%d", n);
  1546.               mode_app(tmp);
  1547.               break;
  1548. +             }
  1549.   
  1550.           case 'm':
  1551.               if (IsModified(w->w_bufp))
  1552. ***************
  1553. *** 933,940 ****
  1554.                      (int) theavg,
  1555.                      (int)((theavg - (int) theavg) * 100));
  1556.                   mode_app(minibuf);
  1557.               }
  1558. -             break;
  1559.   #endif
  1560.   
  1561.           case 'C':    /* check mail here */
  1562. --- 931,938 ----
  1563.                      (int) theavg,
  1564.                      (int)((theavg - (int) theavg) * 100));
  1565.                   mode_app(minibuf);
  1566. +             break;
  1567.               }
  1568.   #endif
  1569.   
  1570.           case 'C':    /* check mail here */
  1571. ***************
  1572. *** 944,950 ****
  1573.   
  1574.   #ifdef CHDIR
  1575.           case 'd':    /* print working directory */
  1576. !             mode_app(pr_name(pwd()));
  1577.               break;
  1578.   #endif
  1579.               
  1580. --- 942,948 ----
  1581.   
  1582.   #ifdef CHDIR
  1583.           case 'd':    /* print working directory */
  1584. !             mode_app(pr_name(pwd(), YES));
  1585.               break;
  1586.   #endif
  1587.               
  1588. ***************
  1589. *** 958,963 ****
  1590. --- 956,975 ----
  1591.   
  1592.                   goto outahere;        /* %e means we're done! */
  1593.               }
  1594. + #ifdef IPROCS
  1595. +         case 'p':
  1596. +             if (thisbuf->b_type != B_PROCESS) {
  1597. +             char    tmp[40];
  1598. +             sprintf(tmp, "(%s)", (thisbuf->b_process == 0) ?
  1599. +                          "No process" :
  1600. +                          pstate(thisbuf->b_process));
  1601. +             mode_app(tmp);
  1602. +             break;
  1603. +             }
  1604. + #endif
  1605.           }
  1606.       }
  1607.   
  1608. ***************
  1609. *** 980,987 ****
  1610.   
  1611.   RedrawDisplay()
  1612.   {
  1613. !     Line    *newtop = prev_line((curwind->w_line = curline), exp_p ?
  1614. !                 exp : HALF(curwind));
  1615.   
  1616.       if (newtop == curwind->w_top)
  1617.           v_clear(FLine(curwind), FLine(curwind) + SIZE(curwind));
  1618. --- 992,999 ----
  1619.   
  1620.   RedrawDisplay()
  1621.   {
  1622. !     Line    *newtop = prev_line((curwind->w_line = curline), is_an_arg() ?
  1623. !                 arg_value() : HALF(curwind));
  1624.   
  1625.       if (newtop == curwind->w_top)
  1626.           v_clear(FLine(curwind), FLine(curwind) + SIZE(curwind));
  1627. ***************
  1628. *** 1016,1027 ****
  1629.   
  1630.       if (Asking)
  1631.           return;
  1632. !     if (exp < 0) {
  1633. !         exp = -exp;
  1634.           PrevPage();
  1635.           return;
  1636.       }
  1637. !     if (exp_p == YES)
  1638.           UpScroll();
  1639.       else {
  1640.           if (in_window(curwind, curwind->w_bufp->b_last) != -1) {
  1641. --- 1028,1039 ----
  1642.   
  1643.       if (Asking)
  1644.           return;
  1645. !     if (arg_value() < 0) {
  1646. !         negate_arg_value();
  1647.           PrevPage();
  1648.           return;
  1649.       }
  1650. !     if (arg_type() == YES)
  1651.           UpScroll();
  1652.       else {
  1653.           if (in_window(curwind, curwind->w_bufp->b_last) != -1) {
  1654. ***************
  1655. *** 1041,1052 ****
  1656.   
  1657.       if (Asking)
  1658.           return;
  1659. !     if (exp < 0) {
  1660. !         exp = -exp;
  1661.           NextPage();
  1662.           return;
  1663.       }
  1664. !     if (exp_p == YES)
  1665.           DownScroll();
  1666.       else {
  1667.           newline = prev_line(curwind->w_top, max(1, SIZE(curwind) - 1));
  1668. --- 1053,1064 ----
  1669.   
  1670.       if (Asking)
  1671.           return;
  1672. !     if (arg_value() < 0) {
  1673. !         negate_arg_value();
  1674.           NextPage();
  1675.           return;
  1676.       }
  1677. !     if (arg_type() == YES)
  1678.           DownScroll();
  1679.       else {
  1680.           newline = prev_line(curwind->w_top, max(1, SIZE(curwind) - 1));
  1681. ***************
  1682. *** 1058,1064 ****
  1683.   
  1684.   UpScroll()
  1685.   {
  1686. !     SetTop(curwind, next_line(curwind->w_top, exp));
  1687.       if ((curwind->w_bufp == curbuf) &&
  1688.           (in_window(curwind, curline) == -1))
  1689.           SetLine(curwind->w_top);
  1690. --- 1070,1076 ----
  1691.   
  1692.   UpScroll()
  1693.   {
  1694. !     SetTop(curwind, next_line(curwind->w_top, arg_value()));
  1695.       if ((curwind->w_bufp == curbuf) &&
  1696.           (in_window(curwind, curline) == -1))
  1697.           SetLine(curwind->w_top);
  1698. ***************
  1699. *** 1066,1072 ****
  1700.   
  1701.   DownScroll()
  1702.   {
  1703. !     SetTop(curwind, prev_line(curwind->w_top, exp));
  1704.       if ((curwind->w_bufp == curbuf) &&
  1705.           (in_window(curwind, curline) == -1))
  1706.           SetLine(curwind->w_top);
  1707. --- 1078,1084 ----
  1708.   
  1709.   DownScroll()
  1710.   {
  1711. !     SetTop(curwind, prev_line(curwind->w_top, arg_value()));
  1712.       if ((curwind->w_bufp == curbuf) &&
  1713.           (in_window(curwind, curline) == -1))
  1714.           SetLine(curwind->w_top);
  1715. ***************
  1716. *** 1101,1108 ****
  1717.       if (Asking)
  1718.           return;
  1719.       SetLine(next_line(curwind->w_top, SIZE(curwind) - 1 -
  1720. !             min(SIZE(curwind) - 1, exp - 1)));
  1721. !     if (exp_p == NO)
  1722.           Eol();
  1723.   }
  1724.   
  1725. --- 1113,1120 ----
  1726.       if (Asking)
  1727.           return;
  1728.       SetLine(next_line(curwind->w_top, SIZE(curwind) - 1 -
  1729. !             min(SIZE(curwind) - 1, arg_value() - 1)));
  1730. !     if (!is_an_arg())
  1731.           Eol();
  1732.   }
  1733.   
  1734. ***************
  1735. *** 1112,1118 ****
  1736.   {
  1737.       if (Asking)
  1738.           return;
  1739. !     SetLine(next_line(curwind->w_top, min(SIZE(curwind) - 1, exp - 1)));
  1740.   }
  1741.   
  1742.   private int    LineNo,
  1743. --- 1124,1130 ----
  1744.   {
  1745.       if (Asking)
  1746.           return;
  1747. !     SetLine(next_line(curwind->w_top, min(SIZE(curwind) - 1, arg_value() - 1)));
  1748.   }
  1749.   
  1750.   private int    LineNo,
  1751. ***************
  1752. *** 1158,1164 ****
  1753.           f_mess("--more--");
  1754.           if ((c = getchar()) != ' ') {
  1755.               TOabort++;
  1756. !             if (c != CTL(G) && c != RUBOUT)
  1757.                   Ungetc(c);
  1758.               return;
  1759.           }
  1760. --- 1170,1176 ----
  1761.           f_mess("--more--");
  1762.           if ((c = getchar()) != ' ') {
  1763.               TOabort++;
  1764. !             if (c != CTL('G') && c != RUBOUT)
  1765.                   Ungetc(c);
  1766.               return;
  1767.           }
  1768. Common subdirectories: ojove/doc and jove/doc
  1769. diff -c ojove/extend.c jove/extend.c
  1770. *** ojove/extend.c    Thu Jul 16 09:14:18 1987
  1771. --- jove/extend.c    Tue Jun 23 13:50:18 1987
  1772. ***************
  1773. *** 78,86 ****
  1774.   {
  1775.       register int    i;
  1776.   
  1777. !     exp_p = YES;
  1778. !     exp = 1;    /* So minor modes don't toggle.  We always want
  1779. !                them on. */
  1780.       if (new == 0)
  1781.           return;
  1782.       for (i = 0; i < ExecIndex; i++)
  1783. --- 78,84 ----
  1784.   {
  1785.       register int    i;
  1786.   
  1787. !     set_arg_value(1);
  1788.       if (new == 0)
  1789.           return;
  1790.       for (i = 0; i < ExecIndex; i++)
  1791. ***************
  1792. *** 165,171 ****
  1793.           } else if (c == '^') {
  1794.               if ((c = getch()) == '?')
  1795.                   c = RUBOUT;
  1796. !             else if (isalpha(c) || index("[\\]^_", c))
  1797.                   c = c - '@';
  1798.               else
  1799.                   complain("[Unknown control character]");
  1800. --- 163,169 ----
  1801.           } else if (c == '^') {
  1802.               if ((c = getch()) == '?')
  1803.                   c = RUBOUT;
  1804. !             else if (isalpha(c) || index("@[\\]^_", c))
  1805.                   c = c - '@';
  1806.               else
  1807.                   complain("[Unknown control character]");
  1808. ***************
  1809. *** 320,326 ****
  1810.               sprintf(keydescbuf, "%s %p", pref, c1);
  1811.           else
  1812.               sprintf(keydescbuf, "%s [%p-%p]", pref, c1, c2);
  1813. !         if (prefp = IsPrefix(map[c1]))
  1814.               DescMap(prefp, keydescbuf);
  1815.           else
  1816.               Typeout("%-14s%s", keydescbuf, map[c1]->Name);
  1817. --- 318,324 ----
  1818.               sprintf(keydescbuf, "%s %p", pref, c1);
  1819.           else
  1820.               sprintf(keydescbuf, "%s [%p-%p]", pref, c1, c2);
  1821. !         if ((prefp = IsPrefix(map[c1])) && (prefp != map))
  1822.               DescMap(prefp, keydescbuf);
  1823.           else
  1824.               Typeout("%-14s%s", keydescbuf, map[c1]->Name);
  1825. ***************
  1826. *** 377,383 ****
  1827.                   break;
  1828.               }
  1829.           }
  1830. !         if (prefp = IsPrefix(map[c1])) {
  1831.               sprintf(prefbuf, "%p", c1);
  1832.               fb_aux(cp, prefp, prefbuf, bufp);
  1833.           }
  1834. --- 375,381 ----
  1835.                   break;
  1836.               }
  1837.           }
  1838. !         if ((prefp = IsPrefix(map[c1])) && (prefp != map))  {
  1839.               sprintf(prefbuf, "%p", c1);
  1840.               fb_aux(cp, prefp, prefbuf, bufp);
  1841.           }
  1842. ***************
  1843. *** 640,654 ****
  1844.               comp_value = NULLSTRING;
  1845.               return 0;
  1846.           }
  1847. !         if (comp_flags & RET_STATE) switch (command) {
  1848. !             case UNIQUE:
  1849. !             case ORIGINAL:
  1850. !             case NULLSTRING:
  1851. !                 comp_value = command;
  1852. !                 return 0;
  1853. !             default:
  1854. !                 break;
  1855.           }
  1856.           if (InJoverc)
  1857.               complain("[\"%s\" unknown]", linebuf);
  1858. --- 638,646 ----
  1859.               comp_value = NULLSTRING;
  1860.               return 0;
  1861.           }
  1862. !         if (comp_flags & RET_STATE) {
  1863. !             comp_value = command;
  1864. !             return 0;
  1865.           }
  1866.           if (InJoverc)
  1867.               complain("[\"%s\" unknown]", linebuf);
  1868. ***************
  1869. *** 800,812 ****
  1870.           nchars += length(lp) + (lp->l_next != 0); /* include the NL */
  1871.       }
  1872.   
  1873. !     s_mess("[\"%s\" line %d of %d, char %D of %D (%d%%)]",
  1874. !             filename(curbuf),
  1875. !             dotline,
  1876. !             i,
  1877. !             dotchar,
  1878. !             nchars,
  1879. !             (int) (((long) dotchar * 100) / nchars));
  1880.   }
  1881.   
  1882.   #define IF_UNBOUND    -1
  1883. --- 792,802 ----
  1884.           nchars += length(lp) + (lp->l_next != 0); /* include the NL */
  1885.       }
  1886.   
  1887. !     s_mess("[\"%s\" line %d/%d, char %D/%D (%d%%), cursor = %d/%d]",
  1888. !            filename(curbuf), dotline, i, dotchar, nchars,
  1889. !            (nchars == 0) ? 100 : (int) (((long) dotchar * 100) / nchars),
  1890. !            calc_pos(linebuf, curchar),
  1891. !            calc_pos(linebuf, strlen(linebuf)));
  1892.   }
  1893.   
  1894.   #define IF_UNBOUND    -1
  1895. ***************
  1896. *** 884,890 ****
  1897.           Buffer    *savebuf = curbuf;
  1898.   
  1899.           SetBuf(do_select((Window *) 0, "RC errors"));
  1900. !         ins_str(sprint("%s:%d:%s\t%s\n", pr_name(file), lnum, lbuf, mesgbuf), NO);
  1901.           unmodify();
  1902.           SetBuf(savebuf);
  1903.           Asking = 0;
  1904. --- 874,880 ----
  1905.           Buffer    *savebuf = curbuf;
  1906.   
  1907.           SetBuf(do_select((Window *) 0, "RC errors"));
  1908. !         ins_str(sprint("%s:%d:%s\t%s\n", pr_name(file, YES), lnum, lbuf, mesgbuf), NO);
  1909.           unmodify();
  1910.           SetBuf(savebuf);
  1911.           Asking = 0;
  1912. diff -c ojove/fmt.c jove/fmt.c
  1913. *** ojove/fmt.c    Thu Jul 16 09:14:21 1987
  1914. --- jove/fmt.c    Fri May 29 12:49:31 1987
  1915. ***************
  1916. *** 33,42 ****
  1917.       putc('\0', sp);
  1918.   }
  1919.   
  1920. ! static char    padc = ' ';
  1921. ! static File    *curiop = 0;
  1922. ! static
  1923.   PPchar(c, str)
  1924.   int    c;
  1925.   char    *str;
  1926. --- 33,39 ----
  1927.       putc('\0', sp);
  1928.   }
  1929.   
  1930. ! private
  1931.   PPchar(c, str)
  1932.   int    c;
  1933.   char    *str;
  1934. ***************
  1935. *** 53,98 ****
  1936.           sprintf(cp, "%c", c);
  1937.   }
  1938.   
  1939. ! static
  1940. ! putld(leftadj, width, d, base)
  1941.   long    d;
  1942.   {
  1943.       int    length = 1;
  1944.       long    tmpd = d;
  1945.   
  1946.       while (tmpd = (tmpd / base))
  1947.           length++;
  1948.       if (d < 0)
  1949.           length++;
  1950. !     if (!leftadj)
  1951. !         pad(padc, width - length);
  1952.       if (d < 0) {
  1953. !         putc('-', curiop);
  1954.           d = -d;
  1955.       }
  1956.       outld(d, base);
  1957. !     if (leftadj)
  1958. !         pad(padc, width - length);
  1959.   }
  1960.   
  1961. ! static
  1962.   outld(d, base)
  1963.   long    d;
  1964.   {
  1965. !     long    n;
  1966.   
  1967.       if (n = (d / base))
  1968.           outld(n, base);
  1969. !     putc((int) ('0' + (int) (d % base)), curiop);
  1970.   }
  1971.   
  1972. ! static
  1973. ! puts(leftadj, width, str)
  1974.   char    *str;
  1975.   {
  1976.       int    length;
  1977. !     register char    *cp,
  1978. !             c;
  1979.   
  1980.       if (str == 0)
  1981.   #if pyr
  1982. --- 50,106 ----
  1983.           sprintf(cp, "%c", c);
  1984.   }
  1985.   
  1986. ! private struct fmt_state {
  1987. !     int    precision,
  1988. !         width,
  1989. !         leftadj;
  1990. !     char    padc;
  1991. !     File    *iop;
  1992. ! } current_fmt;
  1993. ! private
  1994. ! putld(d, base)
  1995.   long    d;
  1996.   {
  1997.       int    length = 1;
  1998.       long    tmpd = d;
  1999.   
  2000. +     if (current_fmt.width == 0 && current_fmt.precision) {
  2001. +         current_fmt.width = current_fmt.precision;
  2002. +         current_fmt.padc = '0';
  2003. +     }
  2004.       while (tmpd = (tmpd / base))
  2005.           length++;
  2006.       if (d < 0)
  2007.           length++;
  2008. !     if (!current_fmt.leftadj)
  2009. !         pad(current_fmt.padc, current_fmt.width - length);
  2010.       if (d < 0) {
  2011. !         putc('-', current_fmt.iop);
  2012.           d = -d;
  2013.       }
  2014.       outld(d, base);
  2015. !     if (current_fmt.leftadj)
  2016. !         pad(current_fmt.padc, current_fmt.width - length);
  2017.   }
  2018.   
  2019. ! private
  2020.   outld(d, base)
  2021.   long    d;
  2022.   {
  2023. !     register long    n;
  2024.   
  2025.       if (n = (d / base))
  2026.           outld(n, base);
  2027. !     putc((int) ('0' + (int) (d % base)), current_fmt.iop);
  2028.   }
  2029.   
  2030. ! private
  2031. ! puts(str)
  2032.   char    *str;
  2033.   {
  2034.       int    length;
  2035. !     register char    *cp;
  2036.   
  2037.       if (str == 0)
  2038.   #if pyr
  2039. ***************
  2040. *** 101,125 ****
  2041.           str = "(null)";
  2042.   #endif
  2043.       length = strlen(str);
  2044.       cp = str;
  2045. !     if (!leftadj)
  2046. !         pad(' ', width - length);
  2047. !     while (c = *cp++)
  2048. !         putc(c, curiop);
  2049. !     if (leftadj)
  2050. !         pad(' ', width - length);
  2051.   }
  2052.   
  2053. ! static
  2054.   pad(c, amount)
  2055.   register int    c,
  2056.           amount;
  2057.   {
  2058.       while (--amount >= 0)
  2059. !         putc(c, curiop);
  2060.   }
  2061.   
  2062. ! static
  2063.   doformat(sp, fmt, ap)
  2064.   register File    *sp;
  2065.   register char    *fmt;
  2066. --- 109,137 ----
  2067.           str = "(null)";
  2068.   #endif
  2069.       length = strlen(str);
  2070. +     if (current_fmt.precision == 0 || length < current_fmt.precision)
  2071. +         current_fmt.precision = length;
  2072. +     else
  2073. +         length = current_fmt.precision;
  2074.       cp = str;
  2075. !     if (!current_fmt.leftadj)
  2076. !         pad(' ', current_fmt.width - length);
  2077. !     while (--current_fmt.precision >= 0)
  2078. !         putc(*cp++, current_fmt.iop);
  2079. !     if (current_fmt.leftadj)
  2080. !         pad(' ', current_fmt.width - length);
  2081.   }
  2082.   
  2083. ! private
  2084.   pad(c, amount)
  2085.   register int    c,
  2086.           amount;
  2087.   {
  2088.       while (--amount >= 0)
  2089. !         putc(c, current_fmt.iop);
  2090.   }
  2091.   
  2092. ! private
  2093.   doformat(sp, fmt, ap)
  2094.   register File    *sp;
  2095.   register char    *fmt;
  2096. ***************
  2097. *** 126,171 ****
  2098.   va_list    ap;
  2099.   {
  2100.       register char    c;
  2101. !     int    leftadj,
  2102. !         width;
  2103. !     File    *pushiop = curiop;
  2104.   
  2105. !     curiop = sp;
  2106.   
  2107.       while (c = *fmt++) {
  2108.           if (c != '%') {
  2109. !             putc(c, sp);
  2110.               continue;
  2111.           }
  2112.   
  2113. !         padc = ' ';
  2114. !         leftadj = width = 0;
  2115.           c = *fmt++;
  2116.           if (c == '-') {
  2117. !             leftadj++;
  2118.               c = *fmt++;
  2119.           }
  2120.           if (c == '0') {
  2121. !             padc = '0';
  2122.               c = *fmt++;
  2123.           }
  2124.           while (c >= '0' && c <= '9') {
  2125. !             width = width * 10 + (c - '0');
  2126.               c = *fmt++;
  2127.           }
  2128.           if (c == '*') {
  2129. !             width = va_arg(ap, int);
  2130.               c = *fmt++;
  2131.           }
  2132.       reswitch:
  2133.           /* At this point, fmt points at one past the format letter. */
  2134.           switch (c) {
  2135.           case '%':
  2136. !             putc('%', curiop);
  2137.               break;
  2138.       
  2139.           case 'D':
  2140. !             putld(leftadj, width, va_arg(ap, long), 10);
  2141.               break;
  2142.       
  2143.           case 'b':
  2144. --- 138,193 ----
  2145.   va_list    ap;
  2146.   {
  2147.       register char    c;
  2148. !     struct fmt_state    prev_fmt;
  2149.   
  2150. !     prev_fmt = current_fmt;
  2151. !     current_fmt.iop = sp;
  2152.   
  2153.       while (c = *fmt++) {
  2154.           if (c != '%') {
  2155. !             putc(c, current_fmt.iop);
  2156.               continue;
  2157.           }
  2158.   
  2159. !         current_fmt.padc = ' ';
  2160. !         current_fmt.precision = current_fmt.leftadj = current_fmt.width = 0;
  2161.           c = *fmt++;
  2162.           if (c == '-') {
  2163. !             current_fmt.leftadj = YES;
  2164.               c = *fmt++;
  2165.           }
  2166.           if (c == '0') {
  2167. !             current_fmt.padc = '0';
  2168.               c = *fmt++;
  2169.           }
  2170.           while (c >= '0' && c <= '9') {
  2171. !             current_fmt.width = current_fmt.width * 10 + (c - '0');
  2172.               c = *fmt++;
  2173.           }
  2174.           if (c == '*') {
  2175. !             current_fmt.width = va_arg(ap, int);
  2176.               c = *fmt++;
  2177.           }
  2178. +         if (c == '.') {
  2179. +             c = *fmt++;
  2180. +             while (c >= '0' && c <= '9') {
  2181. +                 current_fmt.precision = current_fmt.precision * 10 + (c - '0');
  2182. +                 c = *fmt++;
  2183. +             }
  2184. +             if (c == '*') {
  2185. +                 current_fmt.precision = va_arg(ap, int);
  2186. +                 c = *fmt++;
  2187. +             }
  2188. +         }
  2189.       reswitch:
  2190.           /* At this point, fmt points at one past the format letter. */
  2191.           switch (c) {
  2192.           case '%':
  2193. !             putc('%', current_fmt.iop);
  2194.               break;
  2195.       
  2196.           case 'D':
  2197. !             putld(va_arg(ap, long), 10);
  2198.               break;
  2199.       
  2200.           case 'b':
  2201. ***************
  2202. *** 172,204 ****
  2203.               {
  2204.               Buffer    *b = va_arg(ap, Buffer *);
  2205.   
  2206. !             puts(leftadj, width, b->b_name);
  2207.               break;
  2208.               }
  2209.   
  2210.           case 'c':
  2211. !             putc(va_arg(ap, int), curiop);
  2212.               break;
  2213.       
  2214.           case 'd':
  2215. !             putld(leftadj, width, (long) va_arg(ap, int), 10);
  2216.               break;
  2217.       
  2218.           case 'f':    /* current command name gets inserted here! */
  2219. !             puts(leftadj, width, LastCmd->Name);
  2220.               break;
  2221.   
  2222.           case 'l':
  2223. !             c = Upper(*++fmt);
  2224.               goto reswitch;
  2225.       
  2226.           case 'n':
  2227.               if (va_arg(ap, int) != 1)
  2228. !                 puts(leftadj, width, "s");
  2229.               break;
  2230.   
  2231.           case 'o':
  2232. !             putld(leftadj, width, (long) va_arg(ap, int), 8);
  2233.               break;
  2234.       
  2235.           case 'p':
  2236. --- 194,226 ----
  2237.               {
  2238.               Buffer    *b = va_arg(ap, Buffer *);
  2239.   
  2240. !             puts(b->b_name);
  2241.               break;
  2242.               }
  2243.   
  2244.           case 'c':
  2245. !             putc(va_arg(ap, int), current_fmt.iop);
  2246.               break;
  2247.       
  2248.           case 'd':
  2249. !             putld((long) va_arg(ap, int), 10);
  2250.               break;
  2251.       
  2252.           case 'f':    /* current command name gets inserted here! */
  2253. !             puts(LastCmd->Name);
  2254.               break;
  2255.   
  2256.           case 'l':
  2257. !             c = CharUpcase(*++fmt);
  2258.               goto reswitch;
  2259.       
  2260.           case 'n':
  2261.               if (va_arg(ap, int) != 1)
  2262. !                 puts("s");
  2263.               break;
  2264.   
  2265.           case 'o':
  2266. !             putld((long) va_arg(ap, int), 8);
  2267.               break;
  2268.       
  2269.           case 'p':
  2270. ***************
  2271. *** 206,217 ****
  2272.                   char    cbuf[20];
  2273.   
  2274.                   PPchar(va_arg(ap, int), cbuf);
  2275. !                 puts(leftadj, width, cbuf);
  2276.                   break;
  2277.               }
  2278.   
  2279.           case 's':
  2280. !             puts(leftadj, width, va_arg(ap, char *));
  2281.               break;
  2282.           
  2283.           default:
  2284. --- 228,239 ----
  2285.                   char    cbuf[20];
  2286.   
  2287.                   PPchar(va_arg(ap, int), cbuf);
  2288. !                 puts(cbuf);
  2289.                   break;
  2290.               }
  2291.   
  2292.           case 's':
  2293. !             puts(va_arg(ap, char *));
  2294.               break;
  2295.           
  2296.           default:
  2297. ***************
  2298. *** 218,224 ****
  2299.               complain("Unknown format directive: \"%%%c\"", c);
  2300.           }
  2301.       }
  2302. !     curiop = pushiop;
  2303.   }
  2304.   
  2305.   /* VARARGS1 */
  2306. --- 240,246 ----
  2307.               complain("Unknown format directive: \"%%%c\"", c);
  2308.           }
  2309.       }
  2310. !     current_fmt = prev_fmt;
  2311.   }
  2312.   
  2313.   /* VARARGS1 */
  2314.