Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
From: Nevin Kapur <nevin@jhu.edu>
Subject: Re: mail delivery notification (using color) -- a solution found
Date: Thu, 29 Aug 2002 21:38:53 -0400	[thread overview]
Message-ID: <m34rddp1le.fsf@fermat.mts.jhu.edu> (raw)
In-Reply-To: <8z2p64co.fsf@random.localnet.UnwiredUniverse.com>

Derrell.Lipman@UnwiredUniverse.com writes:


[...]

> This is wicked cool!  Now, how do I modify it so that it only notifies me of
> new mail with a color change if mail has been added to certain groups?  I
> split spam and unimportant stuff to various groups.  I don't need to be
> interrupted with the color change just to tell me that I have new spam.
> Anyone able to help me with this?

Here is some code-snippet that I use.  It plays a should when I get
mail in certain folders.  You can easily modify it so that it changes
color instead of playing a sound.

(defvar nk-gnus-beepable-groups "mail/Mailbox"
  "A regexp that matches groups for which mail notification should \
take place.")

(defun nk-gnus-notify ()
  "Beep if we got mail in an interesting folder."
  (let ((you-got-mail nil)
	(case-fold-search t))
    (dolist (group nnmail-split-history)
      (when (string-match nk-gnus-beepable-groups (caar group))
	  (setq you-got-mail t)))
    (when you-got-mail 
      (progn (call-process "esdplay" nil 0 nil "/usr/share/sounds/phone.wav")
	     (ding)))))

(add-hook 'gnus-after-getting-new-news-hook 'nk-gnus-notify)



-Nevin


           reply	other threads:[~2002-08-30  1:38 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <8z2p64co.fsf@random.localnet.UnwiredUniverse.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m34rddp1le.fsf@fermat.mts.jhu.edu \
    --to=nevin@jhu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).