* notify after automatic mail recieving
@ 2003-06-25 8:47 calmar
0 siblings, 0 replies; 2+ messages in thread
From: calmar @ 2003-06-25 8:47 UTC (permalink / raw)
Hi,
based on a previous threat I stole this function:
,----
| (defun my-gnus-get-new-mail ()
| "Fetch new mails at 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 4)))
| (set-window-configuration win)))))
`----
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, as far as I was able to
understand, gnus-group-get-new-news does not really have a return
value which I could exploit.
But obvioudly this function has a hook:
gnus-after-getting-new-news-hook
(I assume this is executed everytime after trying to get new
news, or only when there really came-in new news?)
So when there is a function which can check a group for new
news/mails, probably I should be able to write this hook myself.
Probably something like this:
(if (gnus-check-if-unread-messages-in-group)
(call-process "whatever"))
; or pop up (x)emacs own pop-up messagewindow/sound
Does anybody know the name of this ((fantasy-name):
`gnus-check-if-unread-messages-in-group') function if it exists?
Many Thanks
--
calmar (o_
//\ <--- GNU/Linux is GREAT
V_/_ www.calmar.ws
^ permalink raw reply [flat|nested] 2+ messages in thread
* notify after automatic mail recieving
@ 2003-06-25 22:31 calmar
0 siblings, 0 replies; 2+ messages in thread
From: calmar @ 2003-06-25 22:31 UTC (permalink / 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-06-25 22:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-25 8:47 notify after automatic mail recieving calmar
2003-06-25 22:31 calmar
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).