Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

mail delivery notification

0 views
Skip to first unread message

Serge Boiko

unread,
Aug 28, 2002, 5:02:31 AM8/28/02
to

I set up Gnus to check and retrieve mail from the pop server every 5
minutes, using a demon. I'd like to have some sort of delivery
notification. While using VM I have these two functions in my VM's
configuration file:

;; If there are new messages on the server, change bckg color:
(add-hook 'vm-spooled-mail-waiting-hook
(lambda ()
(set-face-background 'default "rgb:b9/ca/b9")
))
;;After getting mail change the color back:
(add-hook 'vm-arrived-message-hook
(lambda ()
(set-face-background 'default "rgb:c7/c7/bf")
))


How can I do something similar with gnus? I didn't find any
appropriate hooks.

Maybe someone has other useful ideas?

-Serge

Serge Boiko

unread,
Aug 29, 2002, 5:45:09 AM8/29/02
to
Now I solved this issue, the solution, perhaps, is not elegant, but it
works -- so it's not that stupid :-).

This is what I put into my .gnus:

(add-hook 'nnml-prepare-save-mail-hook
(lambda ()
(set-face-background 'default "lightgoldenrod")
))
(add-hook 'message-sent-hook


(lambda ()
(set-face-background 'default "rgb:c7/c7/bf")
))

I need the second hook to keep my default background color which is
rgb:c7/c7/bf. When I have new mail color become lightgoldenrod, so
even if gnus minimized I know that my new mail is waiting for
me.

-Serge

Kai Großjohann

unread,
Aug 29, 2002, 6:52:59 AM8/29/02
to
Serge Boiko <bo...@demogr.mpg.de> writes:

> Now I solved this issue, the solution, perhaps, is not elegant, but it
> works -- so it's not that stupid :-).
>
> This is what I put into my .gnus:
>
> (add-hook 'nnml-prepare-save-mail-hook
> (lambda ()
> (set-face-background 'default "lightgoldenrod")
> ))
> (add-hook 'message-sent-hook
> (lambda ()
> (set-face-background 'default "rgb:c7/c7/bf")
> ))

Cool trick.

kai
--
A large number of young women don't trust men with beards. (BFBS Radio)

Serge Boiko

unread,
Aug 29, 2002, 8:35:12 AM8/29/02
to
I forgot to say that I have yet another hook to change color
back to the default when the message is selected:

add-hook 'gnus-select-article-hook


(lambda ()
(set-face-background 'default "rgb:c7/c7/bf")
))

-Serge

Derrell...@unwireduniverse.com

unread,
Aug 29, 2002, 12:01:59 PM8/29/02
to
Serge Boiko <bo...@demogr.mpg.de> writes:

> Now I solved this issue, the solution, perhaps, is not elegant, but it
> works -- so it's not that stupid :-).
>
> This is what I put into my .gnus:
>
> (add-hook 'nnml-prepare-save-mail-hook
> (lambda ()
> (set-face-background 'default "lightgoldenrod")
> ))
> (add-hook 'message-sent-hook
> (lambda ()
> (set-face-background 'default "rgb:c7/c7/bf")
> ))

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?

Thanks!

Derrell

Nevin Kapur

unread,
Aug 29, 2002, 9:38:53 PM8/29/02
to
Derrell...@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

Serge Boiko

unread,
Aug 30, 2002, 3:56:34 AM8/30/02
to
thanks, Nevin. Your solution is much more flexible than mine, but I'm
not an expert in Lisp ;-).

-Serge

0 new messages