[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Mail Watcher
I am new to info.slug. How do I go about posting/distributing this code?
I have developed an interesting little hack that watches your mail files and
lets you know if you have any unread mail. It either reverse videos a portion
of the status line, or displays an icon in the margin outside the "normal"
window area. It totals about 8 pages of code.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; ;;;
;;; This program runs every 5 minutes to check for unread mail and sound alarm. ;;;
;;; If it detects any unread mail, it flashes and reverse videos a part of ;;;
;;; the status line or draws an icon in the margin outside the normal windows. ;;;
;;; If the unread mail file is newer than the last time, then ;;;
;;; a pretty noise is made to alert you. When the noise is made, and its ;;;
;;; volume, are user controllable. ;;;
;;; ;;;
;;; MAIL-WATCHER-ON is used to initialize the mail watcher. ;;;
;;; It uses keyword parameters to initialize the configuration variables. ;;;
;;; MAIL-WATCHER-OFF is used to turn off the mail watcher. ;;;
;;; CONFIGURE-MAIL-WATCHER can be used to interactively initialize the watcher, ;;;
;;; or to tailor the system on the fly. It uses a pop-up menu. ;;;
;;; SHOW-MAIL-WATCHER-CONFIGURATION prints a pretty list of the current ;;;
;;; mail watcher configuration values and timer queue status. ;;;
;;; ;;;
;;; There are also three system commands built by this file: ;;;
;;; Configure Mail Watcher ;;;
;;; Disable Mail Watcher ;;;
;;; Show Mail Watcher Configuration ;;;
;;; ;;;
;;; Include the following in your lispm-init.lisp file and it will ;;;
;;; automagically clean itself up when you logout: ;;;
;;; (user::login-forms ;;;
;;; (mail-watcher-on)) ;;;
;;; ;;;
;;; Author: Chris Wood Sept 12, 1989 ;;;
;;; chris@austin.lockheed.com ;;;
;;; ;;;
;;; Only works with Genera 7.2 (changes in timer queue functions) ;;;
;;; ;;;
;;; Interesting Hacks: Drawing in margins outside of "normal" window area ;;;
;;; Accessing status line ;;;
;;; Timer Queue manipulation ;;;
;;; Sounds ;;;
;;; Universal Time functions ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; TUTORIAL
;
;New incoming mail is placed in a file named: server:>user>mail.text, where "server" is
;the name of your server, and "user" is your login name. When you enter Zmail (Select-M)
;and mouse on "Get Inbox", this file is read into a Zmail buffer (same as Zmacs buffer)
;named mail._ZMAIL_text, which is displayed in the top half of the Zmail screen, and
;saved when you mouse on "Save". This Mail Watcher system monitors your mail.text file.
;Every 5 minutes (or whatever interval you choose), it wakes up, and looks for the
;mail.text file. If one exists, then you have received mail that has not been read
;into the mail._ZMAIL_text buffer. In other words, you have some unread mail. When
;the mail watcher finds this file, it checks the creation date, and if the file was
;created since the last time the mail watcher ran, it makes a pretty sound and flashes
;a visible marker on your screen. In any case, it leaves a visible indicator on your
;screen that you have some unread mail. The following global variables control how the
;mail watcher works:
;
;*mail-box*
; This is the name of your mailbox. It defaults to server:>user>mail.text. You
; can override it if you wish, for example, to monitor mail received on a Unix system.
;
;*mail-sound*
; This parameter determines when the unread mail sound is made. It has three options:
; :new-only Make sound when unread mail exists, and it has arrived since last check
; :any Make sound when any unread mail exists, even if checked already
; :never Never make sound, just display notice as icon or reverse video
; Defaults to :new-only.
;
;*mail-sound-volume*
; This determines the volume of the sound. Must be between 0.0 and 1.0. Anything
; below about .6 is inaudible. This setting does not change your default sound
; volume, only the volume of the new mail alarm. Defaults to .8.
;
;*mail-where*
; Where do you want the unread mail notification to appear. You have two options:
; :icon put an icon in the margin area of the screen (see *mail-margin*)
; :status-line inverse video a portion of the status line at the bottom of the
; screen (see *mail-status-area*)
; Defaults to :icon.
;
;*mail-margin*
; If you choose to display the mail icon, then you can display it to the right or left
; side of your screen, depending on your personal preference, or the way your screen is
; centered.
; :right Put the mail icon in the margin just to the right of the main screen area
; :left Put the mail icon in the margin just to the left of the main screen area
; Defaults to :right.
;
;*mail-status-area*
; If you choose to display the mail notice on the status line, then you can control
; which section of the status line to invert. There are 5 choices on the status line,
; reading from left ot right:
; Clock User-or-Process Package Run-State Progress-Notes
;
;*mail-delay*
; How long, in seconds, do you wish to delay between mail checks. Defaults to 300
; seconds, or 5 minutes.
;
;*mail-polite-p*
; If T, then the mail-watcher will deactivate betweeen the hours of 6 PM and 6 AM.
; This makes sure that the file server connection between your machine and the host
; file server owning your mail files is allowed to close. This makes the life of
; system administrators easier in that they don't have to check to make sure you are
; not really working at 2:00 in the morning when they do their maintenance.
; Defaults to T.
;
;MAIL-WATCHER-ON is used to initialize the mail watcher from your lispm-init
;It uses keyword parameters to initialize the controlling variables.
;Include the following in your lispm-init.lisp file and it will
;automagically clean itself up when you logout:
; (user::login-forms
; (mail-watcher-on ...))
;
;CONFIGURE-MAIL-WATCHER can be used to interactively initialize the watcher,
;or to tailor the system on the fly. It uses a pop-up menu.
;
;MAIL-SOUND is the function that makes the pretty noise. Feel free to experiment
;with it to make your own pretty noise.
chris@austin.lockheed.com
Lockheed, Austin ,Texas