Switch from let to defvar in Mail section.

This commit is contained in:
larstvei 2014-01-04 06:21:16 +01:00
parent 0df4413d48
commit 28da2d329f
2 changed files with 85 additions and 83 deletions

79
init.el
View File

@ -181,50 +181,51 @@ PACKAGE is installed and the current version is deleted."
calendar-longitude 10.7 calendar-longitude 10.7
calendar-location-name "Oslo, Norway") calendar-location-name "Oslo, Norway")
(let ((load-mail-setup nil)) (defvar load-mail-setup nil)
(when load-mail-setup
;; Dependent on both mu4e and smtpmail (for sending only).
(require 'mu4e)
(require 'smtpmail)
;; Some basic mu4e settings. (when load-mail-setup
(setq mu4e-maildir "~/.ifimail" ; top-level Maildir ;; Dependent on both mu4e and smtpmail (for sending only).
mu4e-sent-folder "/INBOX.Sent" ; folder for sent messages (require 'mu4e)
mu4e-drafts-folder "/INBOX.Drafts" ; unfinished messages (require 'smtpmail)
mu4e-trash-folder "/INBOX.Trash" ; trashed messages
mu4e-refile-folder "/INBOX.Archive" ; saved messages
mu4e-get-mail-command "offlineimap" ; use offlineimap to fetch mail
mu4e-view-show-images t ; view images
mu4e-html2text-command
"html2text -utf8" ; use utf-8
mu4e-compose-signature "- Lars" ; Sign my name
)
;; Setup for sending mail. ;; Some basic mu4e settings.
(setq user-full-name (setq mu4e-maildir "~/.ifimail" ; top-level Maildir
"Lars Tveito" ; Your full name mu4e-sent-folder "/INBOX.Sent" ; folder for sent messages
user-mail-address mu4e-drafts-folder "/INBOX.Drafts" ; unfinished messages
"larstvei@ifi.uio.no" ; And email-address mu4e-trash-folder "/INBOX.Trash" ; trashed messages
smtpmail-smtp-server mu4e-refile-folder "/INBOX.Archive" ; saved messages
"smtp.uio.no" ; Host to mail-server mu4e-get-mail-command "offlineimap" ; use offlineimap to fetch mail
smtpmail-smtp-service 465 ; Port to mail-server mu4e-view-show-images t ; view images
smtpmail-stream-type 'ssl ; Protocol used for sending mu4e-html2text-command
send-mail-function 'smtpmail-send-it ; Use smpt to send "html2text -utf8" ; use utf-8
mail-user-agent 'mu4e-user-agent ; Use mu4e! mu4e-compose-signature "- Lars" ; Sign my name
) )
;; Register file types that can be handled by ImageMagick. ;; Setup for sending mail.
(when (fboundp 'imagemagick-register-types) (setq user-full-name
(imagemagick-register-types)) "Lars Tveito" ; Your full name
user-mail-address
"larstvei@ifi.uio.no" ; And email-address
smtpmail-smtp-server
"smtp.uio.no" ; Host to mail-server
smtpmail-smtp-service 465 ; Port to mail-server
smtpmail-stream-type 'ssl ; Protocol used for sending
send-mail-function 'smtpmail-send-it ; Use smpt to send
mail-user-agent 'mu4e-user-agent ; Use mu4e!
)
;; A function to show mu4e and nothing else! ;; Register file types that can be handled by ImageMagick.
(defun show-mu4e () (when (fboundp 'imagemagick-register-types)
(interactive) (imagemagick-register-types))
(mu4e)
(delete-other-windows))
;; Overwrite the native 'compose-mail' binding to 'show-mu4e'. ;; A function to show mu4e and nothing else!
(global-set-key (kbd "C-x m") 'show-mu4e))) (defun show-mu4e ()
(interactive)
(mu4e)
(delete-other-windows))
;; Overwrite the native 'compose-mail' binding to 'show-mu4e'.
(global-set-key (kbd "C-x m") 'show-mu4e))
(add-hook 'text-mode-hook 'turn-on-flyspell) (add-hook 'text-mode-hook 'turn-on-flyspell)

View File

@ -370,50 +370,51 @@
a =non-nil= value mail is setup. a =non-nil= value mail is setup.
#+BEGIN_SRC emacs-lisp :tangle yes #+BEGIN_SRC emacs-lisp :tangle yes
(let ((load-mail-setup nil)) (defvar load-mail-setup nil)
(when load-mail-setup
;; Dependent on both mu4e and smtpmail (for sending only). (when load-mail-setup
(require 'mu4e) ;; Dependent on both mu4e and smtpmail (for sending only).
(require 'smtpmail) (require 'mu4e)
(require 'smtpmail)
;; Some basic mu4e settings.
(setq mu4e-maildir "~/.ifimail" ; top-level Maildir ;; Some basic mu4e settings.
mu4e-sent-folder "/INBOX.Sent" ; folder for sent messages (setq mu4e-maildir "~/.ifimail" ; top-level Maildir
mu4e-drafts-folder "/INBOX.Drafts" ; unfinished messages mu4e-sent-folder "/INBOX.Sent" ; folder for sent messages
mu4e-trash-folder "/INBOX.Trash" ; trashed messages mu4e-drafts-folder "/INBOX.Drafts" ; unfinished messages
mu4e-refile-folder "/INBOX.Archive" ; saved messages mu4e-trash-folder "/INBOX.Trash" ; trashed messages
mu4e-get-mail-command "offlineimap" ; use offlineimap to fetch mail mu4e-refile-folder "/INBOX.Archive" ; saved messages
mu4e-view-show-images t ; view images mu4e-get-mail-command "offlineimap" ; use offlineimap to fetch mail
mu4e-html2text-command mu4e-view-show-images t ; view images
"html2text -utf8" ; use utf-8 mu4e-html2text-command
mu4e-compose-signature "- Lars" ; Sign my name "html2text -utf8" ; use utf-8
) mu4e-compose-signature "- Lars" ; Sign my name
)
;; Setup for sending mail.
(setq user-full-name ;; Setup for sending mail.
"Lars Tveito" ; Your full name (setq user-full-name
user-mail-address "Lars Tveito" ; Your full name
"larstvei@ifi.uio.no" ; And email-address user-mail-address
smtpmail-smtp-server "larstvei@ifi.uio.no" ; And email-address
"smtp.uio.no" ; Host to mail-server smtpmail-smtp-server
smtpmail-smtp-service 465 ; Port to mail-server "smtp.uio.no" ; Host to mail-server
smtpmail-stream-type 'ssl ; Protocol used for sending smtpmail-smtp-service 465 ; Port to mail-server
send-mail-function 'smtpmail-send-it ; Use smpt to send smtpmail-stream-type 'ssl ; Protocol used for sending
mail-user-agent 'mu4e-user-agent ; Use mu4e! send-mail-function 'smtpmail-send-it ; Use smpt to send
) mail-user-agent 'mu4e-user-agent ; Use mu4e!
)
;; Register file types that can be handled by ImageMagick.
(when (fboundp 'imagemagick-register-types) ;; Register file types that can be handled by ImageMagick.
(imagemagick-register-types)) (when (fboundp 'imagemagick-register-types)
(imagemagick-register-types))
;; A function to show mu4e and nothing else!
(defun show-mu4e () ;; A function to show mu4e and nothing else!
(interactive) (defun show-mu4e ()
(mu4e) (interactive)
(delete-other-windows)) (mu4e)
(delete-other-windows))
;; Overwrite the native 'compose-mail' binding to 'show-mu4e'.
(global-set-key (kbd "C-x m") 'show-mu4e))) ;; Overwrite the native 'compose-mail' binding to 'show-mu4e'.
(global-set-key (kbd "C-x m") 'show-mu4e))
#+END_SRC #+END_SRC
** Flyspell ** Flyspell