Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
From: calmar <mac@calmar.ws>
Subject: notify after automatic mail recieving
Date: Thu, 26 Jun 2003 00:31:54 +0200	[thread overview]
Message-ID: <brwldc11.fsf@calmar.ws> (raw)

calmar wrote:


> 
> What I would like is when gnus can notify me when new mails
> arrived.
> p.e with a pop-up windows, or just an external program which
> might play a nice sound or however.
> 
Obviously this could be a solution:

,----
| (defun gnus-notify-if-new-news-arrived()
|   "are there new unread mails in `the' Group?"
| (if  (nnmail-new-mail-p (gnus-group-real-name "INBOX"))
|               (call-process  "your-notify-program"))) ;
| 
| (defun my-gnus-get-new-mail ()
|   "Fetch new mails at group-level x only."
|   (when (gnus-alive-p)
|     (let ((gnus-verbose-backends 1)
| 	  (gnus-verbose 1)
| 	  (win (current-window-configuration)))
|       (unwind-protect
| 	  (save-window-excursion
| 	    (save-excursion
| 	      (set-buffer gnus-group-buffer)
| 	      (gnus-group-get-new-news 3) ; x ->group-level
|               (gnus-notify-if-new-news-arrived)))     ;  <<<<<<<<<<<<<<<
| 	(set-window-configuration win)))))
| 
| (gnus-demon-add-handler 'my-gnus-get-new-mail 7 nil) ;time
| (gnus-demon-init)
`----

the nnmail-new-mail-p seems to work AFAI was able to see so far.

I have also the idea of renaming the title of the (x)emacs main-window,
which will be visible when the program is minimized in the
taskbar I think (instead of `your-notify-program'). Title with the number of unread messages.

Greetings
calmar


             reply	other threads:[~2003-06-25 22:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-25 22:31 calmar [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-06-25  8:47 calmar

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=brwldc11.fsf@calmar.ws \
    --to=mac@calmar.ws \
    /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).