[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Several notification problems
Hi,
First time writer here!
I've been using Wanderlust for a little while and generally Im very happy with it.
A major hurdle for me has been the notification bit - I cannot seem to get it to work.
In order to be notified of new emails I use the following:
---------8<--------------------------------------8<--------
(setq wl-show-plug-status-on-modeline t)
;; Set mail-icon to be shown universally in the modeline.
(setq global-mode-string
(cons
'(wl-modeline-biff-status
wl-modeline-biff-state-on
wl-modeline-biff-state-off)
global-mode-string))
(defun my-wl-folder-name-list ()
"Return a list of all folder names."
(let (folder-list
(id 1)
(entity (wl-folder-get-folder-name-by-id 1)))
(setq folder-list (list entity))
(setq entity (wl-folder-get-next-folder id))
(while entity
(setq id (wl-folder-get-entity-id entity))
(setq folder-list (cons entity folder-list))
(setq entity (wl-folder-get-next-folder id)))
folder-list))
(defun my-mail-notify ()
(message "New mail"))
(defun my-wl-biff ()
"Set up biff on all WL folders."
(setq wl-biff-check-folder-list (my-wl-folder-name-list)
wl-biff-check-interval 60)
(add-hook 'wl-biff-notify-hook 'my-mail-notify)
(setq wl-biff-use-idle-timer t)
(wl-biff-start))
(defun my-elmo-folder-exists-p (folder) t)
(defadvice wl-biff-check-folders (around my-disable-exists-test activate)
"Disable `elmo-folder-exists-p' and make it return t."
(let ((real-elmo-folder-exists-p
(symbol-function 'elmo-folder-exists-p)))
(fset 'elmo-folder-exists-p (symbol-function 'my-elmo-folder-exists-p))
ad-do-it
(fset 'elmo-folder-exists-p real-elmo-folder-exists-p)))
(load-file "~/.emacs.d/wl-init.el")
(setq display-time-mail-function
'(lambda () wl-modeline-biff-status))
(defun mail ()
(interactive)
(wl)
(my-wl-biff))
(setq elmo-imap4-default-server "mail.bestinclass.dk"
elmo-imap4-default-user "lau"
elmo-imap4-default-authenticate-type 'clear
elmo-imap4-default-port '993
elmo-imap4-default-stream-type 'ssl
elmo-imap4-use-modified-utf7 nil)
---------8<--------------------------------------8<--------
To start Wanderlust I call M-x mail, which then sets up the polling for each
folder. Usually (although a bit undeterministic), this will work the first time
I get a new email - The email icon will light up in yellow on the global modeline
and once I go read that email, it will go back to normal upon the next update.
But there are several problems:
1) This doesnt always happen
2) This never works the 2.nd time I get a new email - then I wont be notified
3) If I delete an email, it will (regardless of its state) show up as unread
in my trash folder. I worked around this by not tracking my .trash folder,
but then I noticed that I have the same problem for sent mail.
Long story short: The new mail notification is totally unreliable. You can see
my entire config here: https://gist.github.com/9e863cb64eb91bbb696a
Any and all help is greatly appreciated, as I have scavaged all available online
resources, and looted as much config-code as humanly possible.
Lau