home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume15 / mush6.3kit / part03 / Diffs.6.3.b
Encoding:
Text File  |  1988-07-06  |  55.8 KB  |  1,801 lines

  1. !  * message list if we hit the end.  otherwise, stop at the end of the list.
  2.    */
  3.   next_msg()
  4.   {
  5. --- 23,31 ----
  6.   }
  7.   
  8.   /*
  9. !  * loop thru all msgs starting with current_msg and find next undeleted and
  10. !  * unsaved message.  If the variable "wrap" is set, wrap to the beginning of
  11. !  * the message list if we hit the end.  otherwise, stop at the end of the list.
  12.    */
  13.   next_msg()
  14.   {
  15. ***************
  16. *** 40,46 ****
  17.           return current_msg = msg_cnt - 1;
  18.           else
  19.           n = -1; /* increments to 0 in  loop  */
  20. !     else if (isoff(msg[n].m_flags, DELETE))
  21.           return current_msg = n;
  22.       return current_msg = 0;
  23.   }
  24. --- 40,47 ----
  25.           return current_msg = msg_cnt - 1;
  26.           else
  27.           n = -1; /* increments to 0 in  loop  */
  28. !     else if (isoff(msg[n].m_flags, DELETE) &&
  29. !          isoff(msg[n].m_flags, SAVED))
  30.           return current_msg = n;
  31.       return current_msg = 0;
  32.   }
  33. ***************
  34. *** 286,291 ****
  35. --- 287,293 ----
  36.               case 'n' : turnon(newflag, UNREAD), turnoff(newflag, OLD);
  37.               when 'd' : turnon(newflag, DELETE);
  38.               when 'p' : turnon(newflag, PRESERVE);
  39. +             when 's' : turnon(newflag, SAVED);
  40.               when 'u' : turnon(newflag, UNREAD); /* fall thru! */
  41.               case 'o' : turnon(newflag, OLD);
  42.               when 'r' :
  43. ***************
  44. *** 313,318 ****
  45. --- 315,322 ----
  46.           wprint(" PRESERVE");
  47.           if (ison(msg[i].m_flags, REPLIED))
  48.           wprint(" REPLIED");
  49. +         if (ison(msg[i].m_flags, SAVED))
  50. +         wprint(" SAVED");
  51.           if (ison(msg[i].m_flags, UPDATE_STATUS))
  52.           wprint(" UPDATE_STATUS");
  53.           wprint("\n");
  54. ***************
  55. *** 342,347 ****
  56. --- 346,352 ----
  57.   {
  58.       static FILE *pp;
  59.       static int cnt;
  60. +     static u_long save_echo_flag;
  61.   
  62.   #ifdef SUNTOOL
  63.       if (istool) {
  64. ***************
  65. *** 352,360 ****
  66.   #endif /* SUNTOOL */
  67.       if (start_pager) {
  68.       turnon(glob_flags, IGN_SIGS);
  69. !     if (!buf)
  70.           pp = stdout;
  71. !     else {
  72.           echo_on();
  73.           if (!(pp = popen(buf, "w")))
  74.           error(buf);
  75. --- 357,371 ----
  76.   #endif /* SUNTOOL */
  77.       if (start_pager) {
  78.       turnon(glob_flags, IGN_SIGS);
  79. !     if (!buf) {
  80. !         /* internal pager */
  81. !         save_echo_flag = ison(glob_flags, ECHO_FLAG);
  82.           pp = stdout;
  83. !         if (save_echo_flag) {
  84. !         turnoff(glob_flags, ECHO_FLAG);
  85. !         echo_off();
  86. !         }
  87. !     } else {
  88.           echo_on();
  89.           if (!(pp = popen(buf, "w")))
  90.           error(buf);
  91. ***************
  92. *** 364,370 ****
  93.       if (pp && pp != stdout)
  94.           pclose(pp);
  95.       pp = NULL_FILE;
  96. !     echo_off();
  97.       turnoff(glob_flags, IGN_SIGS);
  98.       } else if (pp != stdout)
  99.       return fputs(buf, pp); /* returns EOF if user exited pager */
  100. --- 375,385 ----
  101.       if (pp && pp != stdout)
  102.           pclose(pp);
  103.       pp = NULL_FILE;
  104. !     if (save_echo_flag) {
  105. !         echo_on();
  106. !         turnon(glob_flags, ECHO_FLAG);
  107. !     } else
  108. !         echo_off();
  109.       turnoff(glob_flags, IGN_SIGS);
  110.       } else if (pp != stdout)
  111.       return fputs(buf, pp); /* returns EOF if user exited pager */
  112. *** OLD/msgs.c    Sat May 21 10:27:30 1988
  113. --- msgs.c    Tue Jul  5 22:53:26 1988
  114. ***************
  115. *** 1,23 ****
  116.   /* @(#)msgs.c    (c) copyright 10/18/86 (Dan Heller) */
  117.   
  118. ! #include "mush.h"
  119. ! #ifdef SYSV
  120. ! #ifndef USG
  121. ! #include <sys/locking.h>
  122. ! #else /* USG */
  123.   #include <unistd.h>
  124.   #endif /* USG */
  125. ! #endif /* SYSV */
  126.   
  127. ! lock_file(filename, fd)
  128.   char *filename;
  129.   {
  130.   #ifdef SYSV
  131.   #ifndef USG
  132. !     (void) locking(fd, LK_LOCK, 0); /* xenix */
  133.   #else
  134.       /* if unable to lock, tell them */
  135. !     if (Access(filename, W_OK) || lockf(fd, F_TLOCK, 0)) /* system-v */
  136.       return -1;
  137.   #endif /* USG */
  138.   #else
  139. --- 1,63 ----
  140.   /* @(#)msgs.c    (c) copyright 10/18/86 (Dan Heller) */
  141.   
  142. ! #ifdef USG
  143.   #include <unistd.h>
  144.   #endif /* USG */
  145. ! #include "mush.h"
  146. ! #if defined(SYSV) && !defined(USG)
  147. ! #include <sys/locking.h>
  148. ! #endif /* SYSV && !USG */
  149.   
  150. ! extern int sgid;
  151. ! #ifdef DOT_LOCK
  152. ! dot_lock(filename)
  153.   char *filename;
  154.   {
  155. +     char buf[MAXPATHLEN];
  156. +     int lockfd, cnt = 0;
  157. +     SIGRET (*oldint)(), (*oldquit)();
  158. +     setgid(sgid);
  159. +     (void) sprintf(buf, "%s.lock", filename);
  160. +     on_intr();
  161. +     while ((lockfd = open(buf, O_CREAT|O_WRONLY|O_EXCL, 0600)) == -1) {
  162. +     if (errno != EEXIST) {
  163. +         error("unable to lock %s", filename);
  164. +         break;
  165. +     }
  166. +     if (cnt++ == 0)
  167. +         print("%s already locked, waiting", filename);
  168. +     else
  169. +         print_more(".");
  170. +     sleep(1);
  171. +     if (ison(glob_flags, WAS_INTR)) {
  172. +         print_more("\nAborted.\n");
  173. +         break;
  174. +     }
  175. +     }
  176. +     off_intr();
  177. +     if (lockfd != -1) {
  178. +     if (cnt)
  179. +         print("done.\n");
  180. +     (void) close(lockfd);
  181. +     }
  182. +     setgid(getgid());
  183. +     return lockfd == -1? -1 : 0;
  184. + }
  185. + #endif /* DOT_LOCK */
  186. + lock_file(filename, fp)
  187. + char *filename;
  188. + FILE *fp;
  189. + {
  190. +     int fd = fileno(fp);
  191.   #ifdef SYSV
  192.   #ifndef USG
  193. !     (void) locking(fd, LK_LOCK, 0); /* old xenix (sys III) */
  194.   #else
  195.       /* if unable to lock, tell them */
  196. !     if (Access(filename, W_OK) || lockf(fd, F_LOCK, 0L)) /* system-v */
  197.       return -1;
  198.   #endif /* USG */
  199.   #else
  200. ***************
  201. *** 31,39 ****
  202.       return 0;
  203.   }
  204.   
  205. ! close_lock(fp)
  206.   FILE *fp;
  207.   {
  208.   #ifdef SYSV
  209.   #ifndef USG
  210.       locking(fileno(fp), LK_UNLCK, 0);
  211. --- 71,87 ----
  212.       return 0;
  213.   }
  214.   
  215. ! void
  216. ! close_lock(filename, fp)
  217. ! char *filename;
  218.   FILE *fp;
  219.   {
  220. + #ifdef DOT_LOCK
  221. +     char buf[MAXPATHLEN];
  222. +     setgid(sgid);
  223. +     (void) unlink(sprintf(buf, "%s.lock", filename));
  224. +     setgid(getgid());
  225. + #endif /* DOT_LOCK */
  226.   #ifdef SYSV
  227.   #ifndef USG
  228.       locking(fileno(fp), LK_UNLCK, 0);
  229. ***************
  230. *** 65,77 ****
  231.       return;
  232.       }
  233.       set_isread(n);
  234. !     if (ison(flg, TOP)) {
  235.       turnon(flg, NO_HEADER);
  236.       print("Top of "), turnon(glob_flags, CONT_PRNT);
  237.       }
  238.   
  239.       if (!istool && isoff(flg, NO_PAGE) &&
  240. !         crt < msg[n].m_lines && isoff(flg, TOP)) {
  241.       char buf[32], *pager = do_set(set_options, "pager");
  242.       if (!pager)
  243.           pager = DEF_PAGER;
  244. --- 113,125 ----
  245.       return;
  246.       }
  247.       set_isread(n);
  248. !     if (ison(flg, M_TOP)) {
  249.       turnon(flg, NO_HEADER);
  250.       print("Top of "), turnon(glob_flags, CONT_PRNT);
  251.       }
  252.   
  253.       if (!istool && isoff(flg, NO_PAGE) &&
  254. !         crt < msg[n].m_lines && isoff(flg, M_TOP)) {
  255.       char buf[32], *pager = do_set(set_options, "pager");
  256.       if (!pager)
  257.           pager = DEF_PAGER;
  258. ***************
  259. *** 105,111 ****
  260.       char       line[BUFSIZ], *show_hdrs = NULL;
  261.   
  262.       still_more = 0;
  263. !     if (ison(flags, TOP)) {
  264.       register char *p = do_set(set_options, "toplines");
  265.       top = (p)? atoi(p) : crt;
  266.       }
  267. --- 153,159 ----
  268.       char       line[BUFSIZ], *show_hdrs = NULL;
  269.   
  270.       still_more = 0;
  271. !     if (ison(flags, M_TOP)) {
  272.       register char *p = do_set(set_options, "toplines");
  273.       top = (p)? atoi(p) : crt;
  274.       }
  275. ***************
  276. *** 184,189 ****
  277. --- 232,239 ----
  278.           if (isoff(msg[n].m_flags, UNREAD) &&
  279.               isoff(msg[n].m_flags, PRESERVE))
  280.               *p++ = 'R';
  281. +         if (ison(msg[n].m_flags, SAVED))
  282. +             *p++ = 'S';
  283.           if (ison(msg[n].m_flags, REPLIED))
  284.               *p++ = 'r';
  285.           *p++ = '\n', *p = 0;
  286. ***************
  287. *** 222,228 ****
  288.           }
  289.           }
  290.       }
  291. !     if (!on_hdr && ison(flags, TOP) && !--top)
  292.           break;
  293.       if (isoff(flags, NO_HEADER)) {
  294.           /* note that function returns the number of lines */
  295. --- 272,278 ----
  296.           }
  297.           }
  298.       }
  299. !     if (!on_hdr && ison(flags, M_TOP) && !--top)
  300.           break;
  301.       if (isoff(flags, NO_HEADER)) {
  302.           /* note that function returns the number of lines */
  303. ***************
  304. *** 261,268 ****
  305.   }
  306.   
  307.   /* get mail from whatever the mailfile points to. open a tempfile for
  308. !  * appending, then close it and reopen it for read-only.  some systems
  309. !  * have flakey read/write access.
  310.    */
  311.   void
  312.   getmail()
  313. --- 311,317 ----
  314.   }
  315.   
  316.   /* get mail from whatever the mailfile points to. open a tempfile for
  317. !  * appending, then close it and reopen it for read-only.
  318.    */
  319.   void
  320.   getmail()
  321. ***************
  322. *** 272,286 ****
  323.       long     ftell(), bytes;
  324.       char    line[BUFSIZ];
  325.   
  326. ! #ifdef SYSV
  327. !     /* for SVID systems to lock, the file must be open for read/write */
  328. !     if (isoff(glob_flags, READ_ONLY))
  329. !     mail_fp = fopen(mailfile, "r+");
  330. !     else
  331. ! #endif /* SYSV */
  332. !     mail_fp = fopen(mailfile, "r");
  333. !     if (!mail_fp) {
  334.       error("Unable to open %s", mailfile);
  335.       return;
  336.       }
  337. --- 321,327 ----
  338.       long     ftell(), bytes;
  339.       char    line[BUFSIZ];
  340.   
  341. !     if (!(mail_fp = fopen(mailfile, "r"))) {
  342.       error("Unable to open %s", mailfile);
  343.       return;
  344.       }
  345. ***************
  346. *** 305,313 ****
  347.       } else if (msg_cnt)
  348.       (void) fseek(tmpf, msg[msg_cnt-1].m_offset+msg[msg_cnt-1].m_size,L_SET);
  349.   
  350. -     if (isoff(glob_flags, READ_ONLY) && lock_file(mailfile, fileno(mail_fp)))
  351. -     error("WARNING: unable to lock %s", mailfile);
  352.       (void) fseek(mail_fp, ftell(tmpf), L_SET);
  353.   
  354.   #ifdef MSG_SEPARATOR
  355. --- 346,351 ----
  356. ***************
  357. *** 345,351 ****
  358.           if (isoff(glob_flags, READ_ONLY)) {
  359.           fputs(line, tmpf);
  360.           if (errno == ENOSPC)
  361. !             fs_error();
  362.           }
  363.           /* we've read the "From " line, now read the rest of
  364.            * the message headers till we get to a blank line.
  365. --- 383,389 ----
  366.           if (isoff(glob_flags, READ_ONLY)) {
  367.           fputs(line, tmpf);
  368.           if (errno == ENOSPC)
  369. !             fs_error(mailfile, mail_fp);
  370.           }
  371.           /* we've read the "From " line, now read the rest of
  372.            * the message headers till we get to a blank line.
  373. ***************
  374. *** 358,363 ****
  375. --- 396,402 ----
  376.               switch(*p) {
  377.                   when 'R': turnoff(msg[msg_cnt].m_flags, UNREAD);
  378.                   when 'P': turnon(msg[msg_cnt].m_flags, UNREAD);
  379. +                 when 'S': turnon(msg[msg_cnt].m_flags, SAVED);
  380.                   when 'r': turnon(msg[msg_cnt].m_flags, REPLIED);
  381.                   otherwise :
  382.                   if (ison(glob_flags, WARNING))
  383. ***************
  384. *** 368,374 ****
  385.           if (isoff(glob_flags, READ_ONLY)) {
  386.               fputs(line, tmpf);
  387.               if (errno == ENOSPC)
  388. !             fs_error();
  389.           }
  390.           }
  391.           msg_cnt++, get_status = 1;
  392. --- 407,413 ----
  393.           if (isoff(glob_flags, READ_ONLY)) {
  394.               fputs(line, tmpf);
  395.               if (errno == ENOSPC)
  396. !             fs_error(mailfile, mail_fp);
  397.           }
  398.           }
  399.           msg_cnt++, get_status = 1;
  400. ***************
  401. *** 377,383 ****
  402.       if (isoff(glob_flags, READ_ONLY)) {
  403.           fputs(line, tmpf);
  404.           if (errno == ENOSPC)
  405. !         fs_error();
  406.       } else
  407.           (void) fseek(tmpf, ftell(mail_fp), L_SET);
  408.       }
  409. --- 416,422 ----
  410.       if (isoff(glob_flags, READ_ONLY)) {
  411.           fputs(line, tmpf);
  412.           if (errno == ENOSPC)
  413. !         fs_error(mailfile, mail_fp);
  414.       } else
  415.           (void) fseek(tmpf, ftell(mail_fp), L_SET);
  416.       }
  417. ***************
  418. *** 387,409 ****
  419.       msg[msg_cnt-1].m_lines = lines;
  420.       }
  421.   
  422. -     close_lock(mail_fp);
  423. -     /* I've had problems with sys-v opening a file for read/write. I'd
  424. -      * try fgets after a seek to an arbitrary place and get NULL. "w+"
  425. -      * could be broken (XENIX), so play it safe anyway.
  426. -      */
  427.       if (isoff(glob_flags, READ_ONLY)) {
  428.       fclose(tmpf);
  429.       if (!(tmpf = fopen(tempfile, "r")))
  430.           error("unable to open %s for reading", tempfile);
  431.       }
  432.   }
  433.   
  434. ! fs_error()
  435.   {
  436.       error("WARNING: unable to write to \"%s\"", tempfile);
  437.       print("Read the manual on what to do on full file systems.\n");
  438.       cleanup(0);
  439.   }
  440.   
  441. --- 426,447 ----
  442.       msg[msg_cnt-1].m_lines = lines;
  443.       }
  444.   
  445.       if (isoff(glob_flags, READ_ONLY)) {
  446.       fclose(tmpf);
  447.       if (!(tmpf = fopen(tempfile, "r")))
  448.           error("unable to open %s for reading", tempfile);
  449.       }
  450. +     fclose(mail_fp);
  451.   }
  452.   
  453. ! void
  454. ! fs_error(mailfile, mail_fp)
  455. ! char *mailfile;
  456. ! FILE *mail_fp;
  457.   {
  458.       error("WARNING: unable to write to \"%s\"", tempfile);
  459.       print("Read the manual on what to do on full file systems.\n");
  460. +     close_lock(mailfile, mail_fp);
  461.       cleanup(0);
  462.   }
  463.   
  464. ***************
  465. *** 413,423 ****
  466.    */
  467.   copyback()
  468.   {
  469. !     register int    new = 0, i, j=0, k=0;
  470.       register long    flg = 0;
  471. !     register FILE    *mbox = NULL_FILE, *mail_fp;
  472.       char        *mbox_file, action = 0;
  473. !     int         hold = 0, delete_it = 0, dont_unlink = FALSE;
  474.   
  475.   #ifdef SUNTOOL
  476.       if (istool) {
  477. --- 451,461 ----
  478.    */
  479.   copyback()
  480.   {
  481. !     register int    new = 0, i=0, j=0, k=0;
  482.       register long    flg = 0;
  483. !     register FILE    *mbox = NULL_FILE, *mail_fp = NULL_FILE;
  484.       char        *mbox_file, action = 0;
  485. !     int         hold = 0, delete_it = 0, dont_unlink = FALSE, keepsave;
  486.   
  487.   #ifdef SUNTOOL
  488.       if (istool) {
  489. ***************
  490. *** 467,472 ****
  491. --- 505,513 ----
  492.           error("Unable to write to %s", mbox_file);
  493.       }
  494.       }
  495. + #ifdef DOT_LOCK
  496. +     if ((i = dot_lock(mailfile)) == 0)
  497. + #endif /* DOT_LOCK */
  498.       /* reopen the mailfile; set umask accordingly */
  499.       {
  500.       int omask = umask(077);
  501. ***************
  502. *** 474,491 ****
  503.       (void) umask(omask);
  504.       if (!mail_fp) {
  505.           error("Unable to rewrite %s", mailfile);
  506.           return 0;
  507.       }
  508.       }
  509. !     turnon(glob_flags, IGN_SIGS);
  510. !     print("Updating \"%s\"", mailfile);
  511. !     if (lock_file(mailfile, fileno(mail_fp)))
  512.       error("WARNING: unable to lock %s", mailfile);
  513.   
  514.       turnon(flg, UPDATE_STATUS);
  515.       turnon(flg, NO_IGNORE);
  516.   
  517.       for (i = 0; i < msg_cnt; i++)
  518.       /* check to see if message is marked for deletion or, if read and not
  519.        * preserved, delete it if autodelete is set. Otherwise, save the
  520. --- 515,544 ----
  521.       (void) umask(omask);
  522.       if (!mail_fp) {
  523.           error("Unable to rewrite %s", mailfile);
  524. +         if (mbox)
  525. +         fclose(mbox);
  526.           return 0;
  527.       }
  528.       }
  529. !     if (i != 0 || lock_file(mailfile, mail_fp) == -1) {
  530. ! #ifndef DOT_LOCK
  531.       error("WARNING: unable to lock %s", mailfile);
  532. + #endif /* DOT_LOCK */
  533. +     if (mail_fp)
  534. +         close_lock(mailfile, mail_fp);
  535. +     if (mbox)
  536. +         fclose(mbox);
  537. +     return 0;
  538. +     }
  539.   
  540. +     print("Updating \"%s\"", mailfile);
  541.       turnon(flg, UPDATE_STATUS);
  542.       turnon(flg, NO_IGNORE);
  543. +     turnon(glob_flags, IGN_SIGS);
  544.   
  545. +     keepsave = !!do_set(set_options, "keepsave");
  546.       for (i = 0; i < msg_cnt; i++)
  547.       /* check to see if message is marked for deletion or, if read and not
  548.        * preserved, delete it if autodelete is set. Otherwise, save the
  549. ***************
  550. *** 492,498 ****
  551.        * message in the spool file if hold is set. If all fails, save in mbox.
  552.        */
  553.       if (ison(msg[i].m_flags, DELETE)
  554. !         || isoff(msg[i].m_flags, UNREAD) && isoff(msg[i].m_flags, PRESERVE) 
  555.           && delete_it) {
  556.           Debug("%s %d",
  557.           (action!='d')? "\ndeleting message:" : "", i+1), action = 'd';
  558. --- 545,553 ----
  559.        * message in the spool file if hold is set. If all fails, save in mbox.
  560.        */
  561.       if (ison(msg[i].m_flags, DELETE)
  562. !     ||  ison(msg[i].m_flags, SAVED) && !keepsave &&
  563. !         isoff(msg[i].m_flags, PRESERVE)
  564. !     ||  isoff(msg[i].m_flags, UNREAD) && isoff(msg[i].m_flags, PRESERVE) 
  565.           && delete_it) {
  566.           Debug("%s %d",
  567.           (action!='d')? "\ndeleting message:" : "", i+1), action = 'd';
  568. ***************
  569. *** 524,531 ****
  570.       }
  571.       Debug("\n%s", mailfile);
  572.   
  573. !     close_lock(mail_fp);
  574.   
  575.       if (mbox)
  576.       fclose(mbox);
  577.       if (j) {
  578. --- 579,594 ----
  579.       }
  580.       Debug("\n%s", mailfile);
  581.   
  582. !     close_lock(mailfile, mail_fp);
  583.   
  584. + #ifdef SUNTOOL
  585. +     if (istool) {
  586. +     mail_timer.it_value.tv_sec = time_out;
  587. +     setitimer(ITIMER_REAL, &mail_timer, NULL);
  588. +     }
  589. + #endif /* SUNTOOL */
  590. +     /* some users like to have zero length folders for frequent usage */
  591.       if (mbox)
  592.       fclose(mbox);
  593.       if (j) {
  594. ***************
  595. *** 534,540 ****
  596.       if (!strcmp(mailfile, spoolfile) && utime(mailfile, times))
  597.           error("utime");
  598.       print_more(": saved %d message%s\n", j, (j==1)? NO_STRING: "s");
  599. !     } else if (strcmp(mailfile, spoolfile) && !dont_unlink && !new)
  600.       if (unlink(mailfile))
  601.           turnon(glob_flags, CONT_PRNT), error(": cannot remove");
  602.       else
  603. --- 597,604 ----
  604.       if (!strcmp(mailfile, spoolfile) && utime(mailfile, times))
  605.           error("utime");
  606.       print_more(": saved %d message%s\n", j, (j==1)? NO_STRING: "s");
  607. !     } else if (strcmp(mailfile, spoolfile) && !dont_unlink && !new &&
  608. !     !do_set(set_options, "save_empty"))
  609.       if (unlink(mailfile))
  610.           turnon(glob_flags, CONT_PRNT), error(": cannot remove");
  611.       else
  612. ***************
  613. *** 542,557 ****
  614.       else
  615.       print_more(": empty\n");
  616.       if (k)
  617. !     print("saved %d message%s in %s\n",k,(k==1)? NO_STRING: "s",mbox_file);
  618.       if (new && !istool)
  619.       print("New mail has arrived.\n");
  620.       turnoff(glob_flags, IGN_SIGS);
  621. ! #ifdef SUNTOOL
  622. !     if (istool) {
  623. !     mail_timer.it_value.tv_sec = time_out;
  624. !     setitimer(ITIMER_REAL, &mail_timer, NULL);
  625. !     }
  626. ! #endif /* SUNTOOL */
  627.       return 1;
  628.   }
  629.   
  630. --- 606,617 ----
  631.       else
  632.       print_more(": empty\n");
  633.       if (k)
  634. !     print("saved %d message%s in %s\n",k,(k==1)? NO_STRING:"s", mbox_file);
  635.       if (new && !istool)
  636.       print("New mail has arrived.\n");
  637.       turnoff(glob_flags, IGN_SIGS);
  638.       return 1;
  639.   }
  640.   
  641. *** OLD/mush.1    Thu May 12 21:14:45 1988
  642. --- mush.1    Tue Jun 28 21:38:26 1988
  643. ***************
  644. *** 167,178 ****
  645.   a database of electronic mail messages under the
  646.   .I UNIX
  647.   environment.
  648. ! There are three user interfaces which allow the user to interact with
  649.   .I Mush.
  650.   The default interface is the conventional tty-based line mode
  651.   similar to command line interpreters such as
  652.   .I csh
  653. ! as well as other mailers, such as University of California, Berkeley's,
  654.   .I Mail
  655.   and Bell Lab's System V
  656.   .I mailx
  657. --- 167,178 ----
  658.   a database of electronic mail messages under the
  659.   .I UNIX
  660.   environment.
  661. ! There are three user interfaces that allow the user to interact with
  662.   .I Mush.
  663.   The default interface is the conventional tty-based line mode
  664.   similar to command line interpreters such as
  665.   .I csh
  666. ! as well as other mailers, such as University of California, Berkeley's
  667.   .I Mail
  668.   and Bell Lab's System V
  669.   .I mailx
  670. ***************
  671. *** 204,210 ****
  672.   See the corresponding sections for more information on the user
  673.   interface desired.
  674.   Most of this manual deals with commands, variables
  675. ! and actions which are common to all three interfaces although
  676.   some attention is paid to individual characteristics of each interface.
  677.   .PP
  678.   The following command line arguments are understood by
  679. --- 204,210 ----
  680.   See the corresponding sections for more information on the user
  681.   interface desired.
  682.   Most of this manual deals with commands, variables
  683. ! and actions that are common to all three interfaces although
  684.   some attention is paid to individual characteristics of each interface.
  685.   .PP
  686.   The following command line arguments are understood by
  687. ***************
  688. *** 215,221 ****
  689.   .TP
  690.   \-c cc-list
  691.   The list of Carbon Copy recipients is set on the command line.
  692. ! If more than one address is specified, the entire list should be encased in
  693.   quotes.
  694.   This applies when sending mail only.
  695.   If you are entering the shell, curses mode, or the tool mode, this option is
  696. --- 215,221 ----
  697.   .TP
  698.   \-c cc-list
  699.   The list of Carbon Copy recipients is set on the command line.
  700. ! If more than one address is specified, the entire list should be enclosed in
  701.   quotes.
  702.   This applies when sending mail only.
  703.   If you are entering the shell, curses mode, or the tool mode, this option is
  704. ***************
  705. *** 229,239 ****
  706.   .TP
  707.   \-F[!] filename
  708.   This file is the same type as the initialization file read on startup
  709. ! (see INITIALIZATION) with the exception that commands which manipulate
  710.   or search messages may be given.  Normally, such commands may not exist
  711.   in the initialization file since that file is read before the folder
  712.   is scanned.  This file is read after the folder is scanned, so commands
  713. ! which change folders are allowed.
  714.   The optional `!' argument prevents the shell from running after the file
  715.   has been sourced.  Otherwise,
  716.   .I Mush
  717. --- 229,239 ----
  718.   .TP
  719.   \-F[!] filename
  720.   This file is the same type as the initialization file read on startup
  721. ! (see INITIALIZATION) with the exception that commands that manipulate
  722.   or search messages may be given.  Normally, such commands may not exist
  723.   in the initialization file since that file is read before the folder
  724.   is scanned.  This file is read after the folder is scanned, so commands
  725. ! that change folders are allowed.
  726.   The optional `!' argument prevents the shell from running after the file
  727.   has been sourced.  Otherwise,
  728.   .I Mush
  729. ***************
  730. *** 269,275 ****
  731.   .I Mush
  732.   commands.
  733.   See the INITIALIZATION section for information on how to
  734. ! write scripts which deal with mail.
  735.   Note that this flag is different from the \*Qignore\*U flag of UCB Mail.
  736.   .TP
  737.   \-N
  738. --- 269,275 ----
  739.   .I Mush
  740.   commands.
  741.   See the INITIALIZATION section for information on how to
  742. ! write scripts that deal with mail.
  743.   Note that this flag is different from the \*Qignore\*U flag of UCB Mail.
  744.   .TP
  745.   \-N
  746. ***************
  747. *** 304,310 ****
  748.   \-s subject
  749.   The subject is set on the command line using this flag.
  750.   If the subject has
  751. ! any spaces or tabs, the entire subject should be encased in quotes.
  752.   This applies when sending mail only.
  753.   If you are entering the shell,
  754.   curses mode, or the tool mode, this option is ignored.
  755. --- 304,310 ----
  756.   \-s subject
  757.   The subject is set on the command line using this flag.
  758.   If the subject has
  759. ! any spaces or tabs, the entire subject should be enclosed in quotes.
  760.   This applies when sending mail only.
  761.   If you are entering the shell,
  762.   curses mode, or the tool mode, this option is ignored.
  763. ***************
  764. *** 395,401 ****
  765.   .I Mush
  766.   has command line history reminiscent of
  767.   .IR csh ,
  768. ! commands which use UUCP's `!' character for user-host and host-host
  769.   separation should be escaped (preceded by a backslash).
  770.   This is not necessary in the initialization file (.mushrc) because history
  771.   referencing is ignored while these files are being sourced.
  772. --- 395,401 ----
  773.   .I Mush
  774.   has command line history reminiscent of
  775.   .IR csh ,
  776. ! commands that use UUCP's `!' character for user-host and host-host
  777.   separation should be escaped (preceded by a backslash).
  778.   This is not necessary in the initialization file (.mushrc) because history
  779.   referencing is ignored while these files are being sourced.
  780. ***************
  781. *** 415,421 ****
  782.   .PP
  783.   .BR "Command Line Aliases" .
  784.   .PP
  785. ! Command aliases are different than mail aliases in that they are used
  786.   to expand to commands.
  787.   The usage of command line aliases is similar to that supplied by
  788.   .IR csh .
  789. --- 415,421 ----
  790.   .PP
  791.   .BR "Command Line Aliases" .
  792.   .PP
  793. ! Command aliases are different from mail aliases in that they are used
  794.   to expand to commands.
  795.   The usage of command line aliases is similar to that supplied by
  796.   .IR csh .
  797. ***************
  798. *** 428,434 ****
  799.   one command to be used as input to the next command in the pipeline.
  800.   However, the output of commands is not the \*Qtext\*U that is returned
  801.   (as it is in
  802. ! .IR csh ),
  803.   but the messages that are affected.
  804.   .PP
  805.   .BR Help .
  806. --- 428,434 ----
  807.   one command to be used as input to the next command in the pipeline.
  808.   However, the output of commands is not the \*Qtext\*U that is returned
  809.   (as it is in
  810. ! .IR csh )
  811.   but the messages that are affected.
  812.   .PP
  813.   .BR Help .
  814. ***************
  815. *** 489,495 ****
  816.   The default system initialization file is read first and then the
  817.   user's personal initialization file is read.
  818.   The system default file
  819. ! is set up by the system administrator and may contain commands which
  820.   should be set system-wide.
  821.   .PP
  822.   The user's file is determined by first looking for the environment variable
  823. --- 489,495 ----
  824.   The default system initialization file is read first and then the
  825.   user's personal initialization file is read.
  826.   The system default file
  827. ! is set up by the system administrator and may contain commands that
  828.   should be set system-wide.
  829.   .PP
  830.   The user's file is determined by first looking for the environment variable
  831. ***************
  832. *** 497,503 ****
  833.   If that file isn't found, then the file
  834.   .I .mushrc
  835.   is searched for in the home directory of the user.
  836. ! If that file cannot be found, it will attempt to read the file,
  837.   .I .mailrc
  838.   from the same directory.
  839.   Finally, if that file cannot be read, no initialization is done
  840. --- 497,503 ----
  841.   If that file isn't found, then the file
  842.   .I .mushrc
  843.   is searched for in the home directory of the user.
  844. ! If that file cannot be found, it will attempt to read the file
  845.   .I .mailrc
  846.   from the same directory.
  847.   Finally, if that file cannot be read, no initialization is done
  848. ***************
  849. *** 550,556 ****
  850.   It may be anywhere on a line in the file.
  851.   When that character is encountered,
  852.   processing of that line is discontinued to the end of the line.
  853. ! If the `#' is encased in quotes (single or double), then it is not
  854.   considered a comment.
  855.   Examples:
  856.   .sp
  857. --- 550,556 ----
  858.   It may be anywhere on a line in the file.
  859.   When that character is encountered,
  860.   processing of that line is discontinued to the end of the line.
  861. ! If the `#' is enclosed in quotes (single or double), then it is not
  862.   considered a comment.
  863.   Examples:
  864.   .sp
  865. ***************
  866. *** 580,586 ****
  867.   The statements associated with an \*Qif\*U expression are never on the same
  868.   line with the conditional.
  869.   .PP
  870. ! Conditional expressions understood include the internal variables,
  871.   .IR istool ,
  872.   .IR iscurses ,
  873.   .IR hdrs_only ,
  874. --- 580,586 ----
  875.   The statements associated with an \*Qif\*U expression are never on the same
  876.   line with the conditional.
  877.   .PP
  878. ! Conditional expressions understood include the internal variables
  879.   .IR istool ,
  880.   .IR iscurses ,
  881.   .IR hdrs_only ,
  882. ***************
  883. *** 613,619 ****
  884.   If \-i is specified, the value for
  885.   .I redirect
  886.   will be set to false.
  887. ! These are internal variables whose values can not be referenced using the
  888.   \*Q$variable\*U method of variable expansion.
  889.   .PP
  890.   The `!' operator may be used to negate expressions, thus,
  891. --- 613,619 ----
  892.   If \-i is specified, the value for
  893.   .I redirect
  894.   will be set to false.
  895. ! These are internal variables whose values cannot be referenced using the
  896.   \*Q$variable\*U method of variable expansion.
  897.   .PP
  898.   The `!' operator may be used to negate expressions, thus,
  899. ***************
  900. *** 666,673 ****
  901.   Like other interactive commands, the
  902.   .B curses
  903.   command itself should never be called from an initialization file.
  904. ! Doing so will cause terminal settings to be set incorrectly and unpredictable
  905. ! results from there.
  906.   See the CURSES INTERFACE section for configuring your
  907.   environment so you enter curses mode each time you run the shell.
  908.   .PP
  909. --- 666,673 ----
  910.   Like other interactive commands, the
  911.   .B curses
  912.   command itself should never be called from an initialization file.
  913. ! Doing so will cause terminal settings to be set incorrectly and cause
  914. ! unpredictable results from there.
  915.   See the CURSES INTERFACE section for configuring your
  916.   environment so you enter curses mode each time you run the shell.
  917.   .PP
  918. ***************
  919. *** 698,703 ****
  920. --- 698,731 ----
  921.   .I less
  922.   normally fails to function correctly
  923.   for the terminal type \*Qadm3a\*U so we don't use it.
  924. + .sp
  925. + Also supported in \*Qif\*U expressions are the test flags \*Q-e\*U
  926. + and \*Q-z\*U.  These flags test to see if a file exists (\*Q-e\*U) or
  927. + if it is zero-length (\*Q-z\*U).
  928. + .sp
  929. + .nf
  930. + .in +2
  931. + set mbox = ~/Mail/mbox
  932. + set newfolder = /usr/spool/mail/$USER
  933. + if -z $newfolder
  934. + .ti +4
  935. + set newfolder = $mbox
  936. + endif
  937. + if -e $newfolder
  938. + .ti +4
  939. + folder $newfolder
  940. + else
  941. + .ti +4
  942. + quit
  943. + endif
  944. + .fi
  945. + .sp
  946. + This sets a new variable called \fBnewfolder\fR to the the user's spool
  947. + mailbox (the system mailbox).  It then tests to see if it is zero length,
  948. + and if it is, resets the variable to the value of the user's \fBmbox\fR
  949. + variable (mbox must be set here).  It then tests to see if the new folder
  950. + exists.  If it does, it changes folders to the new folder.  If it doesn't
  951. + exist, the program exits (via \fBquit\fR).
  952.   .PP
  953.   After sourcing the initialization file,
  954.   .I Mush
  955. ***************
  956. *** 712,718 ****
  957.   variable set, then when the current folder's messages have all been read,
  958.   the messages are sorted according to the value of the
  959.   variable (see the sort entry under the VARIABLES heading for more information).
  960. ! Each message has a number of message header lines which contain information
  961.   about whom the mail is from, the subject of the message, the date it was
  962.   received, and other information about the letter.
  963.   This information is then compiled into a one-line summary for
  964. --- 740,746 ----
  965.   variable set, then when the current folder's messages have all been read,
  966.   the messages are sorted according to the value of the
  967.   variable (see the sort entry under the VARIABLES heading for more information).
  968. ! Each message has a number of message header lines that contain information
  969.   about whom the mail is from, the subject of the message, the date it was
  970.   received, and other information about the letter.
  971.   This information is then compiled into a one-line summary for
  972. ***************
  973. *** 747,753 ****
  974.   the group \*Qunix-wizards\*U (of which the user is an elite
  975.   member) and save them in the file $folder/wizmail.
  976.   Last, the folder will be updated, removing all deleted mail
  977. ! (saved mail may be marked as deleted),
  978.   and the folder is reread and sorted according to the date of the messages.
  979.   .SH "GENERAL USAGE"
  980.   Because there are three different interfaces available to the user,
  981. --- 775,781 ----
  982.   the group \*Qunix-wizards\*U (of which the user is an elite
  983.   member) and save them in the file $folder/wizmail.
  984.   Last, the folder will be updated, removing all deleted mail
  985. ! (saved mail may be marked as deleted)
  986.   and the folder is reread and sorted according to the date of the messages.
  987.   .SH "GENERAL USAGE"
  988.   Because there are three different interfaces available to the user,
  989. ***************
  990. *** 754,760 ****
  991.   the tty characteristics (backspace, kill-word, kill-line, redraw line)
  992.   are simulated identically in all interfaces.
  993.   When the user has to type something, the 4.2BSD style of tty driver interface
  994. ! is simulated whether you're in the window system, the curses mode, the tty-line
  995.   mode, and even on System-V machines.
  996.   This means that backspacing causes a
  997.   backspace-space-backspace effect (erasing the character backspaced over).
  998. --- 782,789 ----
  999.   the tty characteristics (backspace, kill-word, kill-line, redraw line)
  1000.   are simulated identically in all interfaces.
  1001.   When the user has to type something, the 4.2BSD style of tty driver interface
  1002. ! is simulated whether you're in the window system, the curses mode, or
  1003. ! the tty-line
  1004.   mode, and even on System-V machines.
  1005.   This means that backspacing causes a
  1006.   backspace-space-backspace effect (erasing the character backspaced over).
  1007. ***************
  1008. *** 767,788 ****
  1009.   If the message is marked as deleted, then use the 
  1010.   .B undelete
  1011.   command supplied by the interface you are using.
  1012. ! To display a message in line mode, specify a message to be displayed using
  1013.   .BR print ,
  1014.   .BR type ,
  1015.   .BR p ,
  1016.   .BR t ,
  1017. ! or by typing the message number, that message will be printed on the screen.
  1018.   .PP
  1019.   In curses mode, move the cursor over the message you want and type
  1020.   a `t' or `p' to read the message.
  1021. ! The user may \*Qbind\*U other keys to call
  1022. ! the function which displays messages if `t' and `p' are uncomfortable.
  1023.   .PP
  1024.   In the graphics mode, move the mouse over the message you wish to
  1025.   be displayed and select the LEFT mouse button.
  1026. ! If the message you want is not visible (in the header subwindow), you may type
  1027. ! in the message subwindow the number of the message and hit return.
  1028.   That message number will be displayed.
  1029.   .PP
  1030.   In the line or curses mode, if the message has more lines than the variable
  1031. --- 796,817 ----
  1032.   If the message is marked as deleted, then use the 
  1033.   .B undelete
  1034.   command supplied by the interface you are using.
  1035. ! To display a message in line mode, specify the message using
  1036.   .BR print ,
  1037.   .BR type ,
  1038.   .BR p ,
  1039.   .BR t ,
  1040. ! or type a message number to display that message on the screen.
  1041.   .PP
  1042.   In curses mode, move the cursor over the message you want and type
  1043.   a `t' or `p' to read the message.
  1044. ! You may \*Qbind\*U other keys to call
  1045. ! the function that displays messages if `t' and `p' are uncomfortable.
  1046.   .PP
  1047.   In the graphics mode, move the mouse over the message you wish to
  1048.   be displayed and select the LEFT mouse button.
  1049. ! If the message you want is not visible (in the header subwindow), you may type,
  1050. ! in the message subwindow, the number of the message and hit return.
  1051.   That message number will be displayed.
  1052.   .PP
  1053.   In the line or curses mode, if the message has more lines than the variable
  1054. ***************
  1055. *** 842,848 ****
  1056.   For instance, typing \*Q~i\*U (alone on a line) will place a copy
  1057.   of the \*Qcurrent message\*U into your message body.
  1058.   It will not include the message headers of the message, just the body of text
  1059. ! which composes the message.
  1060.   .PP
  1061.   Available
  1062.   .BR "tilde escapes" :
  1063. --- 871,877 ----
  1064.   For instance, typing \*Q~i\*U (alone on a line) will place a copy
  1065.   of the \*Qcurrent message\*U into your message body.
  1066.   It will not include the message headers of the message, just the body of text
  1067. ! that comprises the message.
  1068.   .PP
  1069.   Available
  1070.   .BR "tilde escapes" :
  1071. ***************
  1072. *** 862,868 ****
  1073.   Save the contents of the letter to \*Qdead.letter\*U
  1074.   (unless the `!' is specified) and then clear the message buffer; the user
  1075.   remains in editing mode.
  1076. ! If the variable,
  1077.   .B nosave
  1078.   is set, then `!' need not be specified.
  1079.   .TP
  1080. --- 891,897 ----
  1081.   Save the contents of the letter to \*Qdead.letter\*U
  1082.   (unless the `!' is specified) and then clear the message buffer; the user
  1083.   remains in editing mode.
  1084. ! If the variable
  1085.   .B nosave
  1086.   is set, then `!' need not be specified.
  1087.   .TP
  1088. ***************
  1089. *** 913,923 ****
  1090.   .TP
  1091.   ~S[!]
  1092.   Include [don't include] signature at end of message.
  1093. ! The variables,
  1094.   .B autosign
  1095.   and
  1096.   .B autosign2
  1097. ! describes the file or string to append to the message.
  1098.   See the VARIABLES section for more information on these variables.
  1099.   .TP
  1100.   ~s [subject]
  1101. --- 942,952 ----
  1102.   .TP
  1103.   ~S[!]
  1104.   Include [don't include] signature at end of message.
  1105. ! The variables
  1106.   .B autosign
  1107.   and
  1108.   .B autosign2
  1109. ! describe the file or string to append to the message.
  1110.   See the VARIABLES section for more information on these variables.
  1111.   .TP
  1112.   ~s [subject]
  1113. ***************
  1114. *** 974,980 ****
  1115.   Run the
  1116.   .I Mush
  1117.   command specified by \*Qcommand\*U.
  1118. ! You may not run any command which sends mail.
  1119.   It is inadvisable to change folders at this time
  1120.   since the current message list may be corrupted, but the action is
  1121.   allowed nonetheless to provide flexibility for experienced users.
  1122. --- 1003,1009 ----
  1123.   Run the
  1124.   .I Mush
  1125.   command specified by \*Qcommand\*U.
  1126. ! You may not run any command that sends mail.
  1127.   It is inadvisable to change folders at this time
  1128.   since the current message list may be corrupted, but the action is
  1129.   allowed nonetheless to provide flexibility for experienced users.
  1130. ***************
  1131. *** 993,999 ****
  1132.   .SH "LINE-MODE INTERFACE"
  1133.   In the line-mode, the user is given a prompt to which commands are issued
  1134.   and arguments are passed to commands.
  1135. ! When the user types at the prompt, each line is parsed and words (or,
  1136.   arguments) are separated into an array of strings.
  1137.   This array, also called an
  1138.   .IR "argument vector" ,
  1139. --- 1022,1028 ----
  1140.   .SH "LINE-MODE INTERFACE"
  1141.   In the line-mode, the user is given a prompt to which commands are issued
  1142.   and arguments are passed to commands.
  1143. ! When the user types at the prompt, each line is parsed and words (or
  1144.   arguments) are separated into an array of strings.
  1145.   This array, also called an
  1146.   .IR "argument vector" ,
  1147. ***************
  1148. *** 1036,1042 ****
  1149.   is used in the same manner as in
  1150.   .IR csh .
  1151.   There is a limited implementation of history modification;
  1152. ! supported are the argument selectors which reference
  1153.   command line arguments and \*Q:p\*U (echo, but don't execute the command).
  1154.   .sp
  1155.   Examples:
  1156. --- 1065,1071 ----
  1157.   is used in the same manner as in
  1158.   .IR csh .
  1159.   There is a limited implementation of history modification;
  1160. ! supported are the argument selectors that reference
  1161.   command line arguments and \*Q:p\*U (echo, but don't execute the command).
  1162.   .sp
  1163.   Examples:
  1164. ***************
  1165. *** 1104,1110 ****
  1166.   in a message.
  1167.   A
  1168.   .B "message list"
  1169. ! is defined as the set of messages which the user specifies in a command or
  1170.   the messages a command affects after it is through executing.
  1171.   When one command is piped to another, the effect is that the second command
  1172.   will consider only those messages affected by first command.
  1173. --- 1133,1139 ----
  1174.   in a message.
  1175.   A
  1176.   .B "message list"
  1177. ! is defined as the set of messages that the user specifies in a command or
  1178.   the messages a command affects after it is through executing.
  1179.   When one command is piped to another, the effect is that the second command
  1180.   will consider only those messages affected by first command.
  1181. ***************
  1182. *** 1129,1135 ****
  1183.   .ti +2
  1184.   headers :o | delete
  1185.   .sp
  1186. ! Delete's all old (already read) mail.
  1187.   .PP
  1188.   Because action is taken on mail messages, not files,
  1189.   metacharacters such as `*' and `?' are not expanded to file names as
  1190. --- 1158,1164 ----
  1191.   .ti +2
  1192.   headers :o | delete
  1193.   .sp
  1194. ! Deletes all old (already read) mail.
  1195.   .PP
  1196.   Because action is taken on mail messages, not files,
  1197.   metacharacters such as `*' and `?' are not expanded to file names as
  1198. ***************
  1199. *** 1140,1146 ****
  1200.   commands take
  1201.   .I "message lists"
  1202.   as arguments (a list references one or messages) to take action upon.
  1203. ! To reference message numbers,
  1204.   .I Mush
  1205.   understands the following special syntax:
  1206.   .sp
  1207. --- 1169,1175 ----
  1208.   commands take
  1209.   .I "message lists"
  1210.   as arguments (a list references one or messages) to take action upon.
  1211. ! When referencing message numbers,
  1212.   .I Mush
  1213.   understands the following special syntax:
  1214.   .sp
  1215. ***************
  1216. *** 1200,1206 ****
  1217.   .PP
  1218.   If
  1219.   .I unix
  1220. ! it is not set, or if the command could not be found in the user's PATH
  1221.   environment, a message will be printed indicating that the command was
  1222.   not found.
  1223.   .PP
  1224. --- 1229,1235 ----
  1225.   .PP
  1226.   If
  1227.   .I unix
  1228. ! is not set, or if the command could not be found in the user's PATH
  1229.   environment, a message will be printed indicating that the command was
  1230.   not found.
  1231.   .PP
  1232. ***************
  1233. *** 1209,1216 ****
  1234.   commands, piping is disallowed either to or from such commands.
  1235.   If the user wishes to execute
  1236.   .I UNIX
  1237. ! commands which are to be piped to one another (or use any sort of redirection),
  1238. ! the command,
  1239.   .B sh
  1240.   is provided for such purposes.
  1241.   Since
  1242. --- 1238,1245 ----
  1243.   commands, piping is disallowed either to or from such commands.
  1244.   If the user wishes to execute
  1245.   .I UNIX
  1246. ! commands that are to be piped to one another (or use any sort of redirection),
  1247. ! the command
  1248.   .B sh
  1249.   is provided for such purposes.
  1250.   Since
  1251. ***************
  1252. *** 1256,1262 ****
  1253.   If you want to enter curses mode even if
  1254.   you don't have mail, use the \-S option on the command line.
  1255.   .PP
  1256. ! In curses mode, the user's terminal has it's \*Qecho\*U turned off so commands
  1257.   that are issued are not echoed on the screen.
  1258.   Certain commands cause the mode
  1259.   to return to normal for typing purposes (sending mail, for example).
  1260. --- 1285,1291 ----
  1261.   If you want to enter curses mode even if
  1262.   you don't have mail, use the \-S option on the command line.
  1263.   .PP
  1264. ! In curses mode, the user's terminal has its \*Qecho\*U turned off so commands
  1265.   that are issued are not echoed on the screen.
  1266.   Certain commands cause the mode
  1267.   to return to normal for typing purposes (sending mail, for example).
  1268. ***************
  1269. *** 1273,1279 ****
  1270.   Note that the top line is reserved for \*Qstatus\*U and the bottom line is
  1271.   for user interaction should it be required.
  1272.   .PP
  1273. ! The user may now type commands via key sequences which are not echoed
  1274.   to the screen.
  1275.   Thus, function keys may be bound to \*Qcommands\*U by using the 
  1276.   .B bind
  1277. --- 1302,1308 ----
  1278.   Note that the top line is reserved for \*Qstatus\*U and the bottom line is
  1279.   for user interaction should it be required.
  1280.   .PP
  1281. ! The user may now type commands via key sequences that are not echoed
  1282.   to the screen.
  1283.   Thus, function keys may be bound to \*Qcommands\*U by using the 
  1284.   .B bind
  1285. ***************
  1286. *** 1334,1340 ****
  1287.   lines of a message.
  1288.   Next will print the next message.
  1289.   If the current message is deleted, the next undeleted message is found.
  1290. ! You might notice this is different than the line mode, which will return
  1291.   an error message that the current message is marked as deleted.
  1292.   .TP
  1293.   +, j, J, RETURN
  1294. --- 1363,1369 ----
  1295.   lines of a message.
  1296.   Next will print the next message.
  1297.   If the current message is deleted, the next undeleted message is found.
  1298. ! You might notice this is different from the line mode, which will return
  1299.   an error message that the current message is marked as deleted.
  1300.   .TP
  1301.   +, j, J, RETURN
  1302. ***************
  1303. *** 1367,1373 ****
  1304.   When the \*Qgoto\*U command
  1305.   is selected, a prompt at the bottom of the window prompts for a
  1306.   .BR "message list" .
  1307. ! Anything which describes a message list may be used.
  1308.   Since
  1309.   .I Mush
  1310.   commands return message lists, a legal
  1311. --- 1396,1402 ----
  1312.   When the \*Qgoto\*U command
  1313.   is selected, a prompt at the bottom of the window prompts for a
  1314.   .BR "message list" .
  1315. ! Anything that describes a message list may be used.
  1316.   Since
  1317.   .I Mush
  1318.   commands return message lists, a legal
  1319. ***************
  1320. *** 1504,1510 ****
  1321.   .PP
  1322.   To specify control characters in ascii format for the bind command, the
  1323.   sequence \*Q\\Cc\*U is used where `c' is the
  1324. ! character which the control key will translate to and must be in upper case.
  1325.   The sequence \*Q\\CP\*U would map to control-P.
  1326.   If the user wishes to indicate the RETURN key, this is specified
  1327.   with the string \*Q\\n\*U and
  1328. --- 1533,1539 ----
  1329.   .PP
  1330.   To specify control characters in ascii format for the bind command, the
  1331.   sequence \*Q\\Cc\*U is used where `c' is the
  1332. ! character that the control key will translate to and must be in upper case.
  1333.   The sequence \*Q\\CP\*U would map to control-P.
  1334.   If the user wishes to indicate the RETURN key, this is specified
  1335.   with the string \*Q\\n\*U and
  1336. ***************
  1337. *** 1513,1521 ****
  1338.   outputs the three characters: control-A, H, line-feed.
  1339.   To map this function key to a command, the
  1340.   user would have to enter the sequence \*Q\\CAH\\n\*U as the key sequence,
  1341. ! then follow up with a valid curses command.
  1342. ! From then on, if the user presses that function key,
  1343. ! then the command mapped to it will be executed.
  1344.   .PP
  1345.   The ESCAPE key is signified by the sequence, \*Q\\E\*U.
  1346.   On a Sun-3 workstation,
  1347. --- 1542,1550 ----
  1348.   outputs the three characters: control-A, H, line-feed.
  1349.   To map this function key to a command, the
  1350.   user would have to enter the sequence \*Q\\CAH\\n\*U as the key sequence,
  1351. ! then follow up with a valid curses command.  From then on, if the user
  1352. ! presses that function key,
  1353. ! the command mapped to it will be executed.
  1354.   .PP
  1355.   The ESCAPE key is signified by the sequence, \*Q\\E\*U.
  1356.   On a Sun-3 workstation,
  1357. ***************
  1358. *** 1527,1534 ****
  1359.   unless bound in line mode, and can never begin with a digit.
  1360.   .PP
  1361.   Whenever a command is entered, other than `^L'
  1362. ! .RB ( redraw ),
  1363. ! that causes the screen to scroll or be refreshed in any way,
  1364.   .I Mush
  1365.   is left in the
  1366.   .I continue
  1367. --- 1556,1563 ----
  1368.   unless bound in line mode, and can never begin with a digit.
  1369.   .PP
  1370.   Whenever a command is entered, other than `^L'
  1371. ! .RB ( redraw )
  1372. ! which causes the screen to scroll or be refreshed in any way,
  1373.   .I Mush
  1374.   is left in the
  1375.   .I continue
  1376. ***************
  1377. *** 1577,1583 ****
  1378.   .PP
  1379.   At the end of each list of menu entries for panel items is an item
  1380.   labelled \*Qhelp\*U.
  1381. ! When this item is chosen, help with that command
  1382.   is displayed in the center of the console.
  1383.   .PP
  1384.   When composing letters, the interface is the same for the tool mode,
  1385. --- 1606,1612 ----
  1386.   .PP
  1387.   At the end of each list of menu entries for panel items is an item
  1388.   labelled \*Qhelp\*U.
  1389. ! When this item is chosen, help for that command
  1390.   is displayed in the center of the console.
  1391.   .PP
  1392.   When composing letters, the interface is the same for the tool mode,
  1393. ***************
  1394. *** 1609,1615 ****
  1395.   facility allows users to customize
  1396.   .I Mush
  1397.   to resemble other mailers.
  1398. ! However, efforts have already been made to include commands which are backwards
  1399.   compatible with other line-mode mailers.
  1400.   Users of the graphics tool mode of
  1401.   .I Mush
  1402. --- 1638,1644 ----
  1403.   facility allows users to customize
  1404.   .I Mush
  1405.   to resemble other mailers.
  1406. ! However, efforts have already been made to include commands that are backwards
  1407.   compatible with other line-mode mailers.
  1408.   Users of the graphics tool mode of
  1409.   .I Mush
  1410. ***************
  1411. *** 1656,1672 ****
  1412.   control the program makes while executing.
  1413.   The intent of the debug level is for tracking down
  1414.   bugs with the program at specific locations.
  1415. ! Periodically, the program may segmentation fault and core dump.
  1416.   When this happens, the user can reenter the program,
  1417.   set the debugging level and recreate the problem.
  1418.   .sp
  1419.   If the user suspects memory allocation problems, a debugging
  1420. ! level of 2 or higher will prevent memory from being freed causing no
  1421. ! overwriting of memory bounds.
  1422.   .sp
  1423.   If the user suspects sendmail errors,
  1424.   a debugging level of 3 or higher will prevent sendmail from starting
  1425. ! and outgoing mail is sent to the standard output instead of actually
  1426.   being sent.
  1427.   .TP
  1428.   .BR delete / undelete
  1429. --- 1685,1701 ----
  1430.   control the program makes while executing.
  1431.   The intent of the debug level is for tracking down
  1432.   bugs with the program at specific locations.
  1433. ! Occasionally, the program may segmentation fault and core dump.
  1434.   When this happens, the user can reenter the program,
  1435.   set the debugging level and recreate the problem.
  1436.   .sp
  1437.   If the user suspects memory allocation problems, a debugging
  1438. ! level of 2 or higher will prevent memory from being freed so that
  1439. ! memory bounds won't get overwritten.
  1440.   .sp
  1441.   If the user suspects sendmail errors,
  1442.   a debugging level of 3 or higher will prevent sendmail from starting
  1443. ! and outgoing mail is directed to the standard output instead of actually
  1444.   being sent.
  1445.   .TP
  1446.   .BR delete / undelete
  1447. ***************
  1448. *** 1688,1694 ****
  1449.   .TP
  1450.   .B exit
  1451.   .RB ( x )
  1452. ! Effects an immediate return to the login shell without
  1453.   modifying the current folder or system spool directory.
  1454.   .TP
  1455.   .B expand
  1456. --- 1717,1723 ----
  1457.   .TP
  1458.   .B exit
  1459.   .RB ( x )
  1460. ! Returns immediately to the login shell without
  1461.   modifying the current folder or system spool directory.
  1462.   .TP
  1463.   .B expand
  1464. ***************
  1465. *** 1704,1710 ****
  1466.   command, but the whole process is automated by using the function key
  1467.   interface provided by the graphics mode.
  1468.   By default, the last key in each function key pad displays
  1469. ! the values of all the function keys in that set of function keys.
  1470.   There are the left, right and top set of keys.
  1471.   .TP
  1472.   .BR folder " [\-N] [\-r] [!] [ %[user] | # | & | file ]"
  1473. --- 1733,1739 ----
  1474.   command, but the whole process is automated by using the function key
  1475.   interface provided by the graphics mode.
  1476.   By default, the last key in each function key pad displays
  1477. ! the values of all the function keys in that set.
  1478.   There are the left, right and top set of keys.
  1479.   .TP
  1480.   .BR folder " [\-N] [\-r] [!] [ %[user] | # | & | file ]"
  1481. ***************
  1482. *** 1736,1748 ****
  1483.   .TP
  1484.   .BR from " [ + | \- ]"
  1485.   .RB ( f )
  1486. ! With no arguments, from will print the current message's header.
  1487.   If given a message list, from will print the headers of those
  1488. ! messages which are in the list.
  1489.   .sp
  1490.   The special arguments `\-' and `+' can be given to move the
  1491. ! current message pointer to the previous or next message
  1492. ! respectively while also printing that message's header.
  1493.   If a message list was given in addition to `\-' or `+', then
  1494.   the current message pointer will be set to the first or last
  1495.   message, respectively, in the message list given.
  1496. --- 1765,1779 ----
  1497.   .TP
  1498.   .BR from " [ + | \- ]"
  1499.   .RB ( f )
  1500. ! With no arguments,
  1501. ! .I from
  1502. ! will print the current message's header.
  1503.   If given a message list, from will print the headers of those
  1504. ! messages that are in the list.
  1505.   .sp
  1506.   The special arguments `\-' and `+' can be given to move the
  1507. ! current message pointer to the previous or next message,
  1508. ! respectively, while also printing that message's header.
  1509.   If a message list was given in addition to `\-' or `+', then
  1510.   the current message pointer will be set to the first or last
  1511.   message, respectively, in the message list given.
  1512. ***************
  1513. *** 1802,1808 ****
  1514.   The next two positions indicate the message status.
  1515.   The first
  1516.   may be one of, \*QN\*U (new and unread), \*QU\*U (old, but still
  1517. ! unread), \*Q*\*U (deleted), \*QO\*U (old and read), \*QP\*U (preserved),
  1518.   or \*Q \*U (read).
  1519.   The second position may have an \*Qr\*U if the message
  1520.   has been replied to.
  1521. --- 1833,1839 ----
  1522.   The next two positions indicate the message status.
  1523.   The first
  1524.   may be one of, \*QN\*U (new and unread), \*QU\*U (old, but still
  1525. ! unread), \*Q*\*U (deleted), \*QS\*U (saved), \*QP\*U (preserved),
  1526.   or \*Q \*U (read).
  1527.   The second position may have an \*Qr\*U if the message
  1528.   has been replied to.
  1529. ***************
  1530. *** 1817,1823 ****
  1531.   .I 278
  1532.   and the subject of the message is
  1533.   .IR Test .
  1534. ! The format of the message header exemplified here is described by
  1535.   the string variable
  1536.   .BR hdr_format .
  1537.   The example given above has a hdr_format of
  1538. --- 1848,1854 ----
  1539.   .I 278
  1540.   and the subject of the message is
  1541.   .IR Test .
  1542. ! The format of the message header shown here is described by
  1543.   the string variable
  1544.   .BR hdr_format .
  1545.   The example given above has a hdr_format of
  1546. ***************
  1547. *** 1835,1846 ****
  1548.   .nf
  1549.   .in +2
  1550.   .ta 1i
  1551. ! n    new messages
  1552. ! d    deleted messages
  1553. ! u    unread messages
  1554. ! o    old messages
  1555. ! r    replied to messages
  1556. ! a    all messages
  1557.   .fi
  1558.   .in -2
  1559.   .sp
  1560. --- 1866,1879 ----
  1561.   .nf
  1562.   .in +2
  1563.   .ta 1i
  1564. ! .if t .ta 1.5i
  1565. ! n       new messages
  1566. ! d       deleted messages
  1567. ! u       unread messages
  1568. ! o       old messages
  1569. ! r       replied to messages
  1570. ! s       saved messages
  1571. ! a       all messages
  1572.   .fi
  1573.   .in -2
  1574.   .sp
  1575. ***************
  1576. *** 1854,1860 ****
  1577.   The
  1578.   .B z
  1579.   command can also be used; `z' alone will print the next
  1580. ! screenful (thus, the `+' is optional),
  1581.   and \*Qz \-\*U is equivalent to \*Qh \-\*U.
  1582.   .sp
  1583.   Headers affects all the messages it displays, so piping may be done
  1584. --- 1887,1893 ----
  1585.   The
  1586.   .B z
  1587.   command can also be used; `z' alone will print the next
  1588. ! screenful (thus, the `+' is optional)
  1589.   and \*Qz \-\*U is equivalent to \*Qh \-\*U.
  1590.   .sp
  1591.   Headers affects all the messages it displays, so piping may be done
  1592. ***************
  1593. *** 1961,1967 ****
  1594.   Mailing to programs is indicated by the pipe `|' character preceding the
  1595.   program name.
  1596.   Since the user's path is searched, full pathnames are not required for
  1597. ! programs which lie in the user's PATH environment variable.
  1598.   Example:
  1599.   .sp
  1600.   .ti +2
  1601. --- 1994,2000 ----
  1602.   Mailing to programs is indicated by the pipe `|' character preceding the
  1603.   program name.
  1604.   Since the user's path is searched, full pathnames are not required for
  1605. ! programs that lie in the user's PATH environment variable.
  1606.   Example:
  1607.   .sp
  1608.   .ti +2
  1609. ***************
  1610. *** 1993,2003 ****
  1611.   The included message is indented by
  1612.   the string \*Q> \*U or by the string described by the variables
  1613.   .BR indent_str ,
  1614. ! .BR pre_indent-str ,
  1615.   and
  1616.   .BR post_indent_str .
  1617.   See the VARIABLES section for more information on these string values.
  1618. ! If a message list is given after the \-i option, then the message
  1619.   described by that list are included.
  1620.   The \-h option is identical to the \-i option except that the headers of
  1621.   the message are also included.
  1622. --- 2026,2036 ----
  1623.   The included message is indented by
  1624.   the string \*Q> \*U or by the string described by the variables
  1625.   .BR indent_str ,
  1626. ! .BR pre_indent_str ,
  1627.   and
  1628.   .BR post_indent_str .
  1629.   See the VARIABLES section for more information on these string values.
  1630. ! If a message list is given after the \-i option, then the messages
  1631.   described by that list are included.
  1632.   The \-h option is identical to the \-i option except that the headers of
  1633.   the message are also included.
  1634. ***************
  1635. *** 2025,2037 ****
  1636.   The forward option does not allow you to edit the message(s) being forwarded
  1637.   unless the -e flag is also specified.
  1638.   The subject of the message (if available) is the same as the \fIcurrent\f
  1639. ! message; it not necessarily the message of the message being forwarded.
  1640.   The subject of forwarded mail cannot be changed.
  1641.   However, using the \-e flag
  1642.   will allow the user to change the subject once in editing mode using the
  1643.   escape sequence, \*Q~s\*U.
  1644.   .sp
  1645. ! Forwarded mail that has not been edited by the user will contains special
  1646.   headers such as
  1647.   .sp
  1648.   .ti +2
  1649. --- 2058,2070 ----
  1650.   The forward option does not allow you to edit the message(s) being forwarded
  1651.   unless the -e flag is also specified.
  1652.   The subject of the message (if available) is the same as the \fIcurrent\f
  1653. ! message; it is not necessarily the subject of the message being forwarded.
  1654.   The subject of forwarded mail cannot be changed.
  1655.   However, using the \-e flag
  1656.   will allow the user to change the subject once in editing mode using the
  1657.   escape sequence, \*Q~s\*U.
  1658.   .sp
  1659. ! Forwarded mail that has not been edited by the user will contain special
  1660.   headers such as
  1661.   .sp
  1662.   .ti +2
  1663. ***************
  1664. *** 2039,2045 ****
  1665.   .ti +2
  1666.   Resent-From:
  1667.   .sp
  1668. ! and perhaps other depending on your mail transport agent.
  1669.   Sendmail, for example, will add a number of other \*QResent-*\*U headers.
  1670.   .TP
  1671.   .BR my_hdr / un_hdr
  1672. --- 2072,2078 ----
  1673.   .ti +2
  1674.   Resent-From:
  1675.   .sp
  1676. ! and perhaps others, depending on your mail transport agent.
  1677.   Sendmail, for example, will add a number of other \*QResent-*\*U headers.
  1678.   .TP
  1679.   .BR my_hdr / un_hdr
  1680. ***************
  1681. *** 2090,2103 ****
  1682.   Options:
  1683.   .ta 1.5i
  1684.   .in +2
  1685. - \-d [+-]date    messages sent on or [+ after] [`\-' before] date.
  1686.   \-ago <format>    search for messages relative to today's date.
  1687.   \-f    search for pattern in \*QFrom\*U field only.
  1688.   \-i    ignore case of letters when searching.
  1689.   \-r msg_list    search only the listed messages.
  1690.   \-s    search for pattern in \*QSubject\*U field only.
  1691.   \-t    search for pattern in \*QTo\*U field only.
  1692. - \-h header    search for pattern in specified header only.
  1693.   \-x    select messages not containing the pattern.
  1694.   .in -2
  1695.   .fi
  1696. --- 2123,2136 ----
  1697.   Options:
  1698.   .ta 1.5i
  1699.   .in +2
  1700.   \-ago <format>    search for messages relative to today's date.
  1701. + \-d [+-]date    messages sent on or [+ after] [`\-' before] date.
  1702.   \-f    search for pattern in \*QFrom\*U field only.
  1703. + \-h header    search for pattern in specified header only.
  1704.   \-i    ignore case of letters when searching.
  1705.   \-r msg_list    search only the listed messages.
  1706.   \-s    search for pattern in \*QSubject\*U field only.
  1707.   \-t    search for pattern in \*QTo\*U field only.
  1708.   \-x    select messages not containing the pattern.
  1709.   .in -2
  1710.   .fi
  1711. ***************
  1712. *** 2149,2155 ****
  1713.   required, use the \-d option and specify specific dates.
  1714.   .sp
  1715.   Also note that the -ago option allows the \*Qbefore\*U (-) and \*Qafter\*U (+)
  1716. ! arguments.  Thus, you may pick for all messages older than 1 week with:
  1717.   .sp
  1718.   .ti +2
  1719.   pick -ago -1 week
  1720. --- 2182,2188 ----
  1721.   required, use the \-d option and specify specific dates.
  1722.   .sp
  1723.   Also note that the -ago option allows the \*Qbefore\*U (-) and \*Qafter\*U (+)
  1724. ! arguments.  Thus, you may pick all messages older than 1 week with:
  1725.   .sp
  1726.   .ti +2
  1727.   pick -ago -1 week
  1728. ***************
  1729. *** 2160,2167 ****
  1730.   .ti +2
  1731.   pick \-d 2/5/86 | pick \-d \-2/5/87 | pick \-s "mail stuff" | lpr
  1732.   .sp
  1733. ! will find all the messages between the dates February 5, 1986 and
  1734. ! February 5, 1987 that contain the subject "mail stuff" and send them
  1735.   to the printer.
  1736.   .sp
  1737.   .ti +2
  1738. --- 2193,2200 ----
  1739.   .ti +2
  1740.   pick \-d 2/5/86 | pick \-d \-2/5/87 | pick \-s "mail stuff" | lpr
  1741.   .sp
  1742. ! will find all the messages between the dates February 5, 1986, and
  1743. ! February 5, 1987, that contain the subject "mail stuff" and send them
  1744.   to the printer.
  1745.   .sp
  1746.   .ti +2
  1747. ***************
  1748. *** 2201,2210 ****
  1749.   .BR type ,
  1750.   .BR t )
  1751.   Takes a message list and displays each message on the user's terminal.
  1752. ! If the first letter of the command is a capital letter (`P' or `T'),
  1753.   then \*Qignored\*U headers are not ignored
  1754.   .I provided
  1755. ! that the variable,
  1756.   .B alwaysignore
  1757.   is not set.
  1758.   If the variable is set, the ignored headers will be
  1759. --- 2234,2243 ----
  1760.   .BR type ,
  1761.   .BR t )
  1762.   Takes a message list and displays each message on the user's terminal.
  1763. ! If the first letter of the command is a capital letter (`P' or `T')
  1764.   then \*Qignored\*U headers are not ignored
  1765.   .I provided
  1766. ! that the variable
  1767.   .B alwaysignore
  1768.   is not set.
  1769.   If the variable is set, the ignored headers will be
  1770. ***************
  1771. *** 2227,2233 ****
  1772.   .IR Mush .
  1773.   If the variable \*Qhold\*U is set, all messages not marked for deletion are
  1774.   saved in the spool directory.
  1775. ! Otherwise, messages which have been read are saved to
  1776.   .I ~/mbox
  1777.   or to the file described by the string variable
  1778.   .BR mbox .
  1779. --- 2260,2266 ----
  1780.   .IR Mush .
  1781.   If the variable \*Qhold\*U is set, all messages not marked for deletion are
  1782.   saved in the spool directory.
  1783. ! Otherwise, messages that have been read are saved to
  1784.   .I ~/mbox
  1785.   or to the file described by the string variable
  1786.   .BR mbox .
  1787. ***************
  1788. *** 2252,2258 ****
  1789.