lamour> Date: Mon, 7 Dec 92 12:01:40 EST
lamour> From: lamour@maestro.mitre.org (Michael Lamoureux)
lamour> References: <9212070943.AA02917@CIS.Prime.COM>
lamour> 
>>>>> On Mon, 7 Dec 92 09:43:57 GMT, David Hughes <djh@CIS.Prime.COM> said:
lamour> 
david> reportmail is a neat package supplied in ..lisp/packages which
david> reports in your emacs modeline and minibuffer when new mail
david> arrives, telling you who from and the subject. The header text
david> in lisp/packages/reportmail.el will explain how to set it up.
lamour> 
lamour> 	Has anyone looked at making it use a different sound than the
lamour> standard "beep" when mail arrives (if you have the beep turned on)?  I
lamour> like the notification, but I'd like to be able to distinguish it from
lamour> all the other things that just "beep".
lamour> 
lamour> 	While I'm here, has anyone ported Jamie's Gnus highlighting
lamour> stuff to VM yet?  I love the feature in Gnus, and it would make mail
lamour> so much easier to read...
lamour> 
lamour> 
lamour> Thanks,
lamour> Michael
lamour> lamour@mitre.org


I agree with making a differenct sound for mail.  Any of the lisp
methods that issue a beep should offer a change of sound.  I tried to
get the sound variable out of the sound-alist and send it to beep.  has
anyone been able to do this.  The only work around I found was to make
an independant variable.  I would much rather add to the sound-alist.
Here is how I changed reportmail to send a different sound.  (I
recorded my own 'mail call' sound)

(defvar mail-call-sound nil
  "*sound to play when mail arrives (with the reportmail.el system)")

(defun display-time-process-good-message ()
  (display-time-debug "Formatting message announcement (good message)")

  ;; Update the message counter
  (setq display-time-msg-count (+ display-time-msg-count 1))

  ;; Format components of announcement
  (let* ((subject (display-time-get-field "Subject" ""))
	 (from (display-time-get-field "From" ""))
	 (to (display-time-get-field "To" ""))
         (print-subject (if (string= subject "")
			    ""
			    (concat " (" subject ")")))
	 (print-from (display-time-truncate from display-time-max-from-length))
	 (short-from (display-time-truncate 
		      (display-time-extract-short-addr from) 25))
	 (print-to (if (display-time-member to display-time-my-addresses)
		       ""
		       (display-time-truncate 
			(display-time-extract-short-addr to)
			display-time-max-to-length))))

    ;; Announce message
    (let ((msg (concat 
		   (display-time-format-msg-count)
		   "Mail " 
		   (if (string= print-to "") "" 
		       (concat "to " print-to " "))
		   "from " print-from 
		   print-subject)))
      (if display-time-use-xbiff
	  (save-excursion
	    (let ((tmp-buf (generate-new-buffer "*Tmp*")))
	      (set-buffer tmp-buf)
	      (insert msg)
	      (newline)
	      (append-to-file (point-min) (point-max) 
			      display-time-mail-arrived-file)
	      (kill-buffer tmp-buf))))
      (display-time-debug "Message: %s" msg)
      (display-time-message "%s" msg))

    (if display-time-mail-ring-bell (ding nil mail-call-sound))
    
    ;; Update mode line information
    (setq display-time-mail-who-from short-from)))

--
Mike Battaglia
DSC Communications Corp

(214) 519-3253
mbattagl@dsccc.com


==================================================================

The universe never did make sense; I suspect that it was built on
government contract.

	*** heinlein ****

==================================================================

--
Mike Battaglia
DSC Communications Corp

(214) 519-3253
mbattagl@dsccc.com


==================================================================

The universe never did make sense; I suspect that it was built on
government contract.

	*** heinlein ****

==================================================================
Newsgroups: alt.security