;;; these macros check for MIT mail. /set hasmail 0 /def mailcheck = \ /if (regmatch("!You don't have any mail waiting.", $(/sys from -t))) \ /set hasmail 0 %; \ /elseif (!hasmail) \ /echo -A You have new mail. %; \ /set hasmail 1 %; \ /endif /def mailwatch = \ /echo %% Executing /mailwatch... /set status_int_mail hasmail ? "(Mail)" : "" %; \ /repeat -0:05 i /mailcheck /mailwatch /mailcheck ;;; Rebinds CTL-L to also call /mailcheck if we're watching for MIT mail /unbind ^L /bind ^L = /dokey redraw %; /if (hasmail) /mailcheck %; /endif