XEROX CALENDAR 2 4 1 CALENDAR 1 4 By: Michel Denber (Denber.WBST @ Xerox.COM) INTRODUCTION CALENDAR is a program which can be used to display a calendar on your screen, and keep track of events and appointments. CALENDAR 1.85 (the current distributed version) runs only in the Koto release of InterlispD. The version number appears in the title bar of each Calendar window. CALENDAR needs the LispUsers package PROMPTREMINDERS, which it loads automatically. STARTING CALENDAR Load CALENDAR.DCOM onto your machine and then type (CALENDAR). You will get a menu of years (the menu always shows five years starting with last year). If you select a year with Left, it will create a Year Window containing a calendar for that year. Each month in the Year Window is also a menu item. If you now select a particular month with Left, CALENDAR will create a Month Window showing a calendar for that month. You can now select a particular day within the month to bring up a Day Window. The Month Window also shows small calendars of last month and next month. You can bring up those months in the Month Window by selecting them. The Year menu has an entry labelled "Other". If you select this, it will prompt you to type in a year, if you want one that isn't on the menu. The calendar algorithm is valid only for years between 1700 and 2100. CALENDAR uses the Prompt Window to display informative messages. You can SHRINK any of the CALENDAR windows to an appropriate icon when they are not needed. The reminder facility remains active. Please send your comments, suggestions, and bug reports to me - Denber.WBST (ARPA: Denber.WBST@Xerox.COM). Thanks. REMINDERS Creating reminders Select the year and month you want as described above. Then select with Left the day you want the reminder to appear in. This will bring up a Day Window. Initially the Day Window is empty except for an ADD menu item. If you select ADD, you will be asked in the Prompt window for a time and a reminder description. The time can be entered in almost any reasonable format, eg. 9:00 AM, 9 AM, 9 a.m., 2:30 PM, 2:30 P.M., 1430, or can be left out by just pressing the return key. Times are "AM" by default, so if you only type 8:30, it will assume 8:30 AM. A heuristic is included to ask "Are you sure?" if you type a time earlier than 8 without an AM/PM qualifier. The reminder cannot exceed one line in length (when you type a CR it assumes you're done). Your reminder is then displayed in the Day Window and stored on the active reminder list. The reminder will also appear, truncated, in the proper day in the Month window. When the day and time of that reminder arrives, the program will let you know by displaying the reminder in the Prompt window and flashing the screen. Typing any key stops the reminding action. If you did not give a time for that reminder, it will not flash. Untimed reminders are useful for storing information about birthdays, holidays, or other events associated with a particular day, but no particular time. Expired timed reminders are automatically deleted upon expiration by default. Setting the variable CALKEEPEXPIREDREMS (see Programming, below) will cause timed reminders to be retained after firing. Reminders which are scheduled for a time when your machine is not running will be activated the next time you login. Changing reminders The times that appear at the left of each reminder in the Day Window are also menu items which you can select if you want to specify a particular option or disposition of the reminder. Clicking the left mouse button over a time will bring up a Disposition Menu. The following options are currently available: Flash (the default action) - The reminder is flashed in the prompt window. If you do not acknowledge it, it starts flashing the entire screen. You acknowledge the reminder (and cancel the flashing) by typing any key (the space bar, for instance). Beep - The reminder causes your Dandelion (or D0 if you have the TI sound chip) to beep. SendMail - The reminder is mailed to the recipient(s) of your choice. You will be prompted for their names. Note that no validity checking is done when you enter a name, so your message could conceivably not be delivered if you typed the name wrong, for example. The message is mailed when the time arrives. Of course, this assumes that your system is running at that time, and that you have Lafite active. Delete - Useful for deleting reminders that you no longer need. By default, timed reminders are deleted automatically after they "fire"; untimed reminders do not fire and are never deleted automatically. CALENDAR will immediately remove reminders which you delete from the month window, however it will leave reminders that have fired visible in the window until you redisplay it (eg. September is visible, you select REDISPLAY from the right-button menu in the title bar or select September again in the Year window, and all fired September reminders will be purged from the month window when it redraws). A variable, CALKEEPEXPIREDREMSFLG, is provided if you want your timed reminders to be kept even after they have fired. See Programming, below. Saving reminders Your active reminders are saved when they are created in a file called CALREMINDERS in a directory specified by the value of the variable CALDEFAULTHOST&DIR. The first time Calendar saves your reminders, it will ask you to provide a host and directory where you would like your reminders file to be stored. You should enter this in the usual format, for example {DSK} or {FILESERVER}LISP>. This will become the new value of CALDEFAULTHOST&DIR (it is initially NIL). If you abandon your sysout or if your machine crashes, you can have Calendar automatically reload your reminders file by initializing CALDEFAULTHOST&DIR in your init file. If you haven't done this, you can always reload the reminders file at any time by saying LOAD (CALREMINDERS). By default, the program will save each reminder as soon as it is created. You may wish to reduce the overhead of rewriting the file each time by setting the variable CALUPDATEONSHRINKFLG to T. See Programming, below.That will cause Calendar to save your reminders only when you shrink the Month window. This is useful when you are entering many reminders at the same time, but it means you must remember to explicitly shrink the month window or your reminders will be lost if your machine dies. CALUPDATEONSHRINKFLG is initially NIL. An "almanac" reminder file is distributed along with Calendar. It contains a variety of holidays and notable dates for the year. The file is called CALMANACnn, where nn is the last two digits of the year. For example, the file for 1986 is called CALMANAC86. You can load this file in the same way as CALREMINDERS. PROGRAMMING A programmatic interface is provided to let you create day, month, or year windows from your own programs. Functions (CALENDAR m d yr) [Function] m, d, and yr are integers specifying a month, day, and year, respectively. Arguments are specified as follows: If only yr (must be 4 digits) is supplied, brings up a year window for that year and returns yr. If m and yr are supplied, brings up a month window for that month and returns m. If m, d, and yr are supplied, brings up a day window for that day and returns d. For invalid combinations (missing yr, d and yr only), returns NIL. Also returns NIL if yr is out of range (the calendar algorithm is only valid for years between 1700 and 2100). Examples: (CALENDAR NIL NIL 1984) shows a calendar for 1984 and returns 1984. (CALENDAR 10 NIL 1984) shows a calendar for October 1984 and returns 10. (CALENDAR 10 NIL 84) returns NIL (out of range). (CALENDAR 10 21 1984) shows October 21st, 1984 and returns 21. You can also call Calendar with the keywords TODAY, THISMONTH, and THISYEAR. Examples: (CALENDAR 'THISYEAR) shows a Year window for 1986, if this year is 1986. This might be used in an init file, to always start a Calendar of "this year" no matter what year it is. (CALENDAR 'TODAY) opens a Day window for today, containing all of today's active reminders. Variables CALUPDATEONSHRINKFLG [Variable] Initially NIL. This will cause Calendar to save your reminder file only when you shrink the Month window. This is useful when you are entering many reminders at the same time, but it means you must remember to explicitly shrink the month window or your reminders will be lost if your machine dies. The default action is to save each reminder to disk as soon as it is created. CALKEEPEXPIREDREMSFLG [Variable] Initially NIL. If you set this to T, CALENDAR will not automatically delete reminders when they fire (they can still be deleted using the Delete menu command, above). The default action is to delete reminders when they fire, although they will remain visible until the window is redisplayed. CALFONT [Variable] Initially 'TimesRoman36. This variable controls the font used to display the Month Window. You can change it for example, by saying (SETQ CALFONT (FONTCREATE 'HELVETICA 18)). The change takes effect the next time you display a month. CURRENT LIMITATIONS Reminders which exceed the width of the Day Window are simply truncated. Only one year, month, and day window can be shown at any given time. KNOWN BUGS Today-circling function doesn't work right. Sometimes breaks under LOGXOR when displaying reminders. (Due to a utility used by Calendar %should not happen after v. 1.73). FIXED BUGS Sometimes the ADD menu is placed incorrectly in the Day Window the very first time you open it. Reloading sometimes caused existing reminders to disappear. Unbound atom when first call to Calendar includes optional arguments. Text alignment problems in Day Windows. Year menus not updating properly. FUTURE PLANS Multiple year and month windows. "Grouped days", eg. "Vacation - 10th through 20th". Month selection from year icon as well as expanded year window. (LIST ((PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC)) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC)) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC)) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC)) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC)) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC)) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))))) (  (  1 ( ((8(8D PAGEHEADING RUNNINGHEAD(( MODERN MODERN MODERN MODERN MODERN MODERNLOGO HELVETICA   HRULE.GETFNMODERN  HRULE.GETFNMODERN  HRULE.GETFNMODERN   HRULE.GETFNMODERN  HRULE.GETFNMODERN , r bs ru7V[> k   paQQ EJ4@M ]  z '   I E ,]$ a<G(" !4@'(z