Google
 

Trailing-Edge - PDP-10 Archives - decuslib20-01 - decus/20-0004/remind.tty
There are no other files named remind.tty in the archive.
The REMIND package is a facility for scheduling LISP events to
take place at a specified later time.  For instance, you may say

	(REMIND (IN 10 MINUTES) (PRIN1 "GO HOME"))	or
	(REMIND (EVERY 2 HOURS)(SYSOUT 'WORK.SAV))	or
	(REMIND (TOMORROW AT 12:30) "meeting with Joe")

Reminders are stored on REMINDERS.LISP on your directory, and
an entry on AFTERSYSOUTFORMS causes them to be loaded via 
LOADREMINDERS; you might also want to call LOADREMINDERS via 
your INIT.LISP file, and you can always call it explicitly.
The hook into the system is through a call to CHECKREMINDERS
the package puts on PROMPTCHARFORMS (and removes when there
are no reminders).


**** NOTE: in all functions, NIL for LISTNAME = REMINDERLST ****


REMIND(WHEN WHAT LISTNAME IDATE)

	An NLAMBDA.  Deciphers WHEN and adds an appropriate entry
	to LISTNAME.  Whenever LISTNAME is not NIL, an entry on
	PROMPTCHARFORMS causes the reminders to be checked against
	the current time.  For any reminders for which the specified
	time has passed, WHAT will be executed. IDATE is not a useful
	parameter in a user call to REMIND.

	WHAT can be an arbitrary expression to be evaluated.
	It can also be a string, atom, or a list (QUOTE atom), in 
	which case what will be evaluated is a call to the function
	REMINDER which will print the string, atom's value, or atom
	respectively, then prompt for a response.  At that time you
	can either say OK, or give a new time to be (re-)reminded.

	WHEN can be an atom, string, or list.  Strings must be full
	date and time specifications as indicated in the TENEX JSYS
	manual (as can be given to LISP's IDATE).  Atoms are 
	interpreted the same as the list (AT atom).  Non-strings
	are converted to all upper case.

SHOWREMINDERS(LISTNAME)
	Displays reminders on LISTNAME and prompts for actions.
	For [confirm] type options, ^E is the way to say "no", in which
	case you will be prompted again for a response.  The options are:
		Nothing
		Delete [confirm]
		Edit entry [confirm]
		Change time [confirm]
		Quit
		List rest (show remainder but don't ask for action)

NOREMINDERS()
	Turns off the entire reminder package, including:
		deleting the reminder list(s)
		removing the AFTERSYSOUTFORM that loads reminders
		removing CHECKREMINDERS from PROMPTCHARFORMS
	Does not affect the reminder file(s).
**** The following functions are not normally called by the user ****

LOADREMINDERS(LISTNAME FILENAME)
	Loads reminders from FILENAME to LISTNAME.  If FILENAME = NIL
	it is determined from the A-list REMINDERFILES and LISTNAME.
	[Thus, (LOADREMINDERS) loads reminders from REMINDER.LISP
	to the list REMINDERLST.  (LOADREMINDERS) is called when REMIND
	is loaded and when starting up a SYSOUT which included REMIND.  A 
	natural time to call this is just after loading the REMIND package, perhaps
	in your LISP initialization.]

STOREREMINDERS(LISTNAME FILENAME)
	Every time LISTNAME is changed by one of the functions in this
	package, it is written out onto FILENAME (old version).
	If FILENAME = NIL, the same convention as for LOADREMINDERS 
	applies.

CHECKREMINDERS(LISTNAME)
	Moves through the entries on LISTNAME checking the current
	time against the time in the entry. If the entry time is
	past the current time, the WHAT part of the entry is
	executed and the next entry is checked; if the time has
	not yet past, the function exits.  (This list is presumed
	to be sorted, earliest time first).

INSERTREMINDER(TIM WHAT LISTNAME)
	Inserts (LIST TIM WHAT) on LISTNAME sorted according to TIM.
 
REMINDER(WHAT LISTNAME)
	Prints WHAT and asks for a response.  OK acknowledges
	the reminder, causing it do disappear.  Anything else
	is interpreted as a new time for requeueing of WHAT
	on LISTNAME via a call to REMIND.
There are various formats for WHEN:

1. IN		(IN 2 HOURS 3 MIN)
		(IN 1 MIN)
		(IN 4 MONTHS)
		(IN 1 WK)
		(IN 2 MIN 30 SECS)

	all do the obvious.  Acceptable units are:
		seconds:  SECONDS, SECOND, SECS, SEC, S
		minutes:  MINUTES, MINUTE, MINS, MIN
		hours:    HOURS, HOUR, HRS, HR, HR
		days:     DAYS, DAY, D	[1 day = 24 hours]
		months:   MONTHS, MONTH	[1 month = 28 days]

2. AT (or ON)
		5PM
		3
		12:30
		4:22:30
		(AT 4:30)
		(ON MONDAY 5PM)
		TOMORROW = TOMMORROW = TOMOROW = TOMMOROW
		(TODAY 6:30)
		(5 JUNE) = (JUNE 5)
		(5 OCTOBER 9) = (OCT 9 5:00) = (5:00AM 9 October)
		(TOMORROW NOON)
		(THE 23)	= the next day which is the 23rd of the month
		(ON THE 1 AT NOON)
		(TOMORROW AT 5PM)

	and so on.  Note that the single atom cases can be given to
	REMIND without embedding in a list beginning with AT.  If no 
	time of day is specified, it will be taken to be 1 second 
	after midnight.  Note that the extraneous ON in the next to
	last example and the extraneous AT in the last are allowed.
	The interpretation of (TODAY 12:XX) with no AM or PM is
	PM unless it is already past 12:XX PM, in which case it is
	interpreted as tomorrow at 12:XX AM.
3. EVERY
		(EVERY 2 HOURS)
		(EVERY 2 MINUTES 30 S)
		(EVERY HOUR)
		(EVERY QUARTER HOUR)
		(EVERY HALF MINUTE)

	same as in, except WHAT is embedded in an expression that
	in addition to evaluating WHAT, will also requeue WHAT
	for the specified amount of time after the time associated
	with the just-evaluated expression.  Thus, if you go away
	and the evaluation actually happens when you come back one
	half hour after the time it was set for, and the interval is
	every hour, the next occurrence will be in one half-hour,
	not one hour.  In addition, you can specify to begin on the 
	hour, half hour, or quarter hour for the first reminder:

		(EVERY HOUR ON THE HALF HOUR)
		(EVERY 20 MINUTES ON THE QUARTER HOUR)

	This last will put the first reminder on the next quarter hour, then
	a new one every twenty minutes after that.
	
	Similarly:

		(EVERY DAY AT . . .)
		(EVERY MONDAY AT . . .)
		(EVERY n AT . . .) where n is a day-of-month, like 18

	Following the AT is a time expression.  Note that
	(EVERY DAY AT 11) will be rescheduled for 11AM if it is
	before 11AM, or 11PM if it is before 11PM, or tomorrow at
	11AM if it is between 11PM and midnight.  Finally, the next
	three are special forms which implie 1 second after
	midnight as the time of day:

		(EVERY DAY)
		(EVERY TUES)
		(EVERY 22)
4. FOR
	If following one of the above kinds of expressions (within the same list)
	there is the atom FOR followed by the same kind of time expression
	that can follow the atom IN as described above, then WHAT will not
	be performed if the remind time has past by more than the amount
	of time specified by the FOR expression.  However, if WHENEXP
	is an EVERY expression, the reminder will be appropriately requeued.

	For example, the time is now 11:50AM.  You type
		(REMIND (IN 5 MINUTES FOR 10 MINUTES) (PRIN1 "XXX"))
	then the first time after 11:55 that the promptcharacter is printed
	if it is still before 12:05 "XXX" will be printed, but if you have not 
	done something for so long that it is now past 12:05, "XXX" will not
	be printed.

5. UNTIL
	Similarly, if instead of FOR you include one of (TO TIL TILL UNTIL)
	then the following time expression will be interpreted as for AT
	expressions described above.  Note that in this case, the "current time"
	is taken to be the time specified in the first part of the expression
	not the current real time.  Thus, if is now 12:30PM Tuesday, then
		(AT NOON UNTIL 1) means do WHAT anytime after
	NOON Wednesday, but not if it is also past 1:00PM on Wednesday.

	These kinds of range limitations are most useful in EVERY statements
	such as (EVERY DAY AT NOON UNTIL 1) which means do it 
	only between noon and 1.  Without the UNTIL in this, you would
	get your probably irrelevant reminder whenever you next
	started up LISP after the next NOON.