home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume37 / remind / patch06 / patch.06
Encoding:
Text File  |  1993-05-04  |  45.2 KB  |  1,417 lines

  1. Prereq: "03.00.05"
  2. *** ../p5rel/version.h    Thu Apr 22 10:24:22 1993
  3. --- ./version.h    Fri Apr 23 12:59:49 1993
  4. ***************
  5. *** 9,12 ****
  6.   /*                                                             */
  7.   /***************************************************************/
  8.   
  9. ! #define VERSION "03.00.05"
  10. --- 9,12 ----
  11.   /*                                                             */
  12.   /***************************************************************/
  13.   
  14. ! #define VERSION "03.00.06"
  15. *** ../p5rel/COPYRIGHT    Thu Apr 22 10:24:02 1993
  16. --- ./COPYRIGHT    Mon May  3 10:13:51 1993
  17. ***************
  18. *** 30,38 ****
  19.   1993 by David Skoll.  These programs can be distributed according to
  20.   the terms of paragraphs 3 and 4.
  21.   
  22. ! 7. I will attempt to support REMIND as much as possible.  However, you
  23. ! use it at your own risk.  I am not responsible for any damages caused
  24. ! by the use or misuse of REMIND.
  25.   
  26.   8. If you wish to contribute ideas or money to help the production of
  27.   software like REMIND, you can reply to the address shown at the end of
  28. --- 30,39 ----
  29.   1993 by David Skoll.  These programs can be distributed according to
  30.   the terms of paragraphs 3 and 4.
  31.   
  32. ! 7. I will attempt to support REMIND as much as possible.  However,
  33. ! REMIND is supplied on an "as-is" basis with no warranty.  You use it
  34. ! at your own risk.  I am not responsible for any damages caused by the
  35. ! use or misuse of REMIND.
  36.   
  37.   8. If you wish to contribute ideas or money to help the production of
  38.   software like REMIND, you can reply to the address shown at the end of
  39. *** ../p5rel/Makefile    Thu Apr 22 10:24:10 1993
  40. --- ./Makefile    Fri Apr 23 13:00:44 1993
  41. ***************
  42. *** 46,52 ****
  43.   # YOU SHOULDN'T EDIT ANYTHING BELOW HERE.  You may want to change some things
  44.   # in config.h; then, you should be able to type 'make'.
  45.   #-----------------------------------------------------------------------------
  46. ! VERSION= 03.00.05
  47.   
  48.   HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \
  49.   lang.h english.h german.h dutch.h finnish.h
  50. --- 46,52 ----
  51.   # YOU SHOULDN'T EDIT ANYTHING BELOW HERE.  You may want to change some things
  52.   # in config.h; then, you should be able to type 'make'.
  53.   #-----------------------------------------------------------------------------
  54. ! VERSION= 03.00.06
  55.   
  56.   HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \
  57.   lang.h english.h german.h dutch.h finnish.h
  58. ***************
  59. *** 105,112 ****
  60.   var.o: var.c $(STDHDRS) expr.h
  61.   
  62.   tarZ:
  63. !     tar cvf remind-3.0.5.tar $(MANIFEST)
  64. !     compress -v remind-3.0.5.tar
  65.   
  66.   shar:
  67.       shar -x -n"Remind $(VERSION)" -l45 -o./Shar $(MANIFEST)
  68. --- 105,112 ----
  69.   var.o: var.c $(STDHDRS) expr.h
  70.   
  71.   tarZ:
  72. !     tar cvf remind-3.0.6.tar $(MANIFEST)
  73. !     compress -v remind-3.0.6.tar
  74.   
  75.   shar:
  76.       shar -x -n"Remind $(VERSION)" -l45 -o./Shar $(MANIFEST)
  77. *** ../p5rel/WHATSNEW.30    Thu Apr 22 10:24:22 1993
  78. --- ./WHATSNEW.30    Mon May  3 11:00:51 1993
  79. ***************
  80. *** 1,5 ****
  81. --- 1,28 ----
  82.   CHANGES TO REMIND
  83.   
  84. + * Version 3.0 Patch 6
  85. + + MINOR ENHANCEMENTS
  86. + - Added the PS- and PSFILE-type reminders - these allow you to include
  87. +   arbitrary PostScript code in your PostScript calendars.  Useful for
  88. +   shading, drawing graphics on calendars, etc.  Use with care, though!
  89. + - Added the "-ivar=val" option to initialize variables from the command
  90. +   line.  Changed the remind-all.* shell scripts to predefine the variable
  91. +   "remind_all".
  92. + + BUG FIXES
  93. + - Fixed a bug in the hebmon(), hebday() and hebyear() functions - there
  94. +   was an off-by-one error.  Sorry!
  95. + - Fixed a bug in the hebdate() function which resulted in infinite loops
  96. +   for dates after about 2075
  97. + - Fixed a bug in the -u option which sometimes caused a core dump
  98. +   (embarrassed grin!)  The fix is due to Tina Hoeltig.  Thanks, Tina!
  99.   * Version 3.0 Patch 5
  100.   
  101.   + MAJOR ENHANCEMENTS:
  102. *** ../p5rel/calendar.c    Thu Apr 22 10:24:00 1993
  103. --- ./calendar.c    Mon May  3 12:01:29 1993
  104. ***************
  105. *** 33,38 ****
  106. --- 33,39 ----
  107.   
  108.   /* Global variables */
  109.   static CalEntry *CalColumn[7];
  110. + static CalEntry *CalPs[7];
  111.   
  112.   static int ColSpaces;
  113.   
  114. ***************
  115. *** 614,619 ****
  116. --- 615,621 ----
  117.      int r;
  118.      int jul;
  119.      CalEntry *CurCol = CalColumn[col];
  120. +    CalEntry *CurPs = CalPs[col];
  121.      CalEntry *e;
  122.      char *s;
  123.   
  124. ***************
  125. *** 626,635 ****
  126. --- 628,642 ----
  127.   #endif
  128.      if (trig.typ == NO_TYPE) return E_EOLN;
  129.      if (trig.typ == SAT_TYPE) return DoSatRemind(&trig, &tim, p);
  130.      /* Calculate the trigger date */
  131.      jul = ComputeTrigger(trig.scanfrom, &trig, &r);
  132.      if (r) return r;
  133. +    if (!PsCal && (trig.typ == PS_TYPE || trig.typ == PSF_TYPE)) return OK;
  134.   
  135. +    /* Remove any "at" times from PS or PSFILE reminders */
  136. +    if (trig.typ == PS_TYPE || trig.typ == PSF_TYPE) tim.ttime = NO_TIME;
  137.      /* If trigger date == today, add it to the current entry */   
  138.      if (jul == JulianToday) {
  139.         s = SubstBuffer;
  140. ***************
  141. *** 646,656 ****
  142.            free(e);
  143.        return E_NO_MEM;
  144.         }
  145. !       e->pos = e->text;
  146. !       e->time = tim.ttime;
  147. !       e->next = CurCol;
  148. !       CalColumn[col] = e;
  149. !       SortColByTime(col);
  150.      }
  151.      return OK;
  152.   }
  153. --- 653,670 ----
  154.            free(e);
  155.        return E_NO_MEM;
  156.         }
  157. !       if (trig.typ == PS_TYPE || trig.typ == PSF_TYPE) {
  158. !          e->pos = (trig.typ == PS_TYPE) ? "P" : "F";
  159. !      e->time = NO_TIME;
  160. !      e->next = CurPs;
  161. !      CalPs[col] = e;
  162. !       } else {
  163. !          e->pos = e->text;
  164. !          e->time = tim.ttime;
  165. !          e->next = CurCol;
  166. !          CalColumn[col] = e;
  167. !          SortColByTime(col);
  168. !       }
  169.      }
  170.      return OK;
  171.   }
  172. ***************
  173. *** 669,679 ****
  174.   int col, jul;
  175.   #endif
  176.   {
  177. !    CalEntry *e = CalColumn[col];
  178.      CalEntry *n;
  179.      int y, m, d;
  180.   
  181.      FromJulian(jul, &y, &m, &d);
  182.      while(e) {
  183.         printf("%04d%c%02d%c%02d ", y, DATESEP, m+1, DATESEP, d);
  184.         printf("%s\n", e->text);
  185. --- 683,707 ----
  186.   int col, jul;
  187.   #endif
  188.   {
  189. !    CalEntry *e = CalPs[col];
  190.      CalEntry *n;
  191.      int y, m, d;
  192.   
  193. + /* Do all the PostScript entries first, if any */
  194.      FromJulian(jul, &y, &m, &d);
  195. +    while(e) {
  196. +       printf("%c%c%c%c%c%02d%c%02d ", *(e->pos), *(e->pos),
  197. +                                      *(e->pos), *(e->pos), DATESEP,
  198. +                      m+1, DATESEP, d);
  199. +       printf("%s\n", e->text);
  200. +       free(e->text);
  201. +       n = e->next;
  202. +       free(e);
  203. +       e = n;
  204. +    }
  205. +    CalPs[col] = NULL;
  206. +    e = CalColumn[col];                     
  207.      while(e) {
  208.         printf("%04d%c%02d%c%02d ", y, DATESEP, m+1, DATESEP, d);
  209.         printf("%s\n", e->text);
  210. *** ../p5rel/defs.rem    Thu Apr 22 10:24:03 1993
  211. --- ./defs.rem    Mon May  3 10:29:12 1993
  212. ***************
  213. *** 13,18 ****
  214. --- 13,19 ----
  215.   # Use your text editor to search for:                        #
  216.   #  "#USHOLS" for U.S. holidays                            #
  217.   #  "#JHOLS"  for Jewish holidays                        #
  218. + #  "#PSSTUFF" for nifty PostScript examples                    #
  219.   #                                         #
  220.   # This file is part of REMIND.                            #
  221.   # Copyright (C) 1992, 1993 by David F. Skoll                    #
  222. ***************
  223. *** 24,31 ****
  224.   ################################################
  225.   # Ensure required version of remind is used... #
  226.   ################################################
  227. ! IF version() < "03.00.05"
  228. !    ERRMSG This file requires at least version 03.00.05 of Remind.%
  229.      ERRMSG This version is version [version()].
  230.      EXIT
  231.   ENDIF
  232. --- 25,32 ----
  233.   ################################################
  234.   # Ensure required version of remind is used... #
  235.   ################################################
  236. ! IF version() < "03.00.06"
  237. !    ERRMSG This file requires at least version 03.00.06 of Remind.%
  238.      ERRMSG This version is version [version()].
  239.      EXIT
  240.   ENDIF
  241. ***************
  242. *** 442,444 ****
  243. --- 443,476 ----
  244.      ENDIF
  245.      CAL [ORD(odays)] of Omer
  246.   ENDIF
  247. + #PSSTUFF
  248. + ##########################################################################
  249. + #                                         #
  250. + # This portion of the file contains some cute examples of the new        #
  251. + # PS-type reminders.  You need a PostScript printer or viewer to         #
  252. + # appreciate these.  To use them, pipe the output of remind -p into the  #
  253. + # rem2ps program.                                                        #
  254. + #                                         #
  255. + ##########################################################################
  256. + # Convenient to stick all the PostScript code in a string var - makes
  257. + # reminders easier to understand.  The variable "shade" will contain
  258. + # PostScript code to shade in a particular box on the calendar.
  259. + SET shade \
  260. + "/_A LineWidth 2 div def \
  261. + _A _A moveto \
  262. + BoxWidth _A sub _A lineto \
  263. + BoxWidth _A sub BoxHeight _A sub lineto \
  264. + _A BoxHeight _A sub lineto \
  265. + closepath 0.95 setgray fill 0.0 setgray"
  266. + # The following reminder will shade the Saturday and Sunday calendar
  267. + # entries. 
  268. + REM Sat Sun PS [shade]
  269. + # The following will fill in the Hebrew dates on the calendar.  For this
  270. + # example, I recommend that you use the "-sd 10" option for rem2ps.
  271. + REM PS Border BoxHeight Border sub DaySize sub moveto \
  272. +    /DayFont findfont DaySize scalefont setfont \
  273. +    ([hebday(today())] [hebmon(today())]) show
  274. *** ../p5rel/dorem.c    Thu Apr 22 10:24:03 1993
  275. --- ./dorem.c    Fri Apr 30 13:16:27 1993
  276. ***************
  277. *** 466,472 ****
  278.      int r, y, m, d;
  279.   
  280.      if (t->typ == RUN_TYPE && RunDisabled) return E_RUN_DISABLED;
  281. !    if (t->typ == CAL_TYPE) return OK;
  282.   
  283.   /* If it's a MSG-type reminder, and no -k option was used, issue the banner. */
  284.      if (t->typ == MSG_TYPE && !NumTriggered && !NextMode && !MsgCommand) {
  285. --- 466,473 ----
  286.      int r, y, m, d;
  287.   
  288.      if (t->typ == RUN_TYPE && RunDisabled) return E_RUN_DISABLED;
  289. !    if (t->typ == CAL_TYPE || t->typ == PS_TYPE || t->typ == PSF_TYPE)
  290. !       return OK;
  291.   
  292.   /* If it's a MSG-type reminder, and no -k option was used, issue the banner. */
  293.      if (t->typ == MSG_TYPE && !NumTriggered && !NextMode && !MsgCommand) {
  294. *** ../p5rel/hbcal.c    Thu Apr 22 10:24:38 1993
  295. --- ./hbcal.c    Mon May  3 11:34:29 1993
  296. ***************
  297. *** 237,243 ****
  298.      ylen = DaysInHebYear(y);
  299.      monlen = DaysInHebMonths(ylen);
  300.      m = 0;
  301. !    while((jul > monlen[m]) || !monlen[m]) {
  302.         jul -= monlen[m];
  303.         m++;
  304.      }
  305. --- 237,243 ----
  306.      ylen = DaysInHebYear(y);
  307.      monlen = DaysInHebMonths(ylen);
  308.      m = 0;
  309. !    while((jul >= monlen[m]) || !monlen[m]) {
  310.         jul -= monlen[m];
  311.         m++;
  312.      }
  313. ***************
  314. *** 424,431 ****
  315.   int julstart, hm, hd, jahr, *ans;
  316.   #endif
  317.   {
  318. !    int r, yout, mout, dout, jul;
  319.   
  320.      JulToHeb(julstart, &yout, &mout, &dout);
  321.   
  322.      r = 1;
  323. --- 424,435 ----
  324.   int julstart, hm, hd, jahr, *ans;
  325.   #endif
  326.   {
  327. !    int r, yout, mout, dout, jul=1;
  328.   
  329. +    /* I initialize jul above to stop gcc from complaining about
  330. +       possible use of uninitialized variable.  You can take it
  331. +       out if the small inefficiency really bothers you. */
  332.      JulToHeb(julstart, &yout, &mout, &dout);
  333.   
  334.      r = 1;
  335. ***************
  336. *** 437,442 ****
  337. --- 441,447 ----
  338.        continue;
  339.         }
  340.         jul = HebToJul(yout, mout, dout);
  341. +       if (jul < 0) return E_DATE_OVER;
  342.         if (jul >= julstart) break;
  343.         else {
  344.            yout++;
  345. *** ../p5rel/init.c    Thu Apr 22 10:24:09 1993
  346. --- ./init.c    Thu Apr 29 15:08:41 1993
  347. ***************
  348. *** 63,68 ****
  349. --- 63,69 ----
  350.    *  -xn      = Max. number of iterations for SATISFY
  351.    *  -uname   = Run as user 'name' - only valid when run by root.
  352.    *  -kcmd    = Run 'cmd' for MSG-type reminders instead of printing to stdout
  353. +  *  -iVAR=EXPR = Initialize and preserve VAR.
  354.    *
  355.    **************************************************************/
  356.   
  357. ***************
  358. *** 79,84 ****
  359. --- 80,87 ----
  360.   PRIVATE void ChgUser ARGS((char *uname));
  361.   #endif
  362.   
  363. + PRIVATE void InitializeVar ARGS ((char *str));
  364.   static char *BadDate = "Illegal date on command line\n";
  365.   
  366.   /***************************************************************/
  367. ***************
  368. *** 123,128 ****
  369. --- 126,137 ----
  370.   
  371.         while (*arg) {
  372.            switch(*arg++) {
  373. +             case 'i':
  374. +         case 'I':
  375. +            InitializeVar(arg);
  376. +            while(*arg) arg++;
  377. +            break;
  378. +        
  379.           case 'n':
  380.           case 'N':
  381.              NextMode = 1;
  382. ***************
  383. *** 393,398 ****
  384. --- 402,408 ----
  385.      fprintf(ErrFp, " -x[n]  Iteration limit for SATISFY clause (def=150)\n");
  386.      fprintf(ErrFp, " -kcmd  Run 'cmd' for MSG-type reminders\n");
  387.      fprintf(ErrFp, " -g[d[d]] Sort reminders by date and time before issuing\n");
  388. +    fprintf(ErrFp, "-ivar=val Initialize var to val and preserve var\n");
  389.      exit(1);
  390.   }
  391.   
  392. ***************
  393. *** 456,462 ****
  394.      sprintf(home, "HOME=%s", pwent->pw_dir);
  395.      putenv(home);
  396.   
  397. !    shell = malloc(strlen(pwent->pw_dir) + 7);
  398.      if (!shell) {
  399.         fprintf(ErrFp, NoEnvMem);
  400.         exit(1);
  401. --- 466,472 ----
  402.      sprintf(home, "HOME=%s", pwent->pw_dir);
  403.      putenv(home);
  404.   
  405. !    shell = malloc(strlen(pwent->pw_shell) + 7);
  406.      if (!shell) {
  407.         fprintf(ErrFp, NoEnvMem);
  408.         exit(1);
  409. ***************
  410. *** 483,485 ****
  411. --- 493,550 ----
  412.   }
  413.   #endif /* UNIX && WANT_U_OPTION */
  414.      
  415. + /***************************************************************/
  416. + /*                                                             */
  417. + /*  InitializeVar                                              */
  418. + /*                                                             */
  419. + /*  Initialize and preserve a variable                         */
  420. + /*                                                             */
  421. + /***************************************************************/
  422. + #ifdef HAVE_PROTOS
  423. + PRIVATE void InitializeVar(char *str)
  424. + #else
  425. + static void InitializeVar(str)
  426. + char *str;
  427. + #endif
  428. + {
  429. +    char *varname, *expr;
  430. +    static char Err[] = "Remind: -i option: %s\n";
  431. +    Value val;
  432. +    int r;
  433. +    /* Scan for an '=' sign */
  434. +    varname = str;
  435. +    while (*str && *str != '=') str++;
  436. +    if (!*str) {
  437. +       fprintf(ErrFp, Err, "Missing '=' sign");
  438. +       return;
  439. +    }
  440. +    *str = 0;
  441. +    if (!*varname) {
  442. +       fprintf(ErrFp, Err, "Missing varname");
  443. +       return;
  444. +    }
  445. +    expr = str+1;
  446. +    if (!*expr) {
  447. +       fprintf(ErrFp, Err, "Missing expr");
  448. +       return;
  449. +    }
  450. +    r=EvalExpr(&expr, &val);
  451. +    if (r) {
  452. +       fprintf(ErrFp, Err, ErrMsg[r]);
  453. +       return;
  454. +    }
  455. +    r=SetVar(varname, &val);
  456. +    if (r) {
  457. +       fprintf(ErrFp, Err, ErrMsg[r]);
  458. +       return;
  459. +    }
  460. +    r=PreserveVar(varname);
  461. +    if (r) fprintf(ErrFp, Err, ErrMsg[r]);
  462. +    return;
  463. + }
  464. *** ../p5rel/makefile.os2    Thu Apr 22 10:24:11 1993
  465. --- ./makefile.os2    Fri Apr 23 13:00:11 1993
  466. ***************
  467. *** 25,31 ****
  468.   # YOU SHOULDN'T EDIT ANYTHING BELOW HERE.  You may want to change some things
  469.   # in config.h; then, you should be able to type 'make'.
  470.   #-----------------------------------------------------------------------------
  471. ! VERSION= 03.00.05
  472.   
  473.   HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \
  474.   lang.h english.h german.h dutch.h finish.h
  475. --- 25,31 ----
  476.   # YOU SHOULDN'T EDIT ANYTHING BELOW HERE.  You may want to change some things
  477.   # in config.h; then, you should be able to type 'make'.
  478.   #-----------------------------------------------------------------------------
  479. ! VERSION= 03.00.06
  480.   
  481.   HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \
  482.   lang.h english.h german.h dutch.h finish.h
  483. *** ../p5rel/makefile.tc    Thu Apr 22 10:24:11 1993
  484. --- ./makefile.tc    Fri Apr 23 13:00:07 1993
  485. ***************
  486. *** 1,6 ****
  487.   # Makefile for REMIND for Turbo C for MSDOS
  488.   
  489. ! VERSION= 03.00.05
  490.   
  491.   HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \
  492.   lang.h english.h german.h dutch.h finnish.h
  493. --- 1,6 ----
  494.   # Makefile for REMIND for Turbo C for MSDOS
  495.   
  496. ! VERSION= 03.00.06
  497.   
  498.   HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \
  499.   lang.h english.h german.h dutch.h finnish.h
  500. *** ../p5rel/queue.c    Thu Apr 22 10:24:12 1993
  501. --- ./queue.c    Thu Apr 29 16:29:18 1993
  502. ***************
  503. *** 270,282 ****
  504.      printf("Contents of AT queue:%s", NL);
  505.   
  506.      while (q) {
  507. !       printf("Trigger: %02d%c%02d  Activate: %02d%c%02d  Rep: %d  Delta: %d%s",
  508. !               q->tt.ttime / 60, TIMESEP, q->tt.ttime % 60,
  509. !           q->tt.nexttime / 60, TIMESEP, q->tt.nexttime % 60,
  510. !               q->tt.rep, q->tt.delta, NL);
  511. !       printf("Text: %s %s%s%s", ((q->typ == MSG_TYPE) ? "MSG" : "RUN"),
  512. !               q->text,
  513. !               NL, NL);
  514.         q = q->next;
  515.      }
  516.      printf(NL);
  517. --- 270,284 ----
  518.      printf("Contents of AT queue:%s", NL);
  519.   
  520.      while (q) {
  521. !       if (q->tt.nexttime != NO_TIME) {
  522. !          printf("Trigger: %02d%c%02d  Activate: %02d%c%02d  Rep: %d  Delta: %d%s",
  523. !                  q->tt.ttime / 60, TIMESEP, q->tt.ttime % 60,
  524. !                  q->tt.nexttime / 60, TIMESEP, q->tt.nexttime % 60,
  525. !                  q->tt.rep, q->tt.delta, NL);
  526. !          printf("Text: %s %s%s%s", ((q->typ == MSG_TYPE) ? "MSG" : "RUN"),
  527. !                  q->text,
  528. !                  NL, NL);
  529. !       }
  530.         q = q->next;
  531.      }
  532.      printf(NL);
  533. *** ../p5rel/rem2ps.1    Thu Apr 22 10:24:28 1993
  534. --- ./rem2ps.1    Mon May  3 15:27:50 1993
  535. ***************
  536. *** 10,15 ****
  537. --- 10,21 ----
  538.   draws a calendar) to the standard output.
  539.   .SH OPTIONS
  540.   .TP
  541. + .B \-p file
  542. + Include the contents of \fIfile\fR in the PostScript prologue.  This
  543. + allows you to define procedures, variables etc. which can be used
  544. + by the \fBPS\fR and \fBPSFILE\fR reminders.  You should not
  545. + include any document structuring comments in your prologue.
  546. + .TP
  547.   .B \-l
  548.   Produce the calendar in landscape mode rather than the default
  549.   portrait mode.
  550. ***************
  551. *** 147,152 ****
  552. --- 153,269 ----
  553.   entries from the reminder file "~/.reminders."  The calendar is produced
  554.   in landscape mode, with a font size of 18 for the day numbers.  The result
  555.   is put in the PostScript file "cal.ps."
  556. + .PP
  557. + .SH VARIABLES AVAILABLE TO USER-SUPPLIED POSTSCRIPT CODE
  558. + .PP
  559. + The following variables are available to \fBPS\fR and 
  560. + \fBPSFILE\fR-type reminders.  (This material is duplicated
  561. + in the \fBRemind\fR manual page.)
  562. + .TP
  563. + LineWidth
  564. + The width of the black grid lines making up the calendar.
  565. + .TP
  566. + Border
  567. + The border between the center of the grid lines and the space used to print
  568. + calendar entries.  This border is normally blank space.
  569. + .TP
  570. + BoxWidth and BoxHeight
  571. + The width and height of the calendar box, from center-to-center of the
  572. + black gridlines.
  573. + .TP
  574. + InBoxHeight
  575. + The height from the center of the bottom black gridline to the top
  576. + of the regular calendar entry area.  The space from here to the top
  577. + of the box is used only to draw the day number.
  578. + .TP
  579. + /DayFont, /EntryFont, /SmallFont and /HeadFont
  580. + The fonts used to draw the day numbers, the calendar entries, the small
  581. + calendars, and the month and day headings, respectively.
  582. + .TP
  583. + DaySize, EntrySize and HeadSize
  584. + The sizes of the above fonts.  (The size of the small calendar font
  585. + is \fInot\fR defined here.)  For example, if you wanted to print
  586. + the Hebrew date next to the regular day number in the calendar, use:
  587. + .PP
  588. + .nf
  589. +     REM PS Border BoxHeight Border sub DaySize sub moveto \\
  590. +        /DayFont findfont DaySize scalefont setfont \\
  591. +        ([hebday(today())] [hebmon(today())]) show
  592. + .fi
  593. + .PP
  594. + .RS
  595. + Note how /DayFont and DaySize are used.
  596. + .RE
  597. + .PP
  598. + Note that if you supply PostScript code, it is possible to produce invalid
  599. + PostScript files.  Always test your PostScript thoroughly with a PostScript
  600. + viewer before sending it to the printer.  You should not use any document
  601. + structuring comments in your PostScript code.
  602. + .PP
  603. + In addition, prior to drawing a calendar page, \fBRem2ps\fR emits
  604. + the following PostScript code:
  605. + .PP
  606. + .nf
  607. +     save (mon) (yr) PreCal restore
  608. + .fi
  609. + .PP
  610. + where \fImon\fR and \fIyr\fR are the month and year of the calendar
  611. + page.  The default \fBPreCal\fR procedure simply pops
  612. + the arguments and does nothing.  However, you can define a \fBPreCal\fR
  613. + function in your prologue file to do whatever you want - it can draw a
  614. + background for the entire calendar, for instance.
  615. + .PP
  616. + In the context of the \fBPreCal\fR procedure, the following conditions
  617. + hold:
  618. + .TP
  619. + o
  620. + The PostScript origin is at the bottom left-hand corner of the page, and
  621. + PostScript units of 1/72" are in effect.
  622. + .TP
  623. + o
  624. + The variables MinX, MinY, MaxX and MaxY define the bounding box within
  625. + which the calendar will be drawn.
  626. + .TP
  627. + o
  628. + The font and font-size variables, as well as Border and LineWidth described
  629. + previously, are valid.
  630. + .PP
  631. + For an example, create a file called "myprolog" whose contents are:
  632. + .PP
  633. + .nf
  634. +         /PreCal {
  635. +          /yr exch def
  636. +          /mon exch def
  637. +          /xsiz1 MaxX MinX sub def
  638. +          /ysiz1 MaxY MinY sub def
  639. +          /xsiz xsiz1 MinX sub MinX sub def
  640. +          /ysiz ysiz1 MinY sub MinY sub def
  641. +          xsiz
  642. +          ysiz
  643. +          lt
  644. +          {/len xsiz 1.41 mul def
  645. +           MinX MinX add ysiz1 xsiz1 sub 2 div MinY add MinY add moveto}
  646. +          {/len ysiz 1.41 mul def
  647. +           xsiz1 ysiz1 sub 2 div MinX add MinX add MinY MinY add moveto}
  648. +          ifelse
  649. +          /Helvetica-Bold findfont 1 scalefont setfont
  650. +          mon stringwidth pop
  651. +          ( ) stringwidth pop add
  652. +          yr stringwidth pop add
  653. +          len exch div /len exch def
  654. +          /Helvetica-Bold findfont len scalefont setfont
  655. +          0.95 setgray
  656. +          45 rotate
  657. +          mon show
  658. +          ( ) show
  659. +          yr show
  660. +         } bind def
  661. + .fi
  662. + .PP
  663. + Use that file with the \fBRem2ps\fR \fB\-p\fR option to create calendars
  664. + with the year and month in large grey letters in the background of the
  665. + calendar.
  666. + .PP
  667.   .SH AUTHOR
  668.   David F. Skoll
  669.   .SH BUGS
  670. *** ../p5rel/rem2ps.c    Thu Apr 22 10:24:26 1993
  671. --- ./rem2ps.c    Mon May  3 10:37:57 1993
  672. ***************
  673. *** 68,74 ****
  674.   
  675.   #define NUMPAGES (sizeof(Pages)/sizeof(Pages[0]))
  676.   
  677. ! CalEntry *CurEntries;
  678.   PageType *CurPage;
  679.   char PortraitMode;
  680.   char NoSmallCal;
  681. --- 68,75 ----
  682.   
  683.   #define NUMPAGES (sizeof(Pages)/sizeof(Pages[0]))
  684.   
  685. ! CalEntry *CurEntries = NULL;
  686. ! CalEntry *PsEntries[32];
  687.   PageType *CurPage;
  688.   char PortraitMode;
  689.   char NoSmallCal;
  690. ***************
  691. *** 87,92 ****
  692. --- 88,95 ----
  693.   char *EntrySize="8";
  694.   char *BorderSize = "6";
  695.   
  696. + char *UserProlog = NULL;
  697.   int validfile = 0;
  698.   
  699.   int CurDay;
  700. ***************
  701. *** 99,104 ****
  702. --- 102,108 ----
  703.   void Init ARGS ((int argc, char *argv[]));
  704.   void Usage ARGS ((char *s));
  705.   void DoPsCal ARGS ((void));
  706. + int DoQueuedPs ARGS ((void));
  707.   void DoSmallCal ARGS((char *m, int days, int first, int col));
  708.   void WriteProlog ARGS ((void));
  709.   void WriteCalEntry ARGS ((void));
  710. ***************
  711. *** 160,165 ****
  712. --- 164,170 ----
  713.      int sfirst;
  714.      int i;
  715.      int smallcol;
  716. +    int is_ps;
  717.      CalEntry *c, *d;
  718.   
  719.      printf("%%%%Page: %d %d\n", validfile, validfile);
  720. ***************
  721. *** 175,180 ****
  722. --- 180,186 ----
  723.   
  724.   /* Emit PostScript to do the heading */
  725.      if (!PortraitMode) printf("XSIZE 0 translate 90 rotate\n");
  726. +    printf("/SAVESTATE save def (%s) (%s) PreCal SAVESTATE restore\n", month, year);
  727.      printf("(%s %s) doheading\n", month, year);
  728.   
  729.   /* Calculate the minimum box size */
  730. ***************
  731. *** 215,234 ****
  732.            fprintf(stderr, "malloc failed - aborting.\n");
  733.        exit(1);
  734.         }
  735.         c->next = NULL;
  736. !       c->entry = malloc(strlen(LineBuffer+10) + 1);
  737.         if (!c->entry) {
  738.            fprintf(stderr, "malloc failed - aborting.\n");
  739.        exit(1);
  740.         }
  741. !       strcpy(c->entry, LineBuffer+10);
  742.   
  743.   /* Put on linked list */
  744. !       if (!CurEntries) CurEntries = c;
  745. !       else {
  746. !          d = CurEntries;
  747. !      while(d->next) d = d->next;
  748. !      d->next = c;
  749.         }
  750.      }
  751.      for(; CurDay<=days; CurDay++) {
  752. --- 221,248 ----
  753.            fprintf(stderr, "malloc failed - aborting.\n");
  754.        exit(1);
  755.         }
  756. +       is_ps = (*LineBuffer == 'F' || *LineBuffer == 'P');
  757.         c->next = NULL;
  758. !       c->entry = malloc(strlen(LineBuffer+10) + 1 + is_ps);
  759.         if (!c->entry) {
  760.            fprintf(stderr, "malloc failed - aborting.\n");
  761.        exit(1);
  762.         }
  763. !       strcpy(c->entry+is_ps, LineBuffer+10);
  764.   
  765. +       if (is_ps) {
  766. + /* Save the 'P' or 'F' flag */
  767. +          *(c->entry) = *LineBuffer;
  768. +      c->next = PsEntries[DayNum];
  769. +      PsEntries[DayNum] = c;
  770. +       } else {
  771.   /* Put on linked list */
  772. !          if (!CurEntries) CurEntries = c;
  773. !          else {
  774. !             d = CurEntries;
  775. !            while(d->next) d = d->next;
  776. !         d->next = c;
  777. !      }
  778.         }
  779.      }
  780.      for(; CurDay<=days; CurDay++) {
  781. ***************
  782. *** 281,286 ****
  783. --- 295,303 ----
  784.      int x = CurPage->xsize;
  785.      int y = CurPage->ysize;
  786.      char *isostuff;
  787. +    FILE *fp;
  788. +    int nread;
  789. +    char buffer[LINELEN];
  790.   
  791.      if (!PortraitMode) {
  792.         i = x; x = y; y = i;
  793. ***************
  794. *** 325,330 ****
  795. --- 342,348 ----
  796.      printf("/MaxX %d def\n", x-RightMarg);
  797.      printf("/MaxY %d def\n", y-TopMarg);
  798.      printf("/Border %s def\n", BorderSize);
  799. +    printf("/LineWidth %s def\n", LineWidth);
  800.      printf("%s setlinewidth\n", LineWidth);
  801.   
  802.   /* Check if smallfont is fixed pitch */
  803. ***************
  804. *** 335,343 ****
  805.         printf("{/SmallString (WW ) def}\n");
  806.         printf("{/SmallString (WW) def}\nifelse\n");
  807.      }
  808.      printf("%%%%EndProlog\n");
  809. - /* Set the minimum box size */
  810.   
  811.   }
  812.   
  813.   /***************************************************************/
  814. --- 353,377 ----
  815.         printf("{/SmallString (WW ) def}\n");
  816.         printf("{/SmallString (WW) def}\nifelse\n");
  817.      }
  818. + /* Do the user-supplied prolog file, if any */
  819. +    if (UserProlog) {
  820. +       fp = fopen(UserProlog, "r");
  821. +       if (!fp) {
  822. +          fprintf(stderr, "Could not open prologue file '%s'\n", UserProlog);
  823. +       } else {
  824. +          while(1) {
  825. +         nread = fread(buffer, sizeof(char), LINELEN, fp);
  826. +         if (!nread) break;
  827. +         fwrite(buffer, sizeof(char), nread, stdout);
  828. +          }
  829. +          fclose(fp);
  830. +       }
  831. +    }
  832.      printf("%%%%EndProlog\n");
  833.   
  834.   }
  835.   
  836.   /***************************************************************/
  837. ***************
  838. *** 353,360 ****
  839. --- 387,396 ----
  840.   {
  841.      CalEntry *c = CurEntries;
  842.      CalEntry *d;
  843. +    int begin, end, i, HadQPS;
  844.   
  845.   /* Move to appropriate location */
  846. +    printf("/CAL%d {\n", CurDay);
  847.      printf("Border ytop %d xincr mul MinX add xincr\n", WkDayNum);
  848.   
  849.   /* Set up the text array */
  850. ***************
  851. *** 378,386 ****
  852.   
  853.   /* Update ymin */
  854.      printf("/y exch def y ymin lt {/ymin y def} if\n");
  855.   
  856. ! /* If WkDayNum is a Sunday, move to next row. */
  857.      if (WkDayNum == 6 || CurDay == MaxDay) {
  858.         printf("/y ytop MinBoxSize sub def y ymin lt {/ymin y def} if\n");
  859.   
  860.   /* Draw the line at the bottom of the row */
  861. --- 414,440 ----
  862.   
  863.   /* Update ymin */
  864.      printf("/y exch def y ymin lt {/ymin y def} if\n");
  865. +    printf("} def\n");
  866.   
  867. ! /* If WkDayNum is a Sunday, move to next row.  Also handle the queued
  868. !    PS and PSFILE reminders */
  869.      if (WkDayNum == 6 || CurDay == MaxDay) {
  870. +       HadQPS = 0;
  871. +       begin = CurDay - WkDayNum;
  872. +       if (begin < 1) begin = 1;
  873. +       end = CurDay;
  874. +       for (i=begin; i<=end; i++) {
  875. +      if (PsEntries[i]) {
  876. +         HadQPS = 1;
  877. +         break;
  878. +          }
  879. +       }
  880. +       /* Avoid problems with blotching if PS printer has roundoff errors */
  881. +       if (HadQPS) printf("1 setgray\n");
  882. +       for (i=begin; i<=end; i++) {
  883. +          printf("CAL%d\n", i);
  884. +       }
  885. +       if (HadQPS) printf("0 setgray\n");
  886.         printf("/y ytop MinBoxSize sub def y ymin lt {/ymin y def} if\n");
  887.   
  888.   /* Draw the line at the bottom of the row */
  889. ***************
  890. *** 389,394 ****
  891. --- 443,462 ----
  892.   /* Update ytop */
  893.         printf("/ylast ytop def\n");
  894.         printf("/ytop ymin def\n");
  895. +       (void) DoQueuedPs();
  896. + /* Re-do the calendar stuff if there was any included PS code */
  897. +       if (HadQPS) {
  898. +          printf("/ytop ylast def\n");
  899. +          for (i=begin; i<=end; i++) {
  900. +             printf("CAL%d\n", i);
  901. +          }
  902. +          printf("/y ytop MinBoxSize sub def y ymin lt {/ymin y def} if\n");
  903. +          printf("MinX ymin MaxX ymin L\n");
  904. +          printf("/ylast ytop def\n");
  905. +      printf("/ytop ymin def\n");
  906. +       }
  907.      }
  908.   }
  909.   
  910. ***************
  911. *** 454,459 ****
  912. --- 522,529 ----
  913.      BotMarg = 36;
  914.      UseISO = 0;
  915.   
  916. +    for(j=0; j<32; j++) PsEntries[i] = NULL;
  917.      CurPage = DefaultPage;  /* Letter size by default */
  918.   
  919.      while (i < argc) {
  920. ***************
  921. *** 463,468 ****
  922. --- 533,543 ----
  923.         if (*s++ != '-') Usage("Options must begin with '-'");
  924.   
  925.         switch(*s++) {
  926. +          case 'p':
  927. +         if (i == argc) Usage("Prologue filename must be supplied");
  928. +         UserProlog = argv[i++];
  929. +         break;
  930.            case 's':
  931.           if (i == argc) Usage("Size must be supplied");
  932.           t = argv[i++];
  933. ***************
  934. *** 564,580 ****
  935.      fprintf(stderr, "Rem2PS: Produce a PostScript calendar from output of Remind.\n\n");
  936.      fprintf(stderr, "Usage: rem2ps [options]\n\n");
  937.      fprintf(stderr, "Options:\n\n");
  938. !    fprintf(stderr, "-l            Do calendar in landscape mode.\n");
  939.      fprintf(stderr, "-c            Do NOT generate small calendars for previous\n");
  940. !    fprintf(stderr, "              and next month.\n");
  941.      fprintf(stderr, "-i            Use ISO 8859-1 encoding in PostScript output\n");
  942.      fprintf(stderr, "-m media      Set page size (eg, Letter, Legal, A4.)  Case sensitive!\n");
  943.      fprintf(stderr, "              (Default page size is %s)\n", DefaultPage[0].name);
  944. !    fprintf(stderr, "-f[shed] font Set font for small cal, hdr, cal entries and/or day numbers.\n");
  945. !    fprintf(stderr, "-s[hed] size  Set size for header, calendar entries and/or day numbers.\n");
  946. !    fprintf(stderr, "-b size       Set border size for calendar entries.\n");
  947. !    fprintf(stderr, "-t size       Set line thickness.\n");
  948. !    fprintf(stderr, "-o[lrtb] marg Specify left, right, top and bottom margins.\n");
  949.      exit(1);
  950.   }
  951.   
  952. --- 639,656 ----
  953.      fprintf(stderr, "Rem2PS: Produce a PostScript calendar from output of Remind.\n\n");
  954.      fprintf(stderr, "Usage: rem2ps [options]\n\n");
  955.      fprintf(stderr, "Options:\n\n");
  956. !    fprintf(stderr, "-p file       Include user-supplied PostScript code in prologue\n");
  957. !    fprintf(stderr, "-l            Do calendar in landscape mode\n");
  958.      fprintf(stderr, "-c            Do NOT generate small calendars for previous\n");
  959. !    fprintf(stderr, "              and next month\n");
  960.      fprintf(stderr, "-i            Use ISO 8859-1 encoding in PostScript output\n");
  961.      fprintf(stderr, "-m media      Set page size (eg, Letter, Legal, A4.)  Case sensitive!\n");
  962.      fprintf(stderr, "              (Default page size is %s)\n", DefaultPage[0].name);
  963. !    fprintf(stderr, "-f[shed] font Set font for small cal, hdr, cal entries and/or day numbers\n");
  964. !    fprintf(stderr, "-s[hed] size  Set size for header, calendar entries and/or day numbers\n");
  965. !    fprintf(stderr, "-b size       Set border size for calendar entries\n");
  966. !    fprintf(stderr, "-t size       Set line thickness\n");
  967. !    fprintf(stderr, "-o[lrtb] marg Specify left, right, top and bottom margins\n");
  968.      exit(1);
  969.   }
  970.   
  971. ***************
  972. *** 632,634 ****
  973. --- 708,782 ----
  974.      printf("grestore\n");
  975.   }
  976.   
  977. + /***************************************************************/
  978. + /*                                                             */
  979. + /*  DoQueuedPs - do the queued PS and PSFILE reminders.        */
  980. + /*                                                             */
  981. + /***************************************************************/
  982. + #ifdef HAVE_PROTOS
  983. + PUBLIC int DoQueuedPs(void)
  984. + #else
  985. + int DoQueuedPs()
  986. + #endif
  987. + {
  988. +    int i;
  989. +    int HadPS = 0;
  990. +    int wd;
  991. +    int begin, end;
  992. +    int nread;
  993. +    CalEntry *e, *n;
  994. +    FILE *fp;
  995. +    int fnoff;
  996. +    char buffer[LINELEN];
  997. +    begin = CurDay - WkDayNum;
  998. +    wd = 0;
  999. +    while (begin < 1) begin++, wd++;
  1000. +    end = CurDay;
  1001. +    for (i=begin; i<=end; i++, wd++) {
  1002. +       e = PsEntries[i];
  1003. +       if (e) {
  1004. +          HadPS = 1;
  1005. +          printf("/SAVESTATE save def\n");
  1006. +          /* Translate coordinates to bottom of calendar box */
  1007. +          printf("%d xincr mul MinX add ytop translate\n", wd);
  1008. +          /* Set up convenient variables */
  1009. +          printf("/BoxWidth xincr def\n/BoxHeight ylast ytop sub def\n");
  1010. +      printf("/InBoxHeight BoxHeight border sub DaySize sub DaySize sub 2 add EntrySize add def \n");
  1011. +       }
  1012. +       while (e) {
  1013. + /* Now do the user's PostScript code */
  1014. +          fnoff = 1;
  1015. +      while (isspace(*(e->entry+fnoff))) fnoff++;
  1016. +          if (*(e->entry) == 'P') {
  1017. +         printf("%s\n", e->entry+fnoff);
  1018. +          } else {
  1019. +         fp = fopen(e->entry+fnoff, "r");
  1020. +         if (!fp) {
  1021. +            fprintf(stderr, "Could not open PostScript file '%s'\n", e->entry+1);
  1022. +             } else {
  1023. +            while(1) {
  1024. +               nread = fread(buffer, sizeof(char), LINELEN, fp);
  1025. +           if (!nread) break;
  1026. +           fwrite(buffer, sizeof(char), nread, stdout);
  1027. +                }
  1028. +            fclose(fp);
  1029. +             }
  1030. +          }
  1031. + /* Free the entry */
  1032. +          free(e->entry);
  1033. +      n = e->next;
  1034. +      free(e);
  1035. +      e = n;
  1036. +       }
  1037. +       if (PsEntries[i]) printf("\n SAVESTATE restore\n");
  1038. +       PsEntries[i] = NULL;
  1039. +    }
  1040. +    return HadPS;
  1041. + }
  1042. *** ../p5rel/rem2ps.h    Thu Apr 22 10:24:26 1993
  1043. --- ./rem2ps.h    Mon May  3 10:36:51 1993
  1044. ***************
  1045. *** 11,16 ****
  1046. --- 11,18 ----
  1047.   
  1048.   char *PSProlog1[] =
  1049.   {
  1050. +    "% This file was produced by Remind and Rem2PS, written by",
  1051. +    "% David F. Skoll.",
  1052.      "/ISOLatin1Encoding where { pop save true }{ false } ifelse",
  1053.      "  /ISOLatin1Encoding [ StandardEncoding 0 45 getinterval aload pop /minus",
  1054.      "    StandardEncoding 46 98 getinterval aload pop /dotlessi /grave /acute",
  1055. ***************
  1056. *** 200,204 ****
  1057. --- 202,208 ----
  1058.      "    forall",
  1059.      "} bind def",
  1060.      "2 setlinecap",
  1061. +    "% Define a default PreCal procedure",
  1062. +    "/PreCal { pop pop } bind def",
  1063.      NULL
  1064.   };
  1065. *** ../p5rel/remind-all.csh    Thu Apr 22 10:24:14 1993
  1066. --- ./remind-all.csh    Tue Apr 27 11:00:15 1993
  1067. ***************
  1068. *** 31,40 ****
  1069.   # Scan each user's directory for a .reminders file
  1070.   foreach i ($USERS)
  1071.      if (-r ~$i/.reminders) then
  1072.   #     echo "$i has a .reminders file."     DEBUGGING PURPOSES ONLY
  1073.   
  1074. !       $REMIND -u$i -h -r -q ~$i/.reminders < /dev/null > $REMFILE
  1075.         if (! -z $REMFILE) then
  1076.   #        echo "Sending mail to $i"         DEBUGGING PURPOSES ONLY
  1077.   
  1078. --- 31,39 ----
  1079.   # Scan each user's directory for a .reminders file
  1080.   foreach i ($USERS)
  1081.      if (-r ~$i/.reminders) then
  1082.   #     echo "$i has a .reminders file."     DEBUGGING PURPOSES ONLY
  1083.   
  1084. !       $REMIND -u$i -h -r -q -iremind_all=1 ~$i/.reminders < /dev/null > $REMFILE
  1085.         if (! -z $REMFILE) then
  1086.   #        echo "Sending mail to $i"         DEBUGGING PURPOSES ONLY
  1087.   
  1088. *** ../p5rel/remind-all.sh    Thu Apr 22 10:24:14 1993
  1089. --- ./remind-all.sh    Tue Apr 27 10:59:25 1993
  1090. ***************
  1091. *** 36,42 ****
  1092.   
  1093.   #     echo "$i has a .reminders file."     DEBUGGING PURPOSES ONLY
  1094.   
  1095. !       $REMIND -u$i -h -r -q $HOME/.reminders < /dev/null > $REMFILE
  1096.         if [ -s $REMFILE ]; then
  1097.   #        echo "Sending mail to $i"         DEBUGGING PURPOSES ONLY
  1098.            $MAIL -s "Reminders" $i < $REMFILE
  1099. --- 36,42 ----
  1100.   
  1101.   #     echo "$i has a .reminders file."     DEBUGGING PURPOSES ONLY
  1102.   
  1103. !       $REMIND -u$i -h -r -q -iremind_all=1 $HOME/.reminders < /dev/null > $REMFILE
  1104.         if [ -s $REMFILE ]; then
  1105.   #        echo "Sending mail to $i"         DEBUGGING PURPOSES ONLY
  1106.            $MAIL -s "Reminders" $i < $REMFILE
  1107. *** ../p5rel/remind.1    Thu Apr 22 10:24:17 1993
  1108. --- ./remind.1    Mon May  3 15:28:18 1993
  1109. ***************
  1110. *** 175,180 ****
  1111. --- 175,185 ----
  1112.   and user name, respectively, of the specified user.  LOGNAME is also
  1113.   set to the specified user name.  This option is meant for
  1114.   use in shell scripts which mail reminders to all users.
  1115. + .TP
  1116. + \fB\-i\fR\fIvar\fR\fB=\fR\fIexpr\fR
  1117. + Sets the value of the specified \fIvar\fR to \fIexpr\fR, and \fBpreserves\fR
  1118. + \fIvar\fR.  \fIExpr\fR can be any valid \fBRemind\fR expression.  See the
  1119. + section "Initializing Variables on the Command Line" for more details.
  1120.   .PP
  1121.   If you supply a \fIdate\fR on the command line, it must consist of
  1122.   \fIday month year\fR, where \fIday\fR is the day of the month,
  1123. ***************
  1124. *** 233,245 ****
  1125.   [\fBAT\fR \fItime\fR [\fItdelta\fR] [\fItrepeat\fR]]
  1126.   [\fBUNTIL\fR \fIexpiry_date\fR]
  1127.   [\fBSCANFROM\fR \fIscan_date\fR]
  1128. ! \fBMSG\fR | \fBRUN\fR | \fBCAL\fR | \fBSATISFY\fR
  1129.   .I body
  1130.   .RE
  1131.   .PP
  1132.   The parts of the \fBREM\fR command can be specified in any order, except
  1133.   that the \fIbody\fR must come immediately after the \fBMSG\fR,
  1134. ! \fBRUN\fR, \fBCAL\fR or \fBSATISFY\fR keyword.
  1135.   .PP
  1136.   The \fBREM\fR token is optional, providing that the remainder
  1137.   of the command cannot be mistaken for another \fBRemind\fR command
  1138. --- 238,250 ----
  1139.   [\fBAT\fR \fItime\fR [\fItdelta\fR] [\fItrepeat\fR]]
  1140.   [\fBUNTIL\fR \fIexpiry_date\fR]
  1141.   [\fBSCANFROM\fR \fIscan_date\fR]
  1142. ! \fBMSG\fR | \fBRUN\fR | \fBCAL\fR | \fBSATISFY\fR | \fBPS\fR | \fBPSFILE\fR
  1143.   .I body
  1144.   .RE
  1145.   .PP
  1146.   The parts of the \fBREM\fR command can be specified in any order, except
  1147.   that the \fIbody\fR must come immediately after the \fBMSG\fR,
  1148. ! \fBRUN\fR, \fBCAL\fR, \fBPS\fR, \fBPSFILE\fR or \fBSATISFY\fR keyword.
  1149.   .PP
  1150.   The \fBREM\fR token is optional, providing that the remainder
  1151.   of the command cannot be mistaken for another \fBRemind\fR command
  1152. ***************
  1153. *** 247,255 ****
  1154.   before the \fBMSG\fR, \fBRUN\fR, \fBCAL\fR or \fBSATISFY\fR clause
  1155.   is called a \fItrigger\fR.
  1156.   .PP
  1157. ! .B MSG, RUN, and CAL
  1158.   .PP
  1159. ! The keywords \fBMSG\fR, \fBRUN\fR and \fBCAL\fR denote the \fItype\fR
  1160.   of the reminder.  (\fBSATISFY\fR is more complicated and will be explained
  1161.   later.)  A \fBMSG\fR-type reminder normally prints a message to the standard
  1162.   output, after passing the \fIbody\fR through a special substitution filter,
  1163. --- 252,260 ----
  1164.   before the \fBMSG\fR, \fBRUN\fR, \fBCAL\fR or \fBSATISFY\fR clause
  1165.   is called a \fItrigger\fR.
  1166.   .PP
  1167. ! .B MSG, RUN, CAL, PS and PSFILE
  1168.   .PP
  1169. ! These keywords denote the \fItype\fR
  1170.   of the reminder.  (\fBSATISFY\fR is more complicated and will be explained
  1171.   later.)  A \fBMSG\fR-type reminder normally prints a message to the standard
  1172.   output, after passing the \fIbody\fR through a special substitution filter,
  1173. ***************
  1174. *** 264,269 ****
  1175. --- 269,283 ----
  1176.   is used only to place entries in the calendar produced when \fBRemind\fR
  1177.   is run with the \fB\-c\fR, \fB\-s\fR or \fB\-p\fR options.
  1178.   .PP
  1179. + A \fBPS\fR or \fBPSFILE\fR-type reminder is used to pass PostScript code
  1180. + directly to the printer when producing PostScript calendars.  This can
  1181. + be used to shade certain calendar entries, include graphics in the calendar,
  1182. + or almost any other purpose you can think of.  You
  1183. + should not use these types of reminders unless you are an expert PostScript
  1184. + programmer.  The \fBPS\fR and \fBPSFILE\fR reminders are ignored unless
  1185. + \fBRemind\fR is run with the \fB\-p\fR option.  See the section
  1186. + "More about PostScript" for more details.
  1187. + .PP
  1188.   .B DATE SPECIFICATIONS
  1189.   .PP
  1190.   A \fIdate_spec\fR consists of zero to four parts.
  1191. ***************
  1192. *** 2267,2272 ****
  1193. --- 2281,2389 ----
  1194.   places the time of timed reminders in the calendar according to the
  1195.   \fB\-b\fR command-line option.
  1196.   .PP
  1197. + .SH INITIALIZING VARIABLES ON THE COMMAND LINE
  1198. + .PP
  1199. + The \fB\-i\fR option is used to initialize variables on the \fBRemind\fR
  1200. + command line.  The format is \fB\-i\fR\fIvar\fR\fB=\fR\fIexpr\fR, where
  1201. + \fIexpr\fR is any valid expression.  Note that you may have to use quotes
  1202. + or escapes to prevent the shell from interpreting special characters in
  1203. + \fIexpr\fR.  You can have as many \fB\-i\fR options as you want on the
  1204. + command line, and they are processed in order.  Thus, if a variable is defined
  1205. + in one \fB\-i\fR option, it can be referred to by subsequent \fB\-i\fR
  1206. + options.
  1207. + .PP
  1208. + Note that if you supply a date on the command line, it is not parsed until
  1209. + all options have been processed.  Thus, if you use \fBtoday()\fR in any
  1210. + of the \fB\-i\fR expressions, it will return the same value as
  1211. + \fBrealtoday()\fR and not the date supplied on the command line.
  1212. + .PP
  1213. + Any variables defined on the command line are \fBpreserved\fR as with the
  1214. + \fBPRESERVE\fR command.
  1215. + .PP
  1216. + You should not have any spaces between the \fB\-i\fR option and the equal
  1217. + sign; otherwise, strange variable names are created which can only be accessed
  1218. + with the \fBvalue()\fR or \fBdefined()\fR functions.
  1219. + .PP
  1220. + If your site uses the \fBRemind-all\fR shell script to mail reminders
  1221. + to users, the script will initialize the variable \fIremind_all\fR to 1
  1222. + using the \fB\-i\fR option.  Thus, you can detect when your reminder
  1223. + script is being processed by \fBRemind-all\fR and can use this information
  1224. + to control which reminders you want mailed to you.
  1225. + .PP
  1226. + .SH MORE ABOUT POSTSCRIPT
  1227. + .PP
  1228. + The \fBPS\fR and \fBPSFILE\fR reminders pass PostScript code directly
  1229. + to the printer.  They differ in that the \fBPS\fR-type reminder passes
  1230. + its body directly to the PostScript output (after processing by the
  1231. + substitution filter) while the \fBPSFILE\fR-type's body should
  1232. + simply consist of a filename.  The \fBRem2ps\fR program will open the
  1233. + file named in the \fBPSFILE\fR-type reminder, and include its contents in
  1234. + the PostScript output.
  1235. + .PP
  1236. + The PostScript-type reminders for a particular day are included in the
  1237. + PostScript output in the same order they were triggered in the \fBRemind\fR
  1238. + script file.  All of the PostScript code for a particular date is enclosed
  1239. + in a \fBsave\fR-\fBrestore\fR pair.  However, if several PostScript-type
  1240. + reminders are triggered for a single day, each section of PostScript is
  1241. + not enclosed in a \fBsave\fR-\fBrestore\fR pair - instead, the entire
  1242. + body of included PostScript is enclosed.
  1243. + .PP
  1244. + PostScript-type reminders are executed by the PostScript printer before any
  1245. + regular calendar entries.  Thus, regular calendar entries will overlay
  1246. + the PostScript-type reminders, allowing you to create shaded or graphical
  1247. + backgrounds for particular days.
  1248. + .PP
  1249. + Before executing your PostScript code, the origin of the PostScript coordinate
  1250. + system is positioned to the bottom left-hand corner of the "box" in the
  1251. + calendar representing \fBtoday()\fR.  This location is exactly in the middle
  1252. + of the intersection of the bottom and left black lines delineating the box -
  1253. + you may have to account for the thickness of these lines when calculating
  1254. + positions.
  1255. + .PP
  1256. + Several PostScript variables are available to the PostScript code you supply.
  1257. + All distance and size variables are in PostScript units (1/72 inch.)  The
  1258. + variables are:
  1259. + .TP
  1260. + LineWidth
  1261. + The width of the black grid lines making up the calendar.
  1262. + .TP
  1263. + Border
  1264. + The border between the center of the grid lines and the space used to print
  1265. + calendar entries.  This border is normally blank space.
  1266. + .TP
  1267. + BoxWidth and BoxHeight
  1268. + The width and height of the calendar box, from center-to-center of the
  1269. + black gridlines.
  1270. + .TP
  1271. + InBoxHeight
  1272. + The height from the center of the bottom black gridline to the top
  1273. + of the regular calendar entry area.  The space from here to the top
  1274. + of the box is used only to draw the day number.
  1275. + .TP
  1276. + /DayFont, /EntryFont, /SmallFont and /HeadFont
  1277. + The fonts used to draw the day numbers, the calendar entries, the small
  1278. + calendars, and the month and day headings, respectively.
  1279. + .TP
  1280. + DaySize, EntrySize and HeadSize
  1281. + The sizes of the above fonts.  (The size of the small calendar font
  1282. + is \fInot\fR defined here.)  For example, if you wanted to print
  1283. + the Hebrew date next to the regular day number in the calendar, use:
  1284. + .PP
  1285. + .nf
  1286. +     REM PS Border BoxHeight Border sub DaySize sub moveto \\
  1287. +        /DayFont findfont DaySize scalefont setfont \\
  1288. +        ([hebday(today())] [hebmon(today())]) show
  1289. + .fi
  1290. + .PP
  1291. + .RS
  1292. + Note how /DayFont and DaySize are used.
  1293. + .RE
  1294. + .PP
  1295. + Note that if you supply PostScript code, it is possible to produce invalid
  1296. + PostScript files.  Always test your PostScript thoroughly with a PostScript
  1297. + viewer before sending it to the printer.  You should not use any document
  1298. + structuring comments in your PostScript code.
  1299. + .PP
  1300.   .SH DAEMON MODE
  1301.   .PP
  1302.   If you use the \fB\-z\fR command-line option, \fBRemind\fR runs in the
  1303. ***************
  1304. *** 2732,2736 ****
  1305.   substitution buffer length, number of global \fBOMIT\fRs, etc.
  1306.   .PP
  1307.   .SH SEE ALSO
  1308. ! .pp
  1309.   rem, elm, kall, rem2ps
  1310. --- 2849,2853 ----
  1311.   substitution buffer length, number of global \fBOMIT\fRs, etc.
  1312.   .PP
  1313.   .SH SEE ALSO
  1314. ! .PP
  1315.   rem, elm, kall, rem2ps
  1316. *** ../p5rel/test.cmp    Thu Apr 22 10:24:19 1993
  1317. --- ./test.cmp    Fri Apr 23 12:59:58 1993
  1318. ***************
  1319. *** 631,637 ****
  1320.   "a05" + "6" => "a056"
  1321.   value("a056") => "SDFJHSDF KSJDFH KJSDFH KSJDFH"
  1322.   set a058 version()
  1323. ! version() => "03.00.05"
  1324.   set a059 wkday(today())
  1325.   today() => 1991/02/16
  1326.   wkday(1991/02/16) => "Saturday"
  1327. --- 631,637 ----
  1328.   "a05" + "6" => "a056"
  1329.   value("a056") => "SDFJHSDF KSJDFH KJSDFH KSJDFH"
  1330.   set a058 version()
  1331. ! version() => "03.00.06"
  1332.   set a059 wkday(today())
  1333.   today() => 1991/02/16
  1334.   wkday(1991/02/16) => "Saturday"
  1335. ***************
  1336. *** 735,741 ****
  1337.           a048  "foo"
  1338.           a067  "INT"
  1339.           a039  "February"
  1340. !         a058  "03.00.05"
  1341.           a049  21
  1342.           a068  "STRING"
  1343.           a059  "Saturday"
  1344. --- 735,741 ----
  1345.           a048  "foo"
  1346.           a067  "INT"
  1347.           a039  "February"
  1348. !         a058  "03.00.06"
  1349.           a049  21
  1350.           a068  "STRING"
  1351.           a059  "Saturday"
  1352. *** ../p5rel/token.c    Thu Apr 22 10:59:12 1993
  1353. --- ./token.c    Fri Apr 30 13:14:20 1993
  1354. ***************
  1355. *** 75,80 ****
  1356. --- 75,82 ----
  1357.      { "once",         3,     T_Once,        0 },
  1358.      { "pop-omit-context", 3,    T_Pop,        0 },
  1359.      { "preserve",        8,      T_Preserve,     0 },
  1360. +    { "ps",         2,     T_RemType,     PS_TYPE },
  1361. +    { "psfile",         6,     T_RemType,     PSF_TYPE },
  1362.      { "push-omit-context", 4,     T_Push,        0 },
  1363.      { "rem",        3,    T_Rem,        0 },
  1364.      { "run",         3,     T_RemType,     RUN_TYPE },
  1365. *** ../p5rel/types.h    Thu Apr 22 10:24:21 1993
  1366. --- ./types.h    Fri Apr 30 13:13:31 1993
  1367. ***************
  1368. *** 98,103 ****
  1369. --- 98,105 ----
  1370.   #define RUN_TYPE 2
  1371.   #define CAL_TYPE 3
  1372.   #define SAT_TYPE 4
  1373. + #define PS_TYPE  5
  1374. + #define PSF_TYPE 6
  1375.   
  1376.   /* DEFINES for debugging flags */
  1377.   #define DB_PRTLINE   1
  1378.