[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Run a function when new mail arrives
From: |
Ted Zlatanov |
Subject: |
Re: Run a function when new mail arrives |
Date: |
Thu, 18 Jan 2007 16:51:31 -0500 |
User-agent: |
Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.92 (gnu/linux) |
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"))