* Run a function when new mail arrives
@ 2007-01-18 16:02 Tassilo Horn
2007-01-18 17:25 ` Reiner Steib
0 siblings, 1 reply; 5+ messages in thread
From: Tassilo Horn @ 2007-01-18 16:02 UTC (permalink / raw)
Hello,
I use Gnus with an IMAP account and let gnus demon check for new mail
every 5 minutes of emacs idle time.
Now I'd like to run a function whenever new mail arrives.
Is (or better how) is that possible?
Regards,
Tassilo
--
A morning without coffee is like something without something else.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Run a function when new mail arrives
2007-01-18 16:02 Run a function when new mail arrives Tassilo Horn
@ 2007-01-18 17:25 ` Reiner Steib
2007-01-18 18:11 ` Ted Zlatanov
0 siblings, 1 reply; 5+ messages in thread
From: Reiner Steib @ 2007-01-18 17:25 UTC (permalink / raw)
On Thu, Jan 18 2007, Tassilo Horn wrote:
> I use Gnus with an IMAP account and let gnus demon check for new mail
> every 5 minutes of emacs idle time.
>
> Now I'd like to run a function whenever new mail arrives.
>
> Is (or better how) is that possible?
There's `nnmail-prepare-save-mail-hook', but probably this is only run
for `mail-sources'. I don't know if there's something similar for
IMAP.
Bye, Reiner.
--
,,,
(o o)
---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Run a function when new mail arrives
2007-01-18 17:25 ` Reiner Steib
@ 2007-01-18 18:11 ` Ted Zlatanov
2007-01-18 19:54 ` Tassilo Horn
[not found] ` <mailman.3267.1169150099.2155.info-gnus-english@gnu.org>
0 siblings, 2 replies; 5+ messages in thread
From: Ted Zlatanov @ 2007-01-18 18:11 UTC (permalink / raw)
On 18 Jan 2007, reinersteib+gmane@imap.cc wrote:
On Thu, Jan 18 2007, Tassilo Horn wrote:
>> I use Gnus with an IMAP account and let gnus demon check for new mail
>> every 5 minutes of emacs idle time.
>>
>> Now I'd like to run a function whenever new mail arrives.
>>
>> Is (or better how) is that possible?
>
> There's `nnmail-prepare-save-mail-hook', but probably this is only run
> for `mail-sources'. I don't know if there's something similar for
> IMAP.
You could run something in the nn*-split-fancy list, and always return nil
(so it will not actually affect the splitting).
Ted
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Run a function when new mail arrives
2007-01-18 18:11 ` Ted Zlatanov
@ 2007-01-18 19:54 ` Tassilo Horn
[not found] ` <mailman.3267.1169150099.2155.info-gnus-english@gnu.org>
1 sibling, 0 replies; 5+ messages in thread
From: Tassilo Horn @ 2007-01-18 19:54 UTC (permalink / raw)
Ted Zlatanov <tzz@lifelogs.com> writes:
Hi Ted,
>>> I use Gnus with an IMAP account and let gnus demon check for new
>>> mail every 5 minutes of emacs idle time.
>>>
>>> Now I'd like to run a function whenever new mail arrives.
>
> You could run something in the nn*-split-fancy list, and always return
> nil (so it will not actually affect the splitting).
I tried this:
,----[ ~/.gnus.el ]
| (defun th-new-imap-mail ()
| (shell-command (concat "append-to-dwm-statusbar.fish "
| "Gnus: New mail!"))
| nil)
|
| (setq nnimap-split-rule 'nnimap-split-fancy
| nnimap-split-fancy '(: th-new-imap-mail))
`----
But the function `th-new-imap-mail' is never run.
Any ideas?
Bye,
Tassilo
--
The glass is neither half-full nor half-empty: it's twice as big as it
needs to be.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Run a function when new mail arrives
[not found] ` <mailman.3267.1169150099.2155.info-gnus-english@gnu.org>
@ 2007-01-18 21:51 ` Ted Zlatanov
0 siblings, 0 replies; 5+ messages in thread
From: Ted Zlatanov @ 2007-01-18 21:51 UTC (permalink / raw)
On 18 Jan 2007, tassilo@member.fsf.org wrote:
> Ted Zlatanov <tzz@lifelogs.com> writes:
>
> Hi Ted,
>
>>>> I use Gnus with an IMAP account and let gnus demon check for new
>>>> mail every 5 minutes of emacs idle time.
>>>>
>>>> Now I'd like to run a function whenever new mail arrives.
>>
>> You could run something in the nn*-split-fancy list, and always return
>> nil (so it will not actually affect the splitting).
>
> I tried this:
>
> ,----[ ~/.gnus.el ]
> | (defun th-new-imap-mail ()
> | (shell-command (concat "append-to-dwm-statusbar.fish "
> | "Gnus: New mail!"))
> | nil)
> |
> | (setq nnimap-split-rule 'nnimap-split-fancy
> | nnimap-split-fancy '(: th-new-imap-mail))
> `----
>
> But the function `th-new-imap-mail' is never run.
>
> Any ideas?
Get split-fancy running without the function (just send the mail to
INBOX.mail or whatever you like). Then you can add functions--the
problem is likely to be that the split-fancy stuff is not running
correctly.
My setup is appended in case it helps... I use nnimap-split-rule
because I have 4 servers in there.
Ted
(defun nnimap-courier-lifelogs-split-fancy ()
(let ((nnimap-split-fancy nnimap-courier-lifelogs-split-fancy)
(spam-split-group "INBOX.spam"))
(nnimap-split-fancy)))
(setq
;;; my server name matches "lifelogs"
nnimap-split-rule '(
("lifelogs" ("INBOX" nnimap-courier-lifelogs-split-fancy)))
nnimap-split-inbox "INBOX"
nnimap-courier-lifelogs-split-fancy '(|
(: gnus-registry-split-fancy-with-parent)
(: spam-split 'spam-use-regex-headers)
;;; more rules...
(any "ding" "INBOX.ding")
;;; more rules...
(: spam-split)
;; default mailbox
"INBOX.mail"))
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-01-18 21:51 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-18 16:02 Run a function when new mail arrives Tassilo Horn
2007-01-18 17:25 ` Reiner Steib
2007-01-18 18:11 ` Ted Zlatanov
2007-01-18 19:54 ` Tassilo Horn
[not found] ` <mailman.3267.1169150099.2155.info-gnus-english@gnu.org>
2007-01-18 21:51 ` Ted Zlatanov
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).