home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume11 / jove.pch / part03 / jove.pch.3
Text File  |  1987-09-15  |  50KB  |  2,356 lines

  1. diff -c ojove/jove.h jove/jove.h
  2. *** ojove/jove.h    Thu Jul 16 09:14:38 1987
  3. --- jove/jove.h    Fri Jul 10 09:25:51 1987
  4. ***************
  5. *** 57,71 ****
  6.   #define FORWARD        1
  7.   #define BACKWARD    -1
  8.   
  9. ! #define CTL(c)        ('c' & 037)
  10. ! #define META(c)        ('c' | 0200)
  11.   #define RUBOUT        '\177'
  12. ! #define LF        CTL(J)
  13. ! #define CR        CTL(M)
  14. ! #define BS        CTL(H)
  15.   #define ESC        '\033'
  16.   
  17. - #define DoTimes(f, n)    exp_p = YES, exp = n, f
  18.   #define HALF(wp)    ((wp->w_height - 1) / 2)
  19.   #define IsModified(b)    (b->b_modified)
  20.   #define SIZE(wp)    (wp->w_height - 1)
  21. --- 57,70 ----
  22.   #define FORWARD        1
  23.   #define BACKWARD    -1
  24.   
  25. ! #define CTL(c)        (c & 037)
  26. ! #define META(c)        (c | 0200)
  27.   #define RUBOUT        '\177'
  28. ! #define LF        CTL('J')
  29. ! #define CR        CTL('M')
  30. ! #define BS        CTL('H')
  31.   #define ESC        '\033'
  32.   
  33.   #define HALF(wp)    ((wp->w_height - 1) / 2)
  34.   #define IsModified(b)    (b->b_modified)
  35.   #define SIZE(wp)    (wp->w_height - 1)
  36. ***************
  37. *** 81,86 ****
  38. --- 80,86 ----
  39.   #define lastp(line)    (line == curbuf->b_last)
  40.   #define makedirty(line)    line->l_dline |= DIRTY
  41.   #define one_windp()    (fwind->w_next == fwind)
  42. + #define CharUpcase(c)    (CaseEquiv[c])
  43.   
  44.   extern int    OkayAbort,    /* okay to abort redisplay */
  45.           BufSize;
  46. ***************
  47. *** 121,126 ****
  48. --- 121,127 ----
  49.   #define SetMajor(x)    ((curbuf->b_major = x), UpdModLine++)
  50.   
  51.   extern char    CharTable[NMAJORS][128];
  52. + extern char    CaseEquiv[128];
  53.   
  54.   /* setjmp/longjmp args for DoKeys() mainjmp */
  55.   #define FIRSTCALL    0
  56. ***************
  57. *** 192,213 ****
  58.       Process    *p_next;
  59.   #ifdef PIPEPROCS
  60.       int    p_toproc,    /* read p_fromproc and write p_toproc */
  61. !         p_portpid,    /* Pid of child (the portsrv) */
  62. !         p_pid;        /* Pid of real child i.e. not portsrv */
  63.   #else
  64. !     int    p_fd,        /* File descriptor of ptyp? opened r/w */
  65.           p_pid;        /* pid of child (the shell) */
  66.   #endif
  67. !     Buffer    *p_buffer;    /* Add output to end of this buffer */
  68.       char    *p_name;    /* ... */
  69.       char    p_state,    /* State */
  70.           p_howdied,    /* Killed? or Exited? */
  71. !         p_reason,    /* If signaled, p_reason is the signal; else
  72.                      it is the the exit code */
  73. !         p_eof;        /* Received EOF, so can be free'd up */
  74. !     Mark    *p_mark;    /* Where output left us. */
  75.       data_obj
  76. !         *p_cmd;        /* Command to call when process dies */
  77.   };
  78.   #endif IPROCS
  79.   
  80. --- 193,213 ----
  81.       Process    *p_next;
  82.   #ifdef PIPEPROCS
  83.       int    p_toproc,    /* read p_fromproc and write p_toproc */
  84. !         p_portpid,    /* pid of child (the portsrv) */
  85. !         p_pid;        /* pid of real child i.e. not portsrv */
  86.   #else
  87. !     int    p_fd,        /* file descriptor of pty? opened r/w */
  88.           p_pid;        /* pid of child (the shell) */
  89.   #endif
  90. !     Buffer    *p_buffer;    /* add output to end of this buffer */
  91.       char    *p_name;    /* ... */
  92.       char    p_state,    /* State */
  93.           p_howdied,    /* Killed? or Exited? */
  94. !         p_reason;    /* If signaled, p_reason is the signal; else
  95.                      it is the the exit code */
  96. !     Mark    *p_mark;    /* where output left us */
  97.       data_obj
  98. !         *p_cmd;        /* command to call when process dies */
  99.   };
  100.   #endif IPROCS
  101.   
  102. ***************
  103. *** 242,249 ****
  104.       Line    *m_line;
  105.       int    m_char;
  106.       Mark    *m_next;    /* list of marks */
  107. ! #define FLOATER    1
  108. !     char    m_floater;    /* FLOATERing mark? */
  109.   };
  110.   
  111.   struct buffer {
  112. --- 242,251 ----
  113.       Line    *m_line;
  114.       int    m_char;
  115.       Mark    *m_next;    /* list of marks */
  116. ! #define M_FIXED        00
  117. ! #define M_FLOATER    01
  118. ! #define M_BIG_DELETE    02
  119. !     char    m_flags;    /* FLOATERing mark? */
  120.   };
  121.   
  122.   struct buffer {
  123. ***************
  124. *** 380,387 ****
  125.       ScrollStep,        /* how should we scroll */
  126.       WtOnMk,            /* write files on compile-it command */
  127.       EndWNewline,        /* end files with a blank line */
  128. !     MarkThresh,        /* moves greater than MarkThresh
  129. !                    will SetMark */
  130.       PDelay,            /* paren flash delay in tenths of a second */
  131.       CIndIncrmt,        /* how much each indentation level pushes
  132.                      over in C mode */
  133. --- 382,388 ----
  134.       ScrollStep,        /* how should we scroll */
  135.       WtOnMk,            /* write files on compile-it command */
  136.       EndWNewline,        /* end files with a blank line */
  137. !     MarkThresh,        /* moves greater than MarkThresh will SetMark */
  138.       PDelay,            /* paren flash delay in tenths of a second */
  139.       CIndIncrmt,        /* how much each indentation level pushes
  140.                      over in C mode */
  141. ***************
  142. *** 408,413 ****
  143. --- 409,415 ----
  144.       SExitChar,        /* type this to stop i-search */
  145.   #endif
  146.       IntChar,        /* ttysets this to generate QUIT */
  147. +     DoEVexpand,        /* treat $foo as environment variable */
  148.       EWSize;            /* size to make the error window */
  149.   
  150.   extern char
  151. ***************
  152. *** 427,435 ****
  153.       Shell[128];        /* shell to use */
  154.   
  155.   extern int
  156. -     exp,        /* argument count */
  157. -     exp_p,        /* argument count is supplied */
  158.       TOabort,    /* flag set by Typeout() */
  159.       io,        /* file descriptor for reading and writing files */
  160.       errormsg,    /* last message was an error message
  161. --- 429,434 ----
  162. ***************
  163. *** 539,544 ****
  164. --- 538,546 ----
  165.       *tgoto(),
  166.       *pr_name(),
  167.       *sprint(),
  168. + #ifdef IPROCS
  169. +     *pstate(),
  170. + #endif
  171.       *StrIndex();
  172.   
  173.   extern Bufpos
  174. diff -c ojove/keymaps.txt jove/keymaps.txt
  175. *** ojove/keymaps.txt    Thu Jul 16 09:14:39 1987
  176. --- jove/keymaps.txt    Thu Jun 11 15:43:50 1987
  177. ***************
  178. *** 34,40 ****
  179.       "search-reverse",        /* ^R */
  180.       "search-forward",        /* ^S */
  181.       "transpose-characters",        /* ^T */
  182. !     "quadruple-numeric-argument",    /* ^U */
  183.       "next-page",            /* ^V */
  184.       "kill-region",            /* ^W */
  185.       "prefix-2",            /* ^X */
  186. --- 34,40 ----
  187.       "search-reverse",        /* ^R */
  188.       "search-forward",        /* ^S */
  189.       "transpose-characters",        /* ^T */
  190. !     "gather-numeric-argument",    /* ^U */
  191.       "next-page",            /* ^V */
  192.       "kill-region",            /* ^W */
  193.       "prefix-2",            /* ^X */
  194. diff -c ojove/macros.c jove/macros.c
  195. *** ojove/macros.c    Thu Jul 16 09:14:41 1987
  196. --- jove/macros.c    Fri Jun 19 16:01:00 1987
  197. ***************
  198. *** 8,14 ****
  199.   #include "jove.h"
  200.   
  201.   struct macro    *macros = 0;        /* Macros */
  202. - data_obj    *LastCmd;
  203.   
  204.   private
  205.   add_mac(new)
  206. --- 8,13 ----
  207. ***************
  208. *** 84,90 ****
  209.           complain("[Too many macros at once!]");
  210.       macstack[stackp] = mac;
  211.       mac->m_offset = 0;
  212. !     mac->m_ntimes = exp;
  213.       mac->m_flags |= EXECUTE;
  214.   }
  215.   
  216. --- 83,89 ----
  217.           complain("[Too many macros at once!]");
  218.       macstack[stackp] = mac;
  219.       mac->m_offset = 0;
  220. !     mac->m_ntimes = arg_value();
  221.       mac->m_flags |= EXECUTE;
  222.   }
  223.   
  224. ***************
  225. *** 362,368 ****
  226.           if (!InJoverc) {
  227.               TOstart("Warning", TRUE);
  228.               Typeout("Warning: your macros file is in the old format.");
  229. !             Typeout("Do you want me to convert \"%s\" to the new", pr_name(file));
  230.               Typeout("format?");
  231.               f_mess(msg);
  232.               TOstop();
  233. --- 361,367 ----
  234.           if (!InJoverc) {
  235.               TOstart("Warning", TRUE);
  236.               Typeout("Warning: your macros file is in the old format.");
  237. !             Typeout("Do you want me to convert \"%s\" to the new", pr_name(file, YES));
  238.               Typeout("format?");
  239.               f_mess(msg);
  240.               TOstop();
  241. diff -c ojove/marks.c jove/marks.c
  242. *** ojove/marks.c    Thu Jul 16 09:14:42 1987
  243. --- jove/marks.c    Wed Jun 24 13:22:48 1987
  244. ***************
  245. *** 17,23 ****
  246.   
  247.       MarkSet(newmark, line, column);
  248.       newmark->m_next = curbuf->b_marks;
  249. !     newmark->m_floater = type;
  250.       curbuf->b_marks = newmark;
  251.       return newmark;
  252.   }
  253. --- 17,23 ----
  254.   
  255.       MarkSet(newmark, line, column);
  256.       newmark->m_next = curbuf->b_marks;
  257. !     newmark->m_flags = type;
  258.       curbuf->b_marks = newmark;
  259.       return newmark;
  260.   }
  261. ***************
  262. *** 70,76 ****
  263.                   pmark = NMARKS - 1;
  264.           } while (curbuf->b_markring[pmark] != 0);
  265.   
  266. !         curbuf->b_markring[pmark] = MakeMark(curline, curchar, MarksShouldFloat);
  267.           ToMark(curmark);
  268.           DelMark(curmark);
  269.           curmark = 0;
  270. --- 70,76 ----
  271.                   pmark = NMARKS - 1;
  272.           } while (curbuf->b_markring[pmark] != 0);
  273.   
  274. !         curbuf->b_markring[pmark] = MakeMark(curline, curchar, MarksShouldFloat ? M_FLOATER : M_FIXED);
  275.           ToMark(curmark);
  276.           DelMark(curmark);
  277.           curmark = 0;
  278. ***************
  279. *** 85,102 ****
  280.   
  281.   SetMark()
  282.   {
  283. !     if (exp_p)
  284.           PopMark();
  285.       else
  286. !         DoSetMark(curline, curchar);
  287.   }
  288.   
  289. ! DoSetMark(l, c)
  290.   Line    *l;
  291.   {
  292.       curbuf->b_themark = (curbuf->b_themark + 1) % NMARKS;
  293.       if (curmark == 0)
  294. !         curmark = MakeMark(l, c, MarksShouldFloat);
  295.       else
  296.           MarkSet(curmark, l, c);
  297.       s_mess("[Point pushed]");
  298. --- 85,107 ----
  299.   
  300.   SetMark()
  301.   {
  302. !     if (is_an_arg())
  303.           PopMark();
  304.       else
  305. !         set_mark();
  306.   }
  307.   
  308. ! set_mark()
  309. ! {
  310. !     do_set_mark(curline, curchar);
  311. ! }
  312. ! do_set_mark(l, c)
  313.   Line    *l;
  314.   {
  315.       curbuf->b_themark = (curbuf->b_themark + 1) % NMARKS;
  316.       if (curmark == 0)
  317. !         curmark = MakeMark(l, c, MarksShouldFloat ? M_FLOATER : M_FIXED);
  318.       else
  319.           MarkSet(curmark, l, c);
  320.       s_mess("[Point pushed]");
  321. ***************
  322. *** 151,167 ****
  323.       if (curbuf->b_marks == 0)
  324.           return;
  325.       while (lp != line2->l_next) {
  326. !         for (m = curbuf->b_marks; m != 0; m = m->m_next) {
  327. ! /*            if (!m->m_floater)
  328. !                 continue; */
  329.               if (m->m_line == lp)
  330.                   m->m_char |= (1 << 15);
  331. -         }
  332.           lp = lp->l_next;
  333.       }
  334.       for (m = curbuf->b_marks; m; m = m->m_next) {
  335. - /*        if (!m->m_floater)
  336. -             continue; */
  337.           if ((m->m_char & (1 << 15)) == 0)
  338.               continue;    /* Not effected */
  339.           m->m_char &= ~(1 << 15);
  340. --- 156,167 ----
  341.       if (curbuf->b_marks == 0)
  342.           return;
  343.       while (lp != line2->l_next) {
  344. !         for (m = curbuf->b_marks; m != 0; m = m->m_next)
  345.               if (m->m_line == lp)
  346.                   m->m_char |= (1 << 15);
  347.           lp = lp->l_next;
  348.       }
  349.       for (m = curbuf->b_marks; m; m = m->m_next) {
  350.           if ((m->m_char & (1 << 15)) == 0)
  351.               continue;    /* Not effected */
  352.           m->m_char &= ~(1 << 15);
  353. ***************
  354. *** 178,187 ****
  355. --- 178,189 ----
  356.                   m->m_char = char1 + (m->m_char - char2);
  357.               else
  358.                   m->m_char = char1;
  359. +             m->m_flags |= M_BIG_DELETE;
  360.               m->m_line = line1;
  361.           } else {
  362.               m->m_char = char1;
  363.               m->m_line = line1;
  364. +             m->m_flags |= M_BIG_DELETE;
  365.           }
  366.       }
  367.   }
  368. ***************
  369. *** 196,202 ****
  370.       register Mark    *m;
  371.   
  372.       for (m = curbuf->b_marks; m != 0; m = m->m_next) {
  373. !         if (!m->m_floater)
  374.               continue;
  375.           if (m->m_line == line1) {
  376.               if (m->m_char > char1) {
  377. --- 198,204 ----
  378.       register Mark    *m;
  379.   
  380.       for (m = curbuf->b_marks; m != 0; m = m->m_next) {
  381. !         if ((m->m_flags & M_FLOATER) == 0)
  382.               continue;
  383.           if (m->m_line == line1) {
  384.               if (m->m_char > char1) {
  385. diff -c ojove/misc.c jove/misc.c
  386. *** ojove/misc.c    Thu Jul 16 09:14:43 1987
  387. --- jove/misc.c    Fri Jul 10 09:25:50 1987
  388. ***************
  389. *** 12,161 ****
  390.   #include "termcap.h"
  391.   #endif
  392.   
  393. - Digit()
  394. - {
  395. -     GetExp(LastKeyStruck);
  396. - }
  397. - Digit0()
  398. - {
  399. -     GetExp('0');
  400. - }
  401. - Digit1()
  402. - {
  403. -     GetExp('1');
  404. - }
  405. - Digit2()
  406. - {
  407. -     GetExp('2');
  408. - }
  409. - Digit3()
  410. - {
  411. -     GetExp('3');
  412. - }
  413. - Digit4()
  414. - {
  415. -     GetExp('4');
  416. - }
  417. - Digit5()
  418. - {
  419. -     GetExp('5');
  420. - }
  421. - Digit6()
  422. - {
  423. -     GetExp('6');
  424. - }
  425. - Digit7()
  426. - {
  427. -     GetExp('7');
  428. - }
  429. - Digit8()
  430. - {
  431. -     GetExp('8');
  432. - }
  433. - Digit9()
  434. - {
  435. -     GetExp('9');
  436. - }
  437.   prCTIME()
  438.   {
  439.       s_mess(": %f %s", get_time((time_t *) 0, (char *) 0, 0, -1));
  440.   }
  441.   
  442. - extern int    alarmed;
  443. - FourTime()
  444. - {
  445. -     int    oldc = LastKeyStruck,
  446. -         newc;
  447. -     int    nexp;
  448. -     alarmed = 0;
  449. -     exp_p = YES;
  450. -     this_cmd = ARG_CMD;
  451. -     do {
  452. -         if ((nexp = exp * 4) != 0)
  453. -             exp = nexp;
  454. -         if (!alarmed)
  455. -             newc = waitchar();
  456. -         else
  457. -             newc = getch();
  458. -         if (alarmed)
  459. -             message(key_strokes);
  460. -     } while (newc == oldc);
  461. -     Ungetc(newc);
  462. - }
  463. - int    exp_p,
  464. -     exp;
  465. - GetExp(c)
  466. - {
  467. -     int    sign = 0;
  468. -     static int    digited;
  469. -     if (!isdigit(c) && c != '-')
  470. -         complain((char *) 0);
  471. -     if (exp_p == NO) {    /* if we just got here */
  472. -         exp = 0;    /* start over */
  473. -         digited = NO;
  474. -     } else if (exp_p == YES_NODIGIT) {
  475. -         sign = (exp < 0) ? -1 : 1;
  476. -         exp = 0;
  477. -     }
  478. -     if (!sign)
  479. -         sign = (exp < 0) ? -1 : 1;
  480. -     if (sign == -1)
  481. -         exp = -exp;
  482. -     if (c == '-') {
  483. -         sign = -sign;
  484. -         goto goread;
  485. -     }
  486. -     for (;;) {
  487. -         if (alarmed)
  488. -             message(key_strokes);
  489. -         if (isdigit(c)) {
  490. -             exp = (exp * 10) + (c - '0');
  491. -             digited++;
  492. -         } else {
  493. -             if (digited)
  494. -                 exp_p = YES;
  495. -             else {
  496. -                 exp = 1;
  497. -                 if (exp_p == NO)
  498. -                     exp_p = YES_NODIGIT;
  499. -             }
  500. -             exp *= sign;
  501. -             this_cmd = ARG_CMD;
  502. -             Ungetc(c);
  503. -             return;
  504. -         }
  505. - goread:        if (!alarmed)
  506. -             c = waitchar();
  507. -         else {
  508. -             add_mess(NullStr);
  509. -             c = getch();
  510. -         }
  511. -     }
  512. - }
  513.   ChrToOct()
  514.   {
  515. !     int    c;
  516.   
  517. !     c = waitchar();
  518. !     if (alarmed)
  519.           message(key_strokes);
  520.       ins_str(sprint("\\%03o", c), NO);
  521.   }
  522. --- 12,29 ----
  523.   #include "termcap.h"
  524.   #endif
  525.   
  526.   prCTIME()
  527.   {
  528.       s_mess(": %f %s", get_time((time_t *) 0, (char *) 0, 0, -1));
  529.   }
  530.   
  531.   ChrToOct()
  532.   {
  533. !     int    c,
  534. !         slow;
  535.   
  536. !     c = waitchar(&slow);
  537. !     if (slow)
  538.           message(key_strokes);
  539.       ins_str(sprint("\\%03o", c), NO);
  540.   }
  541. ***************
  542. *** 197,209 ****
  543.   
  544.       if (curchar == 0 || (eolp() && curchar == 1))
  545.           complain((char *) 0);    /* BEEP */
  546. -     exp = 1;
  547.       if (eolp())
  548. !         BackChar();
  549.       before = linebuf[curchar - 1];
  550. !     DelPChar();
  551. !     ForChar();
  552. !     Insert(before);
  553.   }
  554.   
  555.   /* Switch current line with previous one */
  556. --- 65,76 ----
  557.   
  558.       if (curchar == 0 || (eolp() && curchar == 1))
  559.           complain((char *) 0);    /* BEEP */
  560.       if (eolp())
  561. !         b_char(1);
  562.       before = linebuf[curchar - 1];
  563. !     del_char(BACKWARD, 1);
  564. !     f_char(1);
  565. !     insert_c(before, 1);
  566.   }
  567.   
  568.   /* Switch current line with previous one */
  569. ***************
  570. *** 214,220 ****
  571.   
  572.       if (firstp(curline))
  573.           return;
  574. -     exp = 1;
  575.       lsave();
  576.       old_prev = curline->l_prev->l_dline;
  577.       curline->l_prev->l_dline = curline->l_dline;
  578. --- 81,86 ----
  579. ***************
  580. *** 221,227 ****
  581.       curline->l_dline = old_prev;
  582.       getDOT();
  583.       if (!lastp(curline))
  584. !         line_move(FORWARD, NO);
  585.       modify();
  586.   }
  587.   
  588. --- 87,93 ----
  589.       curline->l_dline = old_prev;
  590.       getDOT();
  591.       if (!lastp(curline))
  592. !         line_move(FORWARD, 1, NO);
  593.       modify();
  594.   }
  595.   
  596. ***************
  597. *** 239,252 ****
  598.   {
  599.       Line    *line2;
  600.       int    char2;
  601.   
  602. !     if (exp_p) {
  603. !         if (exp == 0) {    /* Kill to beginning of line */
  604.               line2 = curline;
  605.               char2 = 0;
  606.           } else {
  607. !             line2 = next_line(curline, exp);
  608. !             if ((LineDist(curline, line2) < exp) || (line2 == curline))
  609.                   char2 = length(line2);
  610.               else
  611.                   char2 = 0;
  612. --- 105,119 ----
  613.   {
  614.       Line    *line2;
  615.       int    char2;
  616. +     int    num = arg_value();
  617.   
  618. !     if (is_an_arg()) {
  619. !         if (num == 0) {    /* Kill to beginning of line */
  620.               line2 = curline;
  621.               char2 = 0;
  622.           } else {
  623. !             line2 = next_line(curline, num);
  624. !             if ((LineDist(curline, line2) < num) || (line2 == curline))
  625.                   char2 = length(line2);
  626.               else
  627.                   char2 = 0;
  628. ***************
  629. *** 264,274 ****
  630.       reg_kill(line2, char2, 0);
  631.   }
  632.   
  633. ! /* Kill to beginning of sentence */
  634.   
  635.   KillBos()
  636.   {
  637. !     exp = -exp;
  638.       KillEos();
  639.   }
  640.   
  641. --- 131,141 ----
  642.       reg_kill(line2, char2, 0);
  643.   }
  644.   
  645. ! /* kill to beginning of sentence */
  646.   
  647.   KillBos()
  648.   {
  649. !     negate_arg_value();
  650.       KillEos();
  651.   }
  652.   
  653. ***************
  654. *** 316,330 ****
  655.   {
  656.       register data_obj    *cp;
  657.       register int    c;
  658.   
  659. !     c = waitchar();
  660. !     if (c == CTL(G)) {
  661.           message("[Aborted]");
  662.           rbell();
  663.           return;
  664.       }
  665.   
  666. !     if (alarmed)
  667.           message(key_strokes);
  668.   
  669.       cp = map[c];
  670. --- 183,198 ----
  671.   {
  672.       register data_obj    *cp;
  673.       register int    c;
  674. +     int    slow;
  675.   
  676. !     c = waitchar(&slow);
  677. !     if (c == CTL('G')) {
  678.           message("[Aborted]");
  679.           rbell();
  680.           return;
  681.       }
  682.   
  683. !     if (slow)
  684.           message(key_strokes);
  685.   
  686.       cp = map[c];
  687. ***************
  688. *** 348,354 ****
  689.       line = killbuf[killptr];
  690.       lp = lastline(line);
  691.       dot = DoYank(line, 0, lp, length(lp), curline, curchar, curbuf);
  692. !     SetMark();
  693.       SetDot(dot);
  694.   }
  695.   
  696. --- 216,222 ----
  697.       line = killbuf[killptr];
  698.       lp = lastline(line);
  699.       dot = DoYank(line, 0, lp, length(lp), curline, curchar, curbuf);
  700. !     set_mark();
  701.       SetDot(dot);
  702.   }
  703.   
  704. ***************
  705. *** 357,363 ****
  706.       if (!ModBufs(NO))
  707.           message("[No buffers need saving]");
  708.       else
  709. !         put_bufs(exp_p);
  710.   }
  711.   
  712.   put_bufs(askp)
  713. --- 225,231 ----
  714.       if (!ModBufs(NO))
  715.           message("[No buffers need saving]");
  716.       else
  717. !         put_bufs(is_an_arg());
  718.   }
  719.   
  720.   put_bufs(askp)
  721. ***************
  722. *** 403,418 ****
  723.       Line    *newline;
  724.   
  725.   #ifndef ANSICODES
  726. !     if (exp_p == NO)
  727.           return;
  728.   #else
  729. !     if (exp_p == NO || exp <= 0) {
  730.           if (SP)
  731.               putpad(SP, 1);    /* Ask for cursor position */
  732.           return;
  733.       }
  734.   #endif
  735. !     newline = next_line(curbuf->b_first, exp - 1);
  736.       PushPntp(newline);
  737.       SetLine(newline);
  738.   }
  739. --- 271,286 ----
  740.       Line    *newline;
  741.   
  742.   #ifndef ANSICODES
  743. !     if (!is_an_arg())
  744.           return;
  745.   #else
  746. !     if (!is_an_arg() || arg_value() <= 0) {
  747.           if (SP)
  748.               putpad(SP, 1);    /* Ask for cursor position */
  749.           return;
  750.       }
  751.   #endif
  752. !     newline = next_line(curbuf->b_first, arg_value() - 1);
  753.       PushPntp(newline);
  754.       SetLine(newline);
  755.   }
  756. ***************
  757. *** 440,452 ****
  758.       static char *unsupported = "[Unsupported ANSI code received]";
  759.   
  760.       while (isdigit(c = getch()))
  761. !         num1 = (num1*10) + (c - '0');
  762.   
  763.       switch (c) {
  764.       case ';':
  765.           num2 = 0;
  766.           while (isdigit(c = getch()))
  767. !             num2 = (num2*10) + (c - '0');
  768.           switch (c) {
  769.           case 'R':
  770.               MoveToCursor(--num1, --num2);
  771. --- 308,320 ----
  772.       static char *unsupported = "[Unsupported ANSI code received]";
  773.   
  774.       while (isdigit(c = getch()))
  775. !         num1 = (num1 * 10) + (c - '0');
  776.   
  777.       switch (c) {
  778.       case ';':
  779.           num2 = 0;
  780.           while (isdigit(c = getch()))
  781. !             num2 = (num2 * 10) + (c - '0');
  782.           switch (c) {
  783.           case 'R':
  784.               MoveToCursor(--num1, --num2);
  785. ***************
  786. *** 459,468 ****
  787.           }
  788.           break;
  789.       case 'A':
  790. !         line_move(BACKWARD, YES);
  791.           break;
  792.       case 'B':
  793. !         line_move(FORWARD, YES);
  794.           break;
  795.       case 'C':
  796.           ForChar();
  797. --- 327,336 ----
  798.           }
  799.           break;
  800.       case 'A':
  801. !         PrevLine();
  802.           break;
  803.       case 'B':
  804. !         NextLine();
  805.           break;
  806.       case 'C':
  807.           ForChar();
  808. ***************
  809. *** 479,484 ****
  810. --- 347,369 ----
  811.               break;
  812.           }
  813.           /* FALL THROUGH */
  814. +     case 'P':
  815. +         PrevPage();
  816. +         break;
  817. +     case 'Q':
  818. +         NextPage();
  819. +         break;
  820. +     case 'R':
  821. +         UpScroll();
  822. +         break;
  823. +     case 'S':
  824. +         DownScroll();
  825. +         break;
  826.       default:
  827.           complain(unsupported);
  828.       }
  829. diff -c ojove/move.c jove/move.c
  830. *** ojove/move.c    Thu Jul 16 09:14:44 1987
  831. --- jove/move.c    Fri Jun 12 11:53:33 1987
  832. ***************
  833. *** 10,26 ****
  834.   
  835.   static int    line_pos;
  836.   
  837. ! ForChar()
  838.   {
  839. -     register int    num = exp;
  840.   
  841. !     if (exp < 0) {
  842. !         exp = -exp;
  843. !         BackChar();
  844.           return;
  845.       }
  846. !     exp = 1;
  847. !     while (--num >= 0) {
  848.           if (eolp()) {            /* Go to the next Line */
  849.               if (curline->l_next == 0)
  850.                   break;
  851. --- 10,24 ----
  852.   
  853.   static int    line_pos;
  854.   
  855. ! f_char(n)
  856. ! register int    n;
  857.   {
  858.   
  859. !     if (n < 0) {
  860. !         b_char(-n);
  861.           return;
  862.       }
  863. !     while (--n >= 0) {
  864.           if (eolp()) {            /* Go to the next Line */
  865.               if (curline->l_next == 0)
  866.                   break;
  867. ***************
  868. *** 30,46 ****
  869.       }
  870.   }
  871.   
  872. ! BackChar()
  873.   {
  874. -     register int    num = exp;
  875.   
  876. !     if (exp < 0) {
  877. !         exp = -exp;
  878. !         ForChar();
  879.           return;
  880.       }
  881. !     exp = 1;
  882. !     while (--num >= 0) {
  883.           if (bolp()) {
  884.               if (curline->l_prev == 0)
  885.                   break;
  886. --- 28,42 ----
  887.       }
  888.   }
  889.   
  890. ! b_char(n)
  891. ! register int    n;
  892.   {
  893.   
  894. !     if (n < 0) {
  895. !         f_char(-n);
  896.           return;
  897.       }
  898. !     while (--n >= 0) {
  899.           if (bolp()) {
  900.               if (curline->l_prev == 0)
  901.                   break;
  902. ***************
  903. *** 51,61 ****
  904.       }
  905.   }
  906.   
  907.   NextLine()
  908.   {
  909.       if ((curline == curbuf->b_last) && eolp())
  910.           complain(NullStr);
  911. !     line_move(FORWARD, YES);
  912.   }
  913.   
  914.   PrevLine()
  915. --- 47,67 ----
  916.       }
  917.   }
  918.   
  919. + ForChar()
  920. + {
  921. +     f_char(arg_value());
  922. + }
  923. + BackChar()
  924. + {
  925. +     b_char(arg_value());
  926. + }
  927.   NextLine()
  928.   {
  929.       if ((curline == curbuf->b_last) && eolp())
  930.           complain(NullStr);
  931. !     line_move(FORWARD, arg_value(), YES);
  932.   }
  933.   
  934.   PrevLine()
  935. ***************
  936. *** 62,68 ****
  937.   {
  938.       if ((curline == curbuf->b_first) && bolp())
  939.           complain(NullStr);
  940. !     line_move(BACKWARD, YES);
  941.   }
  942.   
  943.   /* moves to a different line in DIR; LINE_CMD says whether this is
  944. --- 68,74 ----
  945.   {
  946.       if ((curline == curbuf->b_first) && bolp())
  947.           complain(NullStr);
  948. !     line_move(BACKWARD, arg_value(), YES);
  949.   }
  950.   
  951.   /* moves to a different line in DIR; LINE_CMD says whether this is
  952. ***************
  953. *** 69,80 ****
  954.      being called from NextLine() or PrevLine(), in which case it tries
  955.      to line up the column with the column of the current line */
  956.   
  957. ! line_move(dir, line_cmd)
  958.   {
  959.       Line    *(*proc)() = (dir == FORWARD) ? next_line : prev_line;
  960.       Line    *line;
  961.   
  962. !     line = (*proc)(curline, exp);
  963.       if (line == curline) {
  964.           (dir == FORWARD) ? Eol() : Bol();
  965.           return;
  966. --- 75,86 ----
  967.      being called from NextLine() or PrevLine(), in which case it tries
  968.      to line up the column with the column of the current line */
  969.   
  970. ! line_move(dir, n, line_cmd)
  971.   {
  972.       Line    *(*proc)() = (dir == FORWARD) ? next_line : prev_line;
  973.       Line    *line;
  974.   
  975. !     line = (*proc)(curline, n);
  976.       if (line == curline) {
  977.           (dir == FORWARD) ? Eol() : Bol();
  978.           return;
  979. ***************
  980. *** 142,147 ****
  981. --- 148,154 ----
  982.      with all the kludgery involved with paragraphs, and moving backwards
  983.      is particularly yucky. */
  984.   
  985. + private
  986.   to_sent(dir)
  987.   {
  988.       Bufpos    *new,
  989. ***************
  990. *** 152,158 ****
  991.   
  992.       new = dosearch("^[ \t]*$\\|[?.!]", dir, 1);
  993.       if (new == 0) {
  994. !         (dir < 0) ? ToFirst() : ToLast();
  995.           return;
  996.       }
  997.       SetDot(new);
  998. --- 159,165 ----
  999.   
  1000.       new = dosearch("^[ \t]*$\\|[?.!]", dir, 1);
  1001.       if (new == 0) {
  1002. !         (dir == BACKWARD) ? ToFirst() : ToLast();
  1003.           return;
  1004.       }
  1005.       SetDot(new);
  1006. ***************
  1007. *** 168,174 ****
  1008.       }
  1009.       if (blnkp(linebuf)) {
  1010.           Bol();
  1011. !         BackChar();
  1012.           if (old.p_line == curline && old.p_char >= curchar) {
  1013.               to_word(1);    /* Oh brother this is painful */
  1014.               to_sent(1);
  1015. --- 175,181 ----
  1016.       }
  1017.       if (blnkp(linebuf)) {
  1018.           Bol();
  1019. !         b_char(1);
  1020.           if (old.p_line == curline && old.p_char >= curchar) {
  1021.               to_word(1);    /* Oh brother this is painful */
  1022.               to_sent(1);
  1023. ***************
  1024. *** 186,201 ****
  1025.   
  1026.   Bos()
  1027.   {
  1028. !     int    num = exp;
  1029.   
  1030. !     if (exp < 0) {
  1031. !         exp = -exp;
  1032.           Eos();
  1033.           return;
  1034.       }
  1035.   
  1036. -     exp = 1;
  1037.       while (--num >= 0) {
  1038.           to_sent(-1);
  1039.           if (bobp())
  1040. --- 193,206 ----
  1041.   
  1042.   Bos()
  1043.   {
  1044. !     register int    num = arg_value();
  1045.   
  1046. !     if (num < 0) {
  1047. !         negate_arg_value();
  1048.           Eos();
  1049.           return;
  1050.       }
  1051.   
  1052.       while (--num >= 0) {
  1053.           to_sent(-1);
  1054.           if (bobp())
  1055. ***************
  1056. *** 205,220 ****
  1057.   
  1058.   Eos()
  1059.   {
  1060. !     int    num = exp;
  1061.   
  1062. !     if (exp < 0) {
  1063. !         exp = -exp;
  1064.           Bos();
  1065.           return;
  1066.       }
  1067.   
  1068. -     exp = 1;
  1069.       while (--num >= 0) {
  1070.           to_sent(1);
  1071.           if (eobp())
  1072. --- 210,223 ----
  1073.   
  1074.   Eos()
  1075.   {
  1076. !     register int    num = arg_value();
  1077.   
  1078. !     if (num < 0) {
  1079. !         negate_arg_value();
  1080.           Bos();
  1081.           return;
  1082.       }
  1083.   
  1084.       while (--num >= 0) {
  1085.           to_sent(1);
  1086.           if (eobp())
  1087. ***************
  1088. *** 222,240 ****
  1089.       }
  1090.   }
  1091.   
  1092. ! ForWord()
  1093.   {
  1094.       register char    c;
  1095. -     register int    num = exp;
  1096.   
  1097. !     if (exp < 0) {
  1098. !         exp = -exp;
  1099. !         BackWord();
  1100.           return;
  1101.       }
  1102. -     exp = 1;
  1103.       while (--num >= 0) {
  1104. !         to_word(1);
  1105.           while ((c = linebuf[curchar]) != 0 && isword(c))
  1106.               curchar++;
  1107.           if (eobp())
  1108. --- 225,241 ----
  1109.       }
  1110.   }
  1111.   
  1112. ! f_word(num)
  1113. ! register int    num;
  1114.   {
  1115.       register char    c;
  1116.   
  1117. !     if (num < 0) {
  1118. !         b_word(-num);
  1119.           return;
  1120.       }
  1121.       while (--num >= 0) {
  1122. !         to_word(FORWARD);
  1123.           while ((c = linebuf[curchar]) != 0 && isword(c))
  1124.               curchar++;
  1125.           if (eobp())
  1126. ***************
  1127. *** 243,261 ****
  1128.       this_cmd = 0;    /* Semi kludge to stop some unfavorable behavior */
  1129.   }
  1130.   
  1131. ! BackWord()
  1132.   {
  1133. -     register int    num = exp;
  1134.       register char    c;
  1135.   
  1136. !     if (exp < 0) {
  1137. !         exp = -exp;
  1138. !         ForWord();
  1139.           return;
  1140.       }
  1141. -     exp = 1;
  1142.       while (--num >= 0) {
  1143. !         to_word(-1);
  1144.           while (!bolp() && (c = linebuf[curchar - 1], isword(c)))
  1145.               --curchar;
  1146.           if (bobp())
  1147. --- 244,260 ----
  1148.       this_cmd = 0;    /* Semi kludge to stop some unfavorable behavior */
  1149.   }
  1150.   
  1151. ! b_word(num)
  1152. ! register int    num;
  1153.   {
  1154.       register char    c;
  1155.   
  1156. !     if (num < 0) {
  1157. !         f_word(-num);
  1158.           return;
  1159.       }
  1160.       while (--num >= 0) {
  1161. !         to_word(BACKWARD);
  1162.           while (!bolp() && (c = linebuf[curchar - 1], isword(c)))
  1163.               --curchar;
  1164.           if (bobp())
  1165. ***************
  1166. *** 263,265 ****
  1167. --- 262,275 ----
  1168.       }
  1169.       this_cmd = 0;
  1170.   }
  1171. + ForWord()
  1172. + {
  1173. +     f_word(arg_value());
  1174. + }
  1175. + BackWord()
  1176. + {
  1177. +     b_word(arg_value());
  1178. + }
  1179. diff -c ojove/paragraph.c jove/paragraph.c
  1180. *** ojove/paragraph.c    Thu Jul 16 09:14:45 1987
  1181. --- jove/paragraph.c    Wed Jun 24 12:43:24 1987
  1182. ***************
  1183. *** 204,210 ****
  1184.       int    this_indent;
  1185.       Bufpos    orig;        /* remember where we were when we started */
  1186.   
  1187. -     exp = 1;
  1188.       DOTsave(&orig);
  1189.   strt:
  1190.       this = curline;
  1191. --- 204,209 ----
  1192. ***************
  1193. *** 218,224 ****
  1194.                   if (firstp(curline))
  1195.                       complain((char *) 0);
  1196.                   else
  1197. !                     line_move(BACKWARD, NO);
  1198.               goto strt;
  1199.           } else {
  1200.               while (i_blank(curline))
  1201. --- 217,223 ----
  1202.                   if (firstp(curline))
  1203.                       complain((char *) 0);
  1204.                   else
  1205. !                     line_move(BACKWARD, 1, NO);
  1206.               goto strt;
  1207.           } else {
  1208.               while (i_blank(curline))
  1209. ***************
  1210. *** 225,231 ****
  1211.                   if (lastp(curline))
  1212.                       complain((char *) 0);
  1213.                   else
  1214. !                     line_move(FORWARD, NO);
  1215.               head = curline;
  1216.               next = curline->l_next;
  1217.               if (!i_bsblank(next))
  1218. --- 224,230 ----
  1219.                   if (lastp(curline))
  1220.                       complain((char *) 0);
  1221.                   else
  1222. !                     line_move(FORWARD, 1, NO);
  1223.               head = curline;
  1224.               next = curline->l_next;
  1225.               if (!i_bsblank(next))
  1226. ***************
  1227. *** 302,308 ****
  1228.   
  1229.   Justify()
  1230.   {
  1231. !     use_lmargin = (exp_p != NO);
  1232.       find_para(BACKWARD);
  1233.       DoJustify(para_head, 0, para_tail, length(para_tail), NO,
  1234.             use_lmargin ? LMargin : body_indent);
  1235. --- 301,307 ----
  1236.   
  1237.   Justify()
  1238.   {
  1239. !     use_lmargin = is_an_arg();
  1240.       find_para(BACKWARD);
  1241.       DoJustify(para_head, 0, para_tail, length(para_tail), NO,
  1242.             use_lmargin ? LMargin : body_indent);
  1243. ***************
  1244. *** 339,345 ****
  1245.       Line    *rl1,
  1246.           *rl2;
  1247.   
  1248. !     use_lmargin = (exp_p != NO);
  1249.       (void) fixorder(&l1, &c1, &l2, &c2);
  1250.       do {
  1251.           DotTo(l1, c1);
  1252. --- 338,344 ----
  1253.       Line    *rl1,
  1254.           *rl2;
  1255.   
  1256. !     use_lmargin = is_an_arg();
  1257.       (void) fixorder(&l1, &c1, &l2, &c2);
  1258.       do {
  1259.           DotTo(l1, c1);
  1260. ***************
  1261. *** 346,352 ****
  1262.           find_para(FORWARD);
  1263.           rl1 = max_line(l1, para_head);
  1264.           rl2 = min_line(l2, para_tail);
  1265. !         tailmark = MakeMark(para_tail, 0, FLOATER);
  1266.           DoJustify(rl1, (rl1 == l1) ? c1 : 0, rl2,
  1267.                 (rl2 == l2) ? c2 : length(rl2),
  1268.                 NO, use_lmargin ? LMargin : body_indent);
  1269. --- 345,351 ----
  1270.           find_para(FORWARD);
  1271.           rl1 = max_line(l1, para_head);
  1272.           rl2 = min_line(l2, para_tail);
  1273. !         tailmark = MakeMark(para_tail, 0, M_FLOATER);
  1274.           DoJustify(rl1, (rl1 == l1) ? c1 : 0, rl2,
  1275.                 (rl2 == l2) ? c2 : length(rl2),
  1276.                 NO, use_lmargin ? LMargin : body_indent);
  1277. ***************
  1278. *** 356,362 ****
  1279.       } while (l1 != 0 && l2 != rl2);
  1280.   }
  1281.   
  1282. ! do_rfill()
  1283.   {
  1284.       Mark    *mp = CurMark();
  1285.       Line    *l1 = curline,
  1286. --- 355,361 ----
  1287.       } while (l1 != 0 && l2 != rl2);
  1288.   }
  1289.   
  1290. ! do_rfill(ulm)
  1291.   {
  1292.       Mark    *mp = CurMark();
  1293.       Line    *l1 = curline,
  1294. ***************
  1295. *** 364,370 ****
  1296.       int    c1 = curchar,
  1297.           c2 = mp->m_char;
  1298.   
  1299. !     use_lmargin = (exp_p != NO);
  1300.       (void) fixorder(&l1, &c1, &l2, &c2);
  1301.       DoJustify(l1, c1, l2, c2, NO, use_lmargin ? LMargin : 0);
  1302.   }
  1303. --- 363,369 ----
  1304.       int    c1 = curchar,
  1305.           c2 = mp->m_char;
  1306.   
  1307. !     use_lmargin = ulm;
  1308.       (void) fixorder(&l1, &c1, &l2, &c2);
  1309.       DoJustify(l1, c1, l2, c2, NO, use_lmargin ? LMargin : 0);
  1310.   }
  1311. ***************
  1312. *** 403,411 ****
  1313.           nspace = 0;
  1314.   
  1315.       if (diff > nspace)
  1316. !         DoTimes(DelPChar(), (diff - nspace));
  1317.       else if (diff < nspace)
  1318. !         DoTimes(Insert(' '), (nspace - diff));
  1319.   }
  1320.   
  1321.   DoJustify(l1, c1, l2, c2, scrunch, indent)
  1322. --- 402,410 ----
  1323.           nspace = 0;
  1324.   
  1325.       if (diff > nspace)
  1326. !         del_char(BACKWARD, (diff - nspace));
  1327.       else if (diff < nspace)
  1328. !         insert_c(' ', (nspace - diff));
  1329.   }
  1330.   
  1331.   DoJustify(l1, c1, l2, c2, scrunch, indent)
  1332. ***************
  1333. *** 414,423 ****
  1334.   {
  1335.       int    okay_char = -1;
  1336.       char    *cp;
  1337. !     Mark    *savedot = MakeMark(curline, curchar, FLOATER),
  1338.           *endmark;
  1339.   
  1340. -     exp = 1;
  1341.       (void) fixorder(&l1, &c1, &l2, &c2);    /* l1/c1 will be before l2/c2 */
  1342.       DotTo(l1, c1);
  1343.       if (get_indent(l1) >= c1) {
  1344. --- 413,421 ----
  1345.   {
  1346.       int    okay_char = -1;
  1347.       char    *cp;
  1348. !     Mark    *savedot = MakeMark(curline, curchar, M_FLOATER),
  1349.           *endmark;
  1350.   
  1351.       (void) fixorder(&l1, &c1, &l2, &c2);    /* l1/c1 will be before l2/c2 */
  1352.       DotTo(l1, c1);
  1353.       if (get_indent(l1) >= c1) {
  1354. ***************
  1355. *** 427,474 ****
  1356.           }
  1357.           ToIndent();
  1358.       }
  1359. !     endmark = MakeMark(l2, c2, FLOATER);
  1360.   
  1361.       for (;;) {
  1362. !         cp = StrIndex(1, linebuf, curchar, ' ');
  1363. !         if (cp == 0)
  1364. !             Eol();
  1365. !         else
  1366. !             curchar = (cp - linebuf);
  1367. !         if (curline == endmark->m_line && curchar >= endmark->m_char)
  1368. !             goto outahere;
  1369. !         if (eolp()) {
  1370. !             ins_str("  ", NO);
  1371. !             DelNChar();    /* delete line separator */
  1372. !             curchar -= 2;    /* back over the spaces */
  1373. !         }
  1374. !         /* at this point we are ALWAYS sitting right after
  1375. !            a word - that is, just before some spaces or the
  1376. !            end of the line */
  1377. !         if (calc_pos(linebuf, curchar) <= RMargin) {
  1378.               okay_char = curchar;
  1379.               do_space();
  1380. -             continue;
  1381.           }
  1382. -         /* if we get here, we have done all we can for
  1383. -            this line - now we split the line, or just move
  1384. -            to the next one */
  1385.           if (okay_char > 0)
  1386.               curchar = okay_char;            
  1387.           if (curline == endmark->m_line && curchar >= endmark->m_char)
  1388.               goto outahere;
  1389. !         /* can't fit in small margin, so we do the best we can */
  1390.           if (eolp()) {
  1391. !             line_move(FORWARD, NO);
  1392.               n_indent(indent);
  1393.           } else {
  1394. -             /* insert a line break - line WAS too long */
  1395.               DelWtSpace();
  1396.               LineInsert(1);
  1397.               if (scrunch && TwoBlank()) {
  1398.                   Eol();
  1399. !                 DelNChar();
  1400.               }
  1401.               n_indent(indent);
  1402.           }
  1403. --- 425,464 ----
  1404.           }
  1405.           ToIndent();
  1406.       }
  1407. !     endmark = MakeMark(l2, c2, M_FLOATER);
  1408.   
  1409.       for (;;) {
  1410. !         while (calc_pos(linebuf, curchar) < RMargin) {
  1411. !             if (curline == endmark->m_line && curchar >= endmark->m_char)
  1412. !                 goto outahere;
  1413.               okay_char = curchar;
  1414. +             if (eolp()) {
  1415. +                 del_char(FORWARD, 1);    /* Delete line separator. */
  1416. +                 ins_str("  ", NO);
  1417. +             } else {
  1418. +                 cp = StrIndex(1, linebuf, curchar + 1, ' ');
  1419. +                 if (cp == 0)
  1420. +                     Eol();
  1421. +                 else
  1422. +                     curchar = (cp - linebuf);
  1423. +             }
  1424.               do_space();
  1425.           }
  1426.           if (okay_char > 0)
  1427.               curchar = okay_char;            
  1428.           if (curline == endmark->m_line && curchar >= endmark->m_char)
  1429.               goto outahere;
  1430. !         /* Can't fit in small margin, so we do the best we can. */
  1431.           if (eolp()) {
  1432. !             line_move(FORWARD, 1, NO);
  1433.               n_indent(indent);
  1434.           } else {
  1435.               DelWtSpace();
  1436.               LineInsert(1);
  1437.               if (scrunch && TwoBlank()) {
  1438.                   Eol();
  1439. !                 del_char(FORWARD, 1);
  1440.               }
  1441.               n_indent(indent);
  1442.           }
  1443. ***************
  1444. *** 486,492 ****
  1445.   
  1446.   DoPara(dir)
  1447.   {
  1448. !     register int    num = exp,
  1449.               first_time = TRUE;    
  1450.   
  1451.       while (--num >= 0) {
  1452. --- 476,482 ----
  1453.   
  1454.   DoPara(dir)
  1455.   {
  1456. !     register int    num = arg_value(),
  1457.               first_time = TRUE;    
  1458.   
  1459.       while (--num >= 0) {
  1460. ***************
  1461. *** 495,501 ****
  1462.               ((!first_time) || ((para_head == curline) && bolp()))) {
  1463.                   if (bobp())
  1464.                       complain((char *) 0);
  1465. !             BackChar();
  1466.               first_time = !first_time;
  1467.               goto tryagain;
  1468.           }
  1469. --- 485,491 ----
  1470.               ((!first_time) || ((para_head == curline) && bolp()))) {
  1471.                   if (bobp())
  1472.                       complain((char *) 0);
  1473. !             b_char(1);
  1474.               first_time = !first_time;
  1475.               goto tryagain;
  1476.           }
  1477. ***************
  1478. *** 502,508 ****
  1479.           SetLine((dir == BACKWARD) ? para_head : para_tail);
  1480.           if (dir == BACKWARD && !firstp(curline) &&
  1481.               i_blank(curline->l_prev))
  1482. !             line_move(BACKWARD, NO);
  1483.           else if (dir == FORWARD) {
  1484.               if (lastp(curline)) {
  1485.                   Eol();
  1486. --- 492,498 ----
  1487.           SetLine((dir == BACKWARD) ? para_head : para_tail);
  1488.           if (dir == BACKWARD && !firstp(curline) &&
  1489.               i_blank(curline->l_prev))
  1490. !             line_move(BACKWARD, 1, NO);
  1491.           else if (dir == FORWARD) {
  1492.               if (lastp(curline)) {
  1493.                   Eol();
  1494. ***************
  1495. *** 509,515 ****
  1496.                   break;
  1497.               }
  1498.               /* otherwise */
  1499. !             line_move(FORWARD, NO);
  1500.           }
  1501.       }
  1502.   }
  1503. --- 499,505 ----
  1504.                   break;
  1505.               }
  1506.               /* otherwise */
  1507. !             line_move(FORWARD, 1, NO);
  1508.           }
  1509.       }
  1510.   }
  1511. diff -c ojove/proc.c jove/proc.c
  1512. *** ojove/proc.c    Thu Jul 16 09:14:48 1987
  1513. --- jove/proc.c    Thu Jun 25 09:45:20 1987
  1514. ***************
  1515. *** 124,130 ****
  1516.       }
  1517.       if (cur_error != 0)
  1518.           ShowErr();
  1519. -     exp = 1;
  1520.   }
  1521.   
  1522.   /* Free up all the errors */
  1523. --- 124,129 ----
  1524. ***************
  1525. *** 145,153 ****
  1526.           noerrs[] = "No errors!";
  1527.   
  1528.   private
  1529. ! toerror(forward)
  1530.   {
  1531. -     register int    i;
  1532.       register struct error    *e = cur_error;
  1533.   
  1534.       if (e == 0)
  1535. --- 144,151 ----
  1536.           noerrs[] = "No errors!";
  1537.   
  1538.   private
  1539. ! toerror(forward, num)
  1540.   {
  1541.       register struct error    *e = cur_error;
  1542.   
  1543.       if (e == 0)
  1544. ***************
  1545. *** 156,162 ****
  1546.           (!forward && (e->er_prev == 0)))
  1547.           complain(errbounds, forward ? "last" : "first");
  1548.   
  1549. !     for (i = 0; i < exp; i++) {
  1550.           if ((e = forward ? e->er_next : e->er_prev) == 0)
  1551.               break;
  1552.           cur_error = e;
  1553. --- 154,160 ----
  1554.           (!forward && (e->er_prev == 0)))
  1555.           complain(errbounds, forward ? "last" : "first");
  1556.   
  1557. !     while (--num >= 0) {
  1558.           if ((e = forward ? e->er_next : e->er_prev) == 0)
  1559.               break;
  1560.           cur_error = e;
  1561. ***************
  1562. *** 187,194 ****
  1563.   ToError(forward)
  1564.   {
  1565.       do {
  1566. !         toerror(forward);
  1567. !         exp = 1;
  1568.       } while (!okay_error());
  1569.       ShowErr();
  1570.   }
  1571. --- 185,191 ----
  1572.   ToError(forward)
  1573.   {
  1574.       do {
  1575. !         toerror(forward, arg_value());
  1576.       } while (!okay_error());
  1577.       ShowErr();
  1578.   }
  1579. ***************
  1580. *** 293,303 ****
  1581.          default command and let the person decide. */
  1582.   
  1583.       compilation = (sindex("make", make_cmd) || sindex("cc", make_cmd));
  1584. !     if (exp_p || !compilation) {
  1585.           if (!compilation) {
  1586.               rbell();
  1587. !             Inputp = make_cmd;    /* insert the default for the
  1588. !                            user */
  1589.           }
  1590.           null_ncpy(make_cmd, ask(make_cmd, "Compilation command: "),
  1591.                   sizeof (make_cmd) - 1);
  1592. --- 290,299 ----
  1593.          default command and let the person decide. */
  1594.   
  1595.       compilation = (sindex("make", make_cmd) || sindex("cc", make_cmd));
  1596. !     if (is_an_arg() || !compilation) {
  1597.           if (!compilation) {
  1598.               rbell();
  1599. !             Inputp = make_cmd;    /* insert the default for the user */
  1600.           }
  1601.           null_ncpy(make_cmd, ask(make_cmd, "Compilation command: "),
  1602.                   sizeof (make_cmd) - 1);
  1603. ***************
  1604. *** 367,373 ****
  1605.                         curline, curchar);
  1606.           }
  1607.           SetBuf(wordsb);
  1608. !         line_move(FORWARD, NO);
  1609.       }
  1610.       add_mess("Done.");
  1611.       SetBuf(buftospel);
  1612. --- 363,369 ----
  1613.                         curline, curchar);
  1614.           }
  1615.           SetBuf(wordsb);
  1616. !         line_move(FORWARD, 1, NO);
  1617.       }
  1618.       add_mess("Done.");
  1619.       SetBuf(buftospel);
  1620. ***************
  1621. *** 378,387 ****
  1622.   
  1623.   ShToBuf()
  1624.   {
  1625. !     char    bufname[100];
  1626.   
  1627.       strcpy(bufname, ask((char *) 0, "Buffer: "));
  1628. !     DoShell(bufname, ask(ShcomBuf, "Command: "));
  1629.   }
  1630.   
  1631.   ShellCom()
  1632. --- 374,385 ----
  1633.   
  1634.   ShToBuf()
  1635.   {
  1636. !     char    bufname[128],
  1637. !         cmd[128];
  1638.   
  1639.       strcpy(bufname, ask((char *) 0, "Buffer: "));
  1640. !     strcpy(cmd, ask(ShcomBuf, "Command: "));
  1641. !     DoShell(bufname, cmd);
  1642.   }
  1643.   
  1644.   ShellCom()
  1645. ***************
  1646. *** 402,409 ****
  1647.       Window    *savewp = curwind;
  1648.       int    status;
  1649.   
  1650. !     exp = 1;
  1651. !     status = UnixToBuf(bufname, YES, 0, !exp_p, Shell,
  1652.                  ShFlags, command, (char *) 0);
  1653.       com_finish(status, command);
  1654.       SetWind(savewp);
  1655. --- 400,406 ----
  1656.       Window    *savewp = curwind;
  1657.       int    status;
  1658.   
  1659. !     status = UnixToBuf(bufname, YES, 0, !is_an_arg(), Shell,
  1660.                  ShFlags, command, (char *) 0);
  1661.       com_finish(status, command);
  1662.       SetWind(savewp);
  1663. ***************
  1664. *** 465,471 ****
  1665.      to fix everything up after we're done.  (Usually there's nothing to
  1666.      fix up.) */
  1667.   
  1668. ! /* VARARGS5 */
  1669.   
  1670.   UnixToBuf(bufname, disp, wsize, clobber, va_alist)
  1671.   char    *bufname;
  1672. --- 462,468 ----
  1673.      to fix everything up after we're done.  (Usually there's nothing to
  1674.      fix up.) */
  1675.   
  1676. ! /* VARARGS4 */
  1677.   
  1678.   UnixToBuf(bufname, disp, wsize, clobber, va_alist)
  1679.   char    *bufname;
  1680. ***************
  1681. *** 517,523 ****
  1682.   #else
  1683.       old_int = signal(SIGINT, SIG_IGN),
  1684.   #endif
  1685. -     exp = 1;
  1686.       dopipe(p);
  1687.       pid = fork();
  1688.       if (pid == -1) {
  1689. --- 514,519 ----
  1690. ***************
  1691. *** 621,633 ****
  1692.   {
  1693.       Mark    *m = CurMark();
  1694.       char    *tname = mktemp("/tmp/jfilterXXXXXX"),
  1695. !         combuf[130];
  1696.       Window    *save_wind = curwind;
  1697. !     int    status;
  1698.       File    *fp;
  1699.   
  1700. -     CATCH
  1701.       fp = open_file(tname, iobuff, F_WRITE, COMPLAIN, QUIET);
  1702.       putreg(fp, m->m_line, m->m_char, curline, curchar, YES);
  1703.       DelReg();
  1704.       sprintf(combuf, "%s < %s", cmd, tname);
  1705. --- 617,630 ----
  1706.   {
  1707.       Mark    *m = CurMark();
  1708.       char    *tname = mktemp("/tmp/jfilterXXXXXX"),
  1709. !         combuf[128];
  1710.       Window    *save_wind = curwind;
  1711. !     int    status,
  1712. !         error = NO;
  1713.       File    *fp;
  1714.   
  1715.       fp = open_file(tname, iobuff, F_WRITE, COMPLAIN, QUIET);
  1716. +     CATCH
  1717.       putreg(fp, m->m_line, m->m_char, curline, curchar, YES);
  1718.       DelReg();
  1719.       sprintf(combuf, "%s < %s", cmd, tname);
  1720. ***************
  1721. *** 634,646 ****
  1722.       status = UnixToBuf(outbuf->b_name, NO, 0, outbuf->b_type == B_SCRATCH,
  1723.                  Shell, ShFlags, combuf, (char *) 0);
  1724.       ONERROR
  1725. !     ;    /* Do nothing ... but fall through and delete the tmp
  1726. !            file. */
  1727.       ENDCATCH
  1728.       f_close(fp);
  1729.       (void) unlink(tname);
  1730.       SetWind(save_wind);
  1731. !     com_finish(status, combuf);
  1732.   }
  1733.   
  1734.   isprocbuf(bufname)
  1735. --- 631,643 ----
  1736.       status = UnixToBuf(outbuf->b_name, NO, 0, outbuf->b_type == B_SCRATCH,
  1737.                  Shell, ShFlags, combuf, (char *) 0);
  1738.       ONERROR
  1739. !     error = YES;
  1740.       ENDCATCH
  1741.       f_close(fp);
  1742.       (void) unlink(tname);
  1743.       SetWind(save_wind);
  1744. !     if (error == NO)
  1745. !         com_finish(status, combuf);
  1746.   }
  1747.   
  1748.   isprocbuf(bufname)
  1749. Only in ojove: rcs.output
  1750. diff -c ojove/re.c jove/re.c
  1751. *** ojove/re.c    Thu Jul 16 09:14:53 1987
  1752. --- jove/re.c    Wed Jun 24 12:43:25 1987
  1753. ***************
  1754. *** 26,50 ****
  1755.       WrapScan = 0,
  1756.       UseRE = 0;
  1757.   
  1758. - private char    CaseEquiv[] = {
  1759. -     '\000',    '\001',    '\002',    '\003',    '\004',    '\005',    '\006',    '\007',
  1760. -     '\010',    '\011',    '\012',    '\013',    '\014',    '\015',    '\016',    '\017',
  1761. -     '\020',    '\021',    '\022',    '\023',    '\024',    '\025',    '\026',    '\027',
  1762. -     '\030',    '\031',    '\032',    '\033',    '\034',    '\035',    '\036',    '\037',
  1763. -     '\040',    '!',    '"',    '#',    '$',    '%',    '&',    '\'',
  1764. -     '(',    ')',    '*',    '+',    ',',    '-',    '.',    '/',
  1765. -     '0',    '1',    '2',    '3',    '4',    '5',    '6',    '7',
  1766. -     '8',    '9',    ':',    ';',    '<',    '=',    '>',    '?',
  1767. -     '@',    'A',    'B',    'C',    'D',    'E',    'F',    'G',
  1768. -     'H',    'I',    'J',    'K',    'L',    'M',    'N',    'O',
  1769. -     'P',    'Q',    'R',    'S',    'T',    'U',    'V',    'W',
  1770. -     'X',    'Y',    'Z',    '[',    '\\',    ']',    '^',    '_',
  1771. -     '`',    'A',    'B',    'C',    'D',    'E',    'F',    'G',
  1772. -     'H',    'I',    'J',    'K',    'L',    'M',    'N',    'O',
  1773. -     'P',    'Q',    'R',    'S',    'T',    'U',    'V',    'W',
  1774. -     'X',    'Y',    'Z',    '{',    '|',    '}',    '~',    '\177'
  1775. - };
  1776.   #define cind_cmp(a, b)    (CaseEquiv[a] == CaseEquiv[b])
  1777.   
  1778.   private int    REpeekc;
  1779. --- 26,31 ----
  1780. ***************
  1781. *** 738,747 ****
  1782.   
  1783.       if (!delp) while (c = *repp++) {
  1784.           if (c == '\\') {
  1785. !             if ((c = *repp++) == '\0') {
  1786.                   *tp++ = '\\';
  1787.                     goto endchk;
  1788. !             } else if ((c = *repp++) >= '1' && c <= nparens + '1') {
  1789.                   tp = insert(tp, endp, c - '1');
  1790.                   continue;
  1791.               }
  1792. --- 719,729 ----
  1793.   
  1794.       if (!delp) while (c = *repp++) {
  1795.           if (c == '\\') {
  1796. !             c = *repp++;
  1797. !             if (c == '\0') {
  1798.                   *tp++ = '\\';
  1799.                     goto endchk;
  1800. !             } else if (c >= '1' && c <= nparens + '1') {
  1801.                   tp = insert(tp, endp, c - '1');
  1802.                   continue;
  1803.               }
  1804. ***************
  1805. *** 786,792 ****
  1806.           repbuf[sizeof rep_str],
  1807.           *altbuf[NALTS];
  1808.       int    npars;
  1809. !     Mark    *m = MakeMark(curline, REbom, FLOATER);
  1810.   
  1811.       message("Type C-X C-C to continue with query replace.");
  1812.   
  1813. --- 768,774 ----
  1814.           repbuf[sizeof rep_str],
  1815.           *altbuf[NALTS];
  1816.       int    npars;
  1817. !     Mark    *m = MakeMark(curline, REbom, M_FLOATER);
  1818.   
  1819.       message("Type C-X C-C to continue with query replace.");
  1820.   
  1821. ***************
  1822. *** 801,807 ****
  1823.       byte_copy(sbuf, searchstr, sizeof searchstr);
  1824.       byte_copy(repbuf, rep_str, sizeof rep_str);
  1825.       byte_copy((char *) altbuf, (char *) alternates, sizeof alternates);
  1826. !     if (!exp_p)
  1827.           ToMark(m);
  1828.       DelMark(m);
  1829.   }
  1830. --- 783,789 ----
  1831.       byte_copy(sbuf, searchstr, sizeof searchstr);
  1832.       byte_copy(repbuf, rep_str, sizeof rep_str);
  1833.       byte_copy((char *) altbuf, (char *) alternates, sizeof alternates);
  1834. !     if (!is_an_arg())
  1835.           ToMark(m);
  1836.       DelMark(m);
  1837.   }
  1838. diff -c ojove/re1.c jove/re1.c
  1839. *** ojove/re1.c    Thu Jul 16 09:14:58 1987
  1840. --- jove/re1.c    Fri Jul 10 09:25:51 1987
  1841. ***************
  1842. *** 8,15 ****
  1843.   #include "jove.h"
  1844.   #include "io.h"
  1845.   #include "re.h"
  1846.   
  1847. ! static
  1848.   substitute(query, l1, char1, l2, char2)
  1849.   Line    *l1,
  1850.       *l2;
  1851. --- 8,17 ----
  1852.   #include "jove.h"
  1853.   #include "io.h"
  1854.   #include "re.h"
  1855. + #include <sys/types.h>
  1856. + #include <sys/stat.h>
  1857.   
  1858. ! private
  1859.   substitute(query, l1, char1, l2, char2)
  1860.   Line    *l1,
  1861.       *l2;
  1862. ***************
  1863. *** 35,41 ****
  1864.               if (query) {
  1865.                   message("Replace (Type '?' for help)? ");
  1866.   reswitch:            redisplay();
  1867. !                 switch (Upper(getchar())) {
  1868.                   case '.':
  1869.                       stop++;
  1870.                       /* Fall into ... */
  1871. --- 37,43 ----
  1872.               if (query) {
  1873.                   message("Replace (Type '?' for help)? ");
  1874.   reswitch:            redisplay();
  1875. !                 switch (CharUpcase(getchar())) {
  1876.                   case '.':
  1877.                       stop++;
  1878.                       /* Fall into ... */
  1879. ***************
  1880. *** 51,57 ****
  1881.                           goto nxtline;
  1882.                       continue;
  1883.   
  1884. !                 case CTL(W):
  1885.                       re_dosub(linebuf, YES);
  1886.                       numdone++;
  1887.                       offset = curchar = REbom;
  1888. --- 53,59 ----
  1889.                           goto nxtline;
  1890.                       continue;
  1891.   
  1892. !                 case CTL('W'):
  1893.                       re_dosub(linebuf, YES);
  1894.                       numdone++;
  1895.                       offset = curchar = REbom;
  1896. ***************
  1897. *** 58,64 ****
  1898.                       makedirty(curline);
  1899.                       /* Fall into ... */
  1900.   
  1901. !                 case CTL(R):
  1902.                   case 'R':
  1903.                       RErecur();
  1904.                       offset = curchar;
  1905. --- 60,66 ----
  1906.                       makedirty(curline);
  1907.                       /* Fall into ... */
  1908.   
  1909. !                 case CTL('R'):
  1910.                   case 'R':
  1911.                       RErecur();
  1912.                       offset = curchar;
  1913. ***************
  1914. *** 65,71 ****
  1915.                       lp = curline;
  1916.                       continue;
  1917.   
  1918. !                 case CTL(U):
  1919.                   case 'U':
  1920.                       if (UNDO_lp == 0)
  1921.                           continue;
  1922. --- 67,73 ----
  1923.                       lp = curline;
  1924.                       continue;
  1925.   
  1926. !                 case CTL('U'):
  1927.                   case 'U':
  1928.                       if (UNDO_lp == 0)
  1929.                           continue;
  1930. ***************
  1931. *** 85,91 ****
  1932.                   case 'Q':
  1933.                       goto done;
  1934.   
  1935. !                 case CTL(L):
  1936.                       RedrawDisplay();
  1937.                       goto reswitch;
  1938.   
  1939. --- 87,93 ----
  1940.                   case 'Q':
  1941.                       goto done;
  1942.   
  1943. !                 case CTL('L'):
  1944.                       RedrawDisplay();
  1945.                       goto reswitch;
  1946.   
  1947. ***************
  1948. *** 110,116 ****
  1949.   nxtline:            break;
  1950.           }
  1951.       }
  1952. !     SetMark();
  1953.   done:    s_mess("%d substitution%n.", numdone, numdone);
  1954.   }
  1955.   
  1956. --- 112,118 ----
  1957.   nxtline:            break;
  1958.           }
  1959.       }
  1960. !     set_mark();
  1961.   done:    s_mess("%d substitution%n.", numdone, numdone);
  1962.   }
  1963.   
  1964. ***************
  1965. *** 117,126 ****
  1966.   /* Prompt for search and replacement strings and do the substitution.  The
  1967.      point is restored when we're done. */
  1968.   
  1969. ! static
  1970.   replace(query, inreg)
  1971.   {
  1972. !     Mark    *save = MakeMark(curline, curchar, FLOATER),
  1973.           *m;
  1974.       char    *rep_ptr;
  1975.       Line    *l1 = curline,
  1976. --- 119,128 ----
  1977.   /* Prompt for search and replacement strings and do the substitution.  The
  1978.      point is restored when we're done. */
  1979.   
  1980. ! private
  1981.   replace(query, inreg)
  1982.   {
  1983. !     Mark    *save = MakeMark(curline, curchar, M_FLOATER),
  1984.           *m;
  1985.       char    *rep_ptr;
  1986.       Line    *l1 = curline,
  1987. ***************
  1988. *** 166,174 ****
  1989.       replace(0, NO);
  1990.   }
  1991.   
  1992. ! /* C tags package. */
  1993.   
  1994. ! static
  1995.   lookup(searchbuf, filebuf, tag, file)
  1996.   char    *searchbuf,
  1997.       *filebuf,
  1998. --- 168,180 ----
  1999.       replace(0, NO);
  2000.   }
  2001.   
  2002. ! /* Lookup a tag in tag file FILE.  FILE is assumed to be sorted
  2003. !    alphabetically.  The FASTTAGS code, which is implemented with
  2004. !    a binary search, depends on this assumption.  If it's not true
  2005. !    it is possible to comment out the fast tag code (which is clearly
  2006. !    labeled) and everything else will just work. */
  2007.   
  2008. ! private
  2009.   lookup(searchbuf, filebuf, tag, file)
  2010.   char    *searchbuf,
  2011.       *filebuf,
  2012. ***************
  2013. *** 176,205 ****
  2014.       *file;
  2015.   {
  2016.       register int    taglen = strlen(tag);
  2017. !     char    line[128],
  2018. !         pattern[100];
  2019. !     File    *fp;
  2020.   
  2021.       fp = open_file(file, iobuff, F_READ, !COMPLAIN, QUIET);
  2022.       if (fp == NIL)
  2023.           return 0;
  2024. !     sprintf(pattern, "^%s[^\t]*\t\\([^\t]*\\)\t[?/]\\(.*\\)[?/]$", tag);
  2025.       while (f_gets(fp, line, sizeof line) != EOF) {
  2026. !         if (line[0] != *tag || strncmp(tag, line, taglen) != 0)
  2027.               continue;
  2028. !         if (!LookingAt(pattern, line, 0)) {
  2029.               complain("I thought I saw it!");
  2030.               break;
  2031.           } else {
  2032.               putmatch(2, searchbuf, 100);
  2033. !             putmatch(1, filebuf, 100);
  2034. !             close_file(fp);
  2035. !             return 1;
  2036.           }
  2037.       }
  2038. !     f_close(fp);
  2039. !     s_mess("Can't find tag \"%s\".", tag);
  2040. !     return 0;
  2041.   }
  2042.   
  2043.   char    TagFile[128] = "./tags";
  2044. --- 182,267 ----
  2045.       *file;
  2046.   {
  2047.       register int    taglen = strlen(tag);
  2048. !     char    line[BUFSIZ],
  2049. !         pattern[128];
  2050. !     register File    *fp;
  2051. !     struct stat    stbuf;
  2052. !     int    fast = YES,
  2053. !         success = NO;
  2054. !     register off_t    lower, upper;
  2055.   
  2056. +     sprintf(pattern, "^%s[^\t]*\t*\\([^\t]*\\)\t*[?/]\\([^?/]*\\)[?/]", tag);
  2057.       fp = open_file(file, iobuff, F_READ, !COMPLAIN, QUIET);
  2058.       if (fp == NIL)
  2059.           return 0;
  2060. !     /* ********BEGIN FAST TAG CODE******** */
  2061. !     if (stat(file, &stbuf) < 0)
  2062. !         fast = NO;
  2063. !     else {
  2064. !         lower = 0;
  2065. !         upper = stbuf.st_size;
  2066. !         if (upper - lower < BUFSIZ)
  2067. !             fast = NO;
  2068. !     }
  2069. !     if (fast == YES) for (;;) {
  2070. !         off_t    mid;
  2071. !         int    whichway;
  2072. !         if (upper - lower < BUFSIZ) {
  2073. !             f_seek(fp, lower);
  2074. !             break;            /* stop this nonsense */
  2075. !         }
  2076. !         mid = (lower + upper) / 2;
  2077. !         f_seek(fp, mid);
  2078. !         f_toNL(fp);
  2079. !         if (f_gets(fp, line, sizeof line) == EOF)
  2080. !             break;
  2081. !         whichway = strncmp(line, tag, taglen);
  2082. !         if (whichway < 0) {
  2083. !             lower = mid;
  2084. !             continue;
  2085. !         } else if (whichway > 0) {
  2086. !             upper = mid;
  2087. !             continue;
  2088. !         } else {
  2089. !             if (strcmp(tag, line) == 0)    /* exact match */
  2090. !                 goto found;
  2091. !             goto look_harder;
  2092. !         }
  2093. !     }
  2094. !     f_toNL(fp);
  2095. !     /* END FAST TAG CODE */
  2096.       while (f_gets(fp, line, sizeof line) != EOF) {
  2097. !         int    cmp;
  2098. ! look_harder:    if (line[0] > *tag)
  2099. !             break;
  2100. !         else if ((cmp = strncmp(line, tag, taglen)) > 0)
  2101. !             break;
  2102. !         else if (cmp < 0)
  2103.               continue;
  2104. !         /* if we get here, we've found the match */
  2105. ! found:        if (!LookingAt(pattern, line, 0)) {
  2106.               complain("I thought I saw it!");
  2107.               break;
  2108.           } else {
  2109. +             putmatch(1, filebuf, FILESIZE);
  2110.               putmatch(2, searchbuf, 100);
  2111. !             success = YES;
  2112. !             if (strcmp(tag, line) == 0)    /* exact match */
  2113. !                 break;
  2114. !             continue;
  2115.           }
  2116.       }
  2117. !     close_file(fp);
  2118. !         
  2119. !     if (success == NO)
  2120. !         s_mess("Can't find tag \"%s\".", tag);
  2121. !     return success;
  2122.   }
  2123.   
  2124.   char    TagFile[128] = "./tags";
  2125. ***************
  2126. *** 223,235 ****
  2127.           tagfname = TagFile;
  2128.       if (lookup(sstr, filebuf, tag, tagfname) == 0)
  2129.           return;
  2130. !     SetMark();
  2131.       b = do_find(curwind, filebuf, 0);
  2132.       if (curbuf != b)
  2133.           SetABuf(curbuf);
  2134.       SetBuf(b);
  2135.       if ((bp = dosearch(sstr, BACKWARD, 0)) == 0 &&
  2136. !         (WrapScan || ((bp = dosearch(sstr, FORWARD, 0)) == 0)))
  2137.           message("Well, I found the file, but the tag is missing.");
  2138.       else
  2139.           SetDot(bp);
  2140. --- 285,297 ----
  2141.           tagfname = TagFile;
  2142.       if (lookup(sstr, filebuf, tag, tagfname) == 0)
  2143.           return;
  2144. !     set_mark();
  2145.       b = do_find(curwind, filebuf, 0);
  2146.       if (curbuf != b)
  2147.           SetABuf(curbuf);
  2148.       SetBuf(b);
  2149.       if ((bp = dosearch(sstr, BACKWARD, 0)) == 0 &&
  2150. !         ((bp = dosearch(sstr, FORWARD, 0)) == 0))
  2151.           message("Well, I found the file, but the tag is missing.");
  2152.       else
  2153.           SetDot(bp);
  2154. ***************
  2155. *** 237,243 ****
  2156.   
  2157.   FindTag()
  2158.   {
  2159. !     int    localp = !exp_p;
  2160.       char    tag[128];
  2161.   
  2162.       strcpy(tag, ask((char *) 0, ProcFmt));
  2163. --- 299,305 ----
  2164.   
  2165.   FindTag()
  2166.   {
  2167. !     int    localp = !is_an_arg();
  2168.       char    tag[128];
  2169.   
  2170.       strcpy(tag, ask((char *) 0, ProcFmt));
  2171. ***************
  2172. *** 260,266 ****
  2173.           c2++;
  2174.   
  2175.       null_ncpy(tagname, linebuf + c1, c2 - c1);
  2176. !     find_tag(tagname, !exp_p);
  2177.   }
  2178.   
  2179.   /* I-search returns a code saying what to do:
  2180. --- 322,328 ----
  2181.           c2++;
  2182.   
  2183.       null_ncpy(tagname, linebuf + c1, c2 - c1);
  2184. !     find_tag(tagname, !is_an_arg());
  2185.   }
  2186.   
  2187.   /* I-search returns a code saying what to do:
  2188. ***************
  2189. *** 282,288 ****
  2190.           *incp = 0;
  2191.   int    SExitChar = CR;
  2192.   
  2193. ! #define cmp_char(a, b)    ((a) == (b) || (CaseIgnore && (Upper(a) == Upper(b))))
  2194.   
  2195.   static Bufpos *
  2196.   doisearch(dir, c, failing)
  2197. --- 344,350 ----
  2198.           *incp = 0;
  2199.   int    SExitChar = CR;
  2200.   
  2201. ! #define cmp_char(a, b)    ((a) == (b) || (CaseIgnore && (CharUpcase(a) == CharUpcase(b))))
  2202.   
  2203.   static Bufpos *
  2204.   doisearch(dir, c, failing)
  2205. ***************
  2206. *** 294,300 ****
  2207.       Bufpos    *bp;
  2208.       extern int    okay_wrap;
  2209.   
  2210. !     if (c == CTL(S) || c == CTL(R))
  2211.           goto dosrch;
  2212.   
  2213.       if (failing)
  2214. --- 356,362 ----
  2215.       Bufpos    *bp;
  2216.       extern int    okay_wrap;
  2217.   
  2218. !     if (c == CTL('S') || c == CTL('R'))
  2219.           goto dosrch;
  2220.   
  2221.       if (failing)
  2222. ***************
  2223. *** 338,344 ****
  2224.           SetDot(&save_env);
  2225.       else {
  2226.           if (LineDist(curline, save_env.p_line) >= MarkThresh)
  2227. !             DoSetMark(save_env.p_line, save_env.p_char);
  2228.       }
  2229.       setsearch(ISbuf);
  2230.   }
  2231. --- 400,406 ----
  2232.           SetDot(&save_env);
  2233.       else {
  2234.           if (LineDist(curline, save_env.p_line) >= MarkThresh)
  2235. !             do_set_mark(save_env.p_line, save_env.p_char);
  2236.       }
  2237.       setsearch(ISbuf);
  2238.   }
  2239. ***************
  2240. *** 385,391 ****
  2241.           case BS:
  2242.               return DELETE;
  2243.   
  2244. !         case CTL(G):
  2245.               /* If we're failing, we backup until we're no longer
  2246.                  failing or we've reached the beginning; else, we
  2247.                  just about the search and go back to the start. */
  2248. --- 447,453 ----
  2249.           case BS:
  2250.               return DELETE;
  2251.   
  2252. !         case CTL('G'):
  2253.               /* If we're failing, we backup until we're no longer
  2254.                  failing or we've reached the beginning; else, we
  2255.                  just about the search and go back to the start. */
  2256. ***************
  2257. *** 393,402 ****
  2258.                   return BACKUP;
  2259.               return TOSTART;
  2260.   
  2261. !         case CTL(\\):
  2262. !             c = CTL(S);
  2263. !         case CTL(S):
  2264. !         case CTL(R):
  2265.               /* If this is the first time through and we have a
  2266.                  search string left over from last time, use that
  2267.                  one now. */
  2268. --- 455,464 ----
  2269.                   return BACKUP;
  2270.               return TOSTART;
  2271.   
  2272. !         case CTL('\\'):
  2273. !             c = CTL('S');
  2274. !         case CTL('S'):
  2275. !         case CTL('R'):
  2276.               /* If this is the first time through and we have a
  2277.                  search string left over from last time, use that
  2278.                  one now. */
  2279. ***************
  2280. *** 404,410 ****
  2281.                   strcpy(ISbuf, getsearch());
  2282.                   incp = &ISbuf[strlen(ISbuf)];
  2283.               }
  2284. !             ndir = (c == CTL(S)) ? FORWARD : BACKWARD;
  2285.               /* If we're failing and we're not changing our
  2286.                  direction, don't recur since there's no way
  2287.                  the search can work. */
  2288. --- 466,472 ----
  2289.                   strcpy(ISbuf, getsearch());
  2290.                   incp = &ISbuf[strlen(ISbuf)];
  2291.               }
  2292. !             ndir = (c == CTL('S')) ? FORWARD : BACKWARD;
  2293.               /* If we're failing and we're not changing our
  2294.                  direction, don't recur since there's no way
  2295.                  the search can work. */
  2296. ***************
  2297. *** 423,430 ****
  2298.               add_mess("\\");
  2299.               /* Fall into ... */
  2300.   
  2301. !         case CTL(Q):
  2302. !         case CTL(^):
  2303.               add_mess("");
  2304.               c = getch() | 0400;
  2305.               /* Fall into ... */
  2306. --- 485,492 ----
  2307.               add_mess("\\");
  2308.               /* Fall into ... */
  2309.   
  2310. !         case CTL('Q'):
  2311. !         case CTL('^'):
  2312.               add_mess("");
  2313.               c = getch() | 0400;
  2314.               /* Fall into ... */
  2315.