Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!bbn!jr@bbn.com From: jr@bbn.com (John Robinson) Newsgroups: gnu.emacs Subject: Re: mail beep Message-ID: <39946@bbn.COM> Date: 15 May 89 15:32:13 GMT References: Sender: news@bbn.COM Reply-To: jr@bbn.com (John Robinson) Distribution: na Organization: BBN Systems and Technologies Corporation, Cambridge MA Lines: 33 In-reply-to: ghh@clarity.princeton.edu (Gilbert Harman) In article , ghh@clarity (Gilbert Harman) writes: >Is there a way to get (display-time) or some other process >to beep when mail first arrives, in addition to displaying >"Mail" in the mode-line? In time.el, look for the following two lines in the defun of display-time-filter: ;; Install the new time for display. (setq display-time-string string) Just before them, insert: (if (and (string-match "Mail" string) (not (string-match "Mail" display-time-string))) (ding t)) Now execute the defun with ^X^E, or copy it into your .emacs, or byte-compile all of time.el in your $EMACS/lisp if all your site wants this change. Caveats: I haven't tried this. The ding may be a little disconcerting if it happens in the middle of your typing away at something. The argument to ding prevents its clobbering something you may have been in the middle of. This code depends on the behavior of $EMACS/etc/loadst (that it puts "Mail" in the string when mail is present) - not a serious problem. To make this a real change to time.el it probably needs a config variable, similar to display-time-day-and-date. -- /jr jr@bbn.com or bbn!jr C'mon big money!