[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Setting wl-draft-folder depending on wl-draft-parent-folder
- To: wl-en@ml.gentei.org
- Subject: Setting wl-draft-folder depending on wl-draft-parent-folder
- From: Nick Lanham <nick@afternight.org>
- Date: Fri, 25 Apr 2014 09:41:50 -0700
- Reply-to: wl-en@ml.gentei.org
- User-agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (Gojō) APEL/10.8 Emacs/24.3 (x86_64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO)
I'm trying to get my draft folder to be correct when switching between two different accounts. I've got a simple function to set wl-draft-folder as:
(defun my-wl-set-draft-folder ()
"Set the right folder for the draft"
(if (not (eq nil (string-match "work.domain" wl-draft-parent-folder)))
(setq wl-draft-folder "%Drafts:user/plain@work.domain")
(setq wl-draft-folder "%[Gmail]/Drafts") ))
and then I do:
(add-hook 'wl-mail-setup-hook 'my-wl-set-draft-folder)
However, it seems the wl-draft-folder variable is actually used before this hook is run, so if I switch mailboxes, the first time I compose a draft it will use the wrong folder. After that things will work until I switch back to the other account.
Is there a hook that runs early enough to fix this problem, or some other workaround for having the correct draft folder with multiple accounts?
Thanks!
-Nick