Trailing-Edge - PDP-10 Archives - mit_emacs_170_teco_1220 - emacs/maichk.emacs
There are no other files named maichk.emacs in the archive.
!* -*-TECO-*- !
!~FILENAME~:! !Command to automatically check mail!
!& Setup MAICHK Library:! !S Init checker!
  0M.VMail_Checker		    !* stores mailcheck code (buffer)!

  F[BBIND			    !* Push for a temporary buffer!
  FQ..F"G G..F'			    !* Get what is in Secretary Macro!
    "# 28I'			    !* If nothing then put the CTRL-\ to pop!
  J :SMAIL_WATCH"E J		    !* If the words Mail Watch are NOT there!
      @I\QMAIL_WATCHF"N M(M.M CHECK_MAIL)'\ 13I 10I '   !* add this line.!
  HFX..F			    !* Everything goes back to ..F!
  F]BBIND			    !* Pop the buffer.!
  Q..FU.F			    !* Store it in .F also, since emacs has a!
				    !* convention that normally ..F=.F!
!Check Mail:! !C Checks to see if user has new mail.
Give this command a following string argument of a username (no
brackets, no recognition) to check someone else's mail.!

!* Taken from the library MAICHK!

!* Terrible hack: EMACS has no way of checking fdb's without opening the file,
so need to execute some machine code of our own to do it.!

[..O 1[1
    FF"N			    !* [PJG] To prevent a mishap in!
				    !* the calling!
	"L 0'"# 'U1'
  q1"E QBuffer_Filenames"E ''   !* don't do automatic check if not!
				    !* editing a file.  Mainly this!
				    !* avoids doing it on startup, I think!
  3,fUser:_ [2		    !* get desired username in 2!
  QMail_CheckerF"N U..O'"#	    !* get code if it exists!
    FS B CREATE F[D FILE	    !* create new buffer, save state!
    EREMACS:MAICHK.CODE FY EC	    !* Read code into buffer!
    Q..O UMail_Checker'	    !* And save it for future!
  10f2			    !* insert username in buffer, plus null!
  q1M(FS REALAD/5)		    !* execute the buffer!
  10J 1A"N			    !* If there's anything to say, it's!
				    !* in a string starting at word 2!
    :I*CFSECHO DISPLAY	    !* Clear Echo Area!
    q1"E 7FSECHO DISPLAY'	    !* Ring bell if unexpected!
    @T'"#			    !* print message!
    q1-1"E :i*C[No_new_mail]
FSECHODISP''			    !* If explicit arg and no mail, say so!