;;; $Id: .emacs-mail.el,v 1.2 2007/12/22 15:55:26 minh Exp minh $ ;;; Copyright (c) 2006, 2007 Nhat Minh LĂȘ. All rights reserved. ;;; ;;; Redistribution and use in source and binary forms, with or without ;;; modification, are permitted provided that the following conditions ;;; are met: ;;; ;;; 1. Redistributions of source code must retain the above copyright ;;; notice, this list of conditions and the following disclaimer. ;;; ;;; 2. Redistributions in binary form must reproduce the above ;;; copyright notice, this list of conditions and the following ;;; disclaimer in the documentation and/or other materials provided ;;; with the distribution. ;;; ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ;;; ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ;;; Minh's .emacs mail configuration (defvar minh-mail-mode-string "" "Variable modified to hold current mail status in the mode line.") (defun minh-mail-notify () "Change mode line on new mail." (setq minh-mail-mode-string "Mail-")) (defun minh-mail-unnotify () "Change mode line on new mail." (setq minh-mail-mode-string "")) (defun minh-setup-mail-mew () "Set up mail configuration for use with Mew." (autoload 'mew "mew" nil t) (autoload 'mew-send "mew" nil t) (if (boundp 'read-mail-command) (setq read-mail-command 'mew)) (autoload 'mew-user-agent-compose "mew" nil t) (if (boundp 'mail-user-agent) (setq mail-user-agent 'mew-user-agent)) (if (fboundp 'define-mail-user-agent) (define-mail-user-agent 'mew-user-agent 'mew-user-agent-compose 'mew-draft-send-message 'mew-draft-kill 'mew-send-hook))) (defun minh-setup-mail-wl () "Set up mail configuration for use with Wanderlust." (autoload 'wl-user-agent-compose "wl-draft" nil t) (if (boundp 'mail-user-agent) (setq mail-user-agent 'wl-user-agent)) (if (fboundp 'define-mail-user-agent) (define-mail-user-agent 'wl-user-agent 'wl-user-agent-compose 'wl-draft-send 'wl-draft-kill 'mail-send-hook)) (setq wl-draft-folder "%draft") (setq wl-trash-folder "%trash") (setq wl-draft-config-alist '((t ("Bcc" . "minh")))) ;; (setq wl-biff-check-folder-list '("%INBOX")) ;; (setq wl-biff-check-interval 300) ;; (add-hook 'wl-biff-notify-hook 'minh-mail-notify) ;; (add-hook 'wl-biff-unnotify-hook 'minh-mail-unnotify) (setq wl-auto-save-drafts-interval nil) (setq mime-edit-split-message nil) (setq wl-draft-reply-without-argument-list '(("Followup-To" ("Mail-Followup-To" "Mail-Reply-To" "Reply-To") nil ("Followup-To")) ("Mail-Followup-To" ("Mail-Followup-To") nil nil) ("Newsgroups" ("Mail-Reply-To" "Reply-To" "To") ("Cc") ("Newsgroups")) ("Mail-Reply-To" ("Mail-Reply-To" "Reply-To") ("Cc") nil) ("Reply-To" ("Reply-To") ("Cc") nil) (wl-draft-self-reply-p ("To") ("Cc") nil) ("From" ("From") ("Cc") nil))) (setq wl-folder-desktop-name "Mail") (setq wl-stay-folder-window t) (setq wl-folder-window-width 38) (setq wl-summary-width 114) ;; prevent VC from scanning "files" in WL folders ;; (setq vc-ignore-dir-regexp (concat vc-ignore-dir-regexp "\\|^%")) (add-hook 'wl-draft-mode-hook (function (lambda () (define-key wl-draft-mode-map [?\C-x ?\C-s] 'wl-draft-save) (define-key wl-draft-mode-map [?\M-t] 'transpose-words)))) ;; (setq wl-highlight-folder-with-icon nil) (setq wl-demo-display-logo t)) (minh-setup-mail-wl) (setq display-time-mail-directory "~/mail/new")