XEROX CALENDAR 2 4 1 CALENDAR 1 4 By: Michel Denber (Denber.WBST @ Xerox.COM) Uses: TABLEBROWSER, TEDIT INTRODUCTION CALENDAR is a program which can be used to display a calendar on your screen, and keep track and remind you of events and appointments. Calendar 2.04 (the current distributed version) runs in the Koto or Lyric releases of Xerox Lisp. The version number appears in the title bar of each Calendar window. Calendar needs the Lisp Library package TABLEBROWSER, which it loads automatically. It also uses TEdit. Various font sizes (from 8 to 36) in the families TimesRoman and Helvetica may be needed, depending on the size chosen for month windows. Reminder files created by earlier versions of Calendar are incompatible with this version. I. STARTING CALENDAR Load CALENDAR.LCOM from your favorite LispUsers directory, eg. LOAD ({ERIS}CALENDAR.LCOM] 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 browser (described in the next section). The Month window also shows small calendars of last month and next month. You can bring up those months in the current month window by selecting them with Left. If you select them with Middle, the program will create a new window for that month. 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. You can have as many year and month windows open at the same time as you like. Month and day windows can also be reshaped to occupy less room on the screen. You can Shrink any of the CALENDAR windows to an appropriate icon, or close them when they are not needed. The reminder facility remains active. If you close your last year window, call (CALENDAR) again to get a new one. CALENDAR uses the Lisp Prompt Window to display informative messages. Please send your comments, suggestions, and bug reports to me - Denber.WBST (ARPA: Denber.WBST@Xerox.COM). Thanks. II. REMINDERS The Day Browser Clicking Left in any day in a month window will open a browser on that day. The browser displays each reminder for the day, along with its event time if it is a timed reminder. You may have more than one browser open at the same time. When you close a month window, it will automatically close all day browsers for that month. There is a menu across the top of the browser with the following items: Add: Lets you create a new reminder in this day. If you select Add, the program will bring up a TEdit window containing a template for the new reminder. The template contains several fields you can select and fill in. These are described in Creating Reminders, below. Display: Brings up the full contents of the reminder in a TEdit window. 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 (and the reminder's line in the day browser is crossed out), however it will leave reminders that have fired visible in the month 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). Update: Saves your reminders to disk (see the section on Saving reminders below). Send Mail: Prompts you for a name to send to. The selected reminder will be mailed to that person when it activates, rather than displaying on your screen. 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, that you have Lafite active, and that Lafite is running in the mode (GV or NS) corresponding to your intended recipients. Period: Brings up a menu with the choices Daily, Weekly, Monthly. The selected reminder will be made periodic and will appear at the selected intervals. Creating Reminders You can create a new reminder either by clicking Add in a day browser, or by clicking the middle button in a day box in the month window. This opens a new reminder form with the following fields: Title: The reminder title should not exceed one line in length. This field will be displayed in the Day browser and the month window. This field may not be omitted; all others are optional. Event time: The scheduled time for the event. By default, this is also the time at which the reminder will be activated. If this field is omitted, the reminder is "untimed". Untimed reminders do not alert you. When a timed reminder activates, it beeps and brings up a TEdit window containing the full reminder text. Alert time: The time at which you would like the reminder to activate. You might want to be reminded of a meeting 10 minutes early, for example. The alert time can be set to any time, before or after the event time, as long as it is in the same day. If this field is omitted, it defaults to the value of the event time. Alert: Edit this field to contain just the word Yes or No. If you choose No, the reminder will not alert you, even if it is a timed reminder. If this field is omitted, it defaults to the value set in the Options menu (see Programming below). Duration: The expected length of the event. Version 2.04 makes no use of this field. Message: The actual message you want to save. This may be any TEdit text or omitted entirely. The new reminder form includes a menu with the choices Save and Abort. After filling in the fields you want, clicking Save will add the reminder to the system and close the form. Clicking Abort at any point cancels the reminder being created. 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 skipping over the field. 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 9 without an AM/PM qualifier (this value is controlled by CALDAYSTART, see Programming, below). Times of noon and midnight are special cases. There is no generally accepted meaning for the expressions "12:00 AM" and "12:00 PM". If you want a reminder at noon, enter the time as "12:00" or just "1200". Because reminders are added to a particular day, midnight is ambiguous; there is no provision for entering a time of midnight. If you add a reminder for a time that is already in the past (for example, to keep a historical record of an event after the fact), the program will save the reminder but will warn you that the reminder time has already passed. 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 not be activated the next time you login. This avoids having a possibly long sequence of "dead" reminders popping up at login time. Saving and loading reminders You can save your reminders in a file at any point. The first time tou start Calendar , it will ask you to provide a default host and directory for reminder files. You should enter this in the usual format, for example {DSK} or {ERIS}LISP>. This will become the new value of CALDEFAULTHOST&DIR (it is initially NIL). To save your reminders, select Update from any day browser. This will open a pop-up menu of currently loaded files, plus an "other" item for giving a new file name. If you enter a new name, all currently unsaved reminders will be stored under that name. If you select an existing file, the contents of that file will be updated and any new reminders created since the last update will be added to it. If you abandon your sysout or if your machine crashes, you can have Calendar automatically reload your reminders file when you restart (see CALDEFAULTHOST&DIR and CALLOADFILE in Programming, below). You can also load a reminder file at any time by holding the middle button down in the title bar of a month window. This will open a pop-up menu of files that have already been loaded, plus an "other" item to specify a new file. In this version of Calendar there is never any need to load a reminder file more than once. The menu is useful, however, to show which files have already been loaded. 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 by selecting Other from the middle button menu and typing CALMANAC86. By default, the program will only save your reminders when you select Update. You may control file updating by changing the Auto File Update option available under the Options menu item in the month window. See Programming, below. III. PROGRAMMING A programmatic interface is provided to let you create day, month, or year windows from your own programs. If your reminder text is a Lisp list (anything inside parentheses), when the reminder fires the program will evaluate the list rather than displaying the reminder in a window and beeping. 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". (CALENDAR 'TODAY) opens a Day browser for today, containing all of today's active reminders. (CALLOADFILE file-name) [Function] Loads the file file-name into the reminder system and returns T. Returns NIL if the file is not found or is not a valid reminder file. Example: (CALLOADFILE '{DSK}CALREMINDERS) Variables CALALERTFLG [Variable] Initially T. This controls whether or not reminders whose Alert field is not specified should alert you when they fire. T means they will. NIL means they won't. CALDAYDEFAULTREGION [Variable] Initially (32 200 350 100). This specifies the default size for day browsers. The location is only used for day browsers opened programatically. CALDAYSTART [Variable] Initially 900. This represents the time (in 24 hour format) at which your regular day starts. The system will use it to confirm times you enter without a "PM" indicator if they are less than this value. For example, it is more likely that 4 means 4 PM than 4 AM. CALDEFAULTALERTDELTA [Variable] Initially 0. This represents the time (in minutes) before or efater the event time you want reminders to be activated, if no explicit alert time was given for them. To be reminded before the event, make this value negative. The resulting time must still be in the same day as the event. CALDEFAULTHOST&DIR [Variable] Initially NIL. This is the host and directory on which your reminder files will be saved if you type the file name without a directory specification. The system will prompt you to enter a value for this the first time you start it. CALFLASHTIMES [Variable] Initially 0. Specifies the number of times to flash the destination given by CALFLASHTYPE when a reminder is activated. CALFLASHTYPE [Variable] Initially 'None. Specifies which window should be flashed when a reminder is activated. Can be set to 'WINDOW, to flash the reminder display window, or 'SCREEN to flash the entire screen. CALFLASHTIMES (above) should be set to the desired number of flashes. 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. If you reshape a month window, the program will try to find a smaller font to fit the new window size, but the value of CALFONT will not be changed. CALHARDCOPYPOMFLG [Variable] Initially T. This variable controls the printing of the phase-of-the-moon icons when you hardcopy a month window. Setting it to NIL suppresses this printing. Month windows are hardcopied at printer resolution in Koto, screen resolution in Lyric. CALHILITETODAY [Variable] Initially 'CIRCLE. This variable determines how today's date will be highlighted in a month window. The default is to draw a circle cround it. If you set this to 'BOX, a light gray grid will be placed over the date. Setting this to NIL suppresses all date highlighting. 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. CALMONTHDEFAULTREGION [Variable] Initially (32 32 868 700). This specifies the default position and size for month windows. If you set the size to a value small enough to allow several month windows side by side, the windows will tile left to right, bottom to top. CALREMDISPLAYREGION [Variable] Initially (200 400 300 400). This specifies the default position and size for reminder display windows. CALTUNE [Variable] When a reminder is activated, it will play the tune stored here (in PLAYTUNE format).This is initially a two-note "ding-dong". Set this to NIL if you want no audible warning. 1100's and 1132's have no hardware for sound. CALUPDATEONSHRINKFLG [Variable] Initially 'Never. This means that Calendar will save your reminders on a file only when you explicitly click Update from a Day Browser. If set to 'Shrink, it will cause Calendar to save your reminder file automatically 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. If set to 'Always, causes Calendar to immediately save each reminder as soon as it is created. You can also set these variables interactively by clicking on the box marked "Options" in any Month window. This brings up a freemenu similar to the TEdit expanded menu. l㧗?iǎ?}ݛgfvm}w nv}߻vnv}ݻffvx}㻗 ? ÌÌ׏͛fv8̓mvlẁw>o珁x00 ٳ3lفl͐0R ߳فpR ͌3  p2 ٳ3 فl302 g>o000 0 0 pÀ 00(HÌ<}f(GKX:ff1`f͘c($H dv٦f1f͙DQFD\f1f͛c|R"HD]lf`1`f͛cD"HDwg<`1>DD; Ì`Ì ͛f6`c a ̓c` m6ccl9````"Ï@`0@$!H@g|@o(AH@03m8@@l03l$ @ @l03l$AH@l0`3l"!H@gl"È|`0À0Ï63ٶ3ٳcٱ@lٱo0    Alert: Specifies the default for the Alert field in the new reminder form. Sets the value of CALALERTFLG (described above). Keep expired rems.: If set to No, the system will automatically delete reminders when they fire (although they remain listed in the month window until the next time you redisplay it). Sets the value of CALKEEPEXPIREDREMSFLG. Auto. file update: Always means that the system will update the reminder file every time you create a new reminder. Shrink means update only when a month window is shrunken. Never means updates will be done only when you explicitly select Update from a Day browser. Sets the value of CALDUPDATEONSHRINKFLG. Alert delta: Sets the value of CALDEFAULTALERTDELTA. Host & dir.: Sets the value of CALDEFAULTHOST&DIR . After you have made the selections you want, click Apply! This sets the selections and closes the menu. If you don't want to make any changes, just close the menu (like closing any window). This preserves the previous settings even if you changed them in the menu. Any changes you make to these variables are not saved automatically in reminder files. IV. LIMITATIONS Day groups must begin and end in the same month. The calendar algorithm is valid only for years between 1700 and 2100. V. KNOWN BUGS Today-circling function occasionally fails to erase the old day. VI. FUTURE PLANS Automatic scheduling. Automatic communication with other Calendars. (LIST ((PAGE NIL (PAPERSIZE LETTER STARTINGPAGE# 28) (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 NIL) (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 NIL . LETTER) (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 NIL) (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 NIL . LETTER) (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 NIL) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))))) (8( ( 1 ( ((8(8D PAGEHEADING RUNNINGHEAD(MODERN MODERN MODERN MODERN MODERNLOGO HELVETICA     HRULE.GETFNMODERN  HRULE.GETFNMODERN  HRULE.GETFNMODERN  HRULE.GETFNMODERN  HRULE.GETFNMODERN -  ?&t @K  6 8 MWDcl   paQQ EJ4@M ^   p .        #  y      '  i   (d BMOBJ.GETFN3MODERN w$ * (d 1 FA.Q/z