summary refs log tree commit diff stats
path: root/emacs/.emacs.d/init.org
diff options
context:
space:
mode:
authorAlan Pearce2017-04-21 14:45:53 +0200
committerAlan Pearce2017-04-21 14:45:53 +0200
commitc7548f30622665198145067d32e44c2348ff7fbc (patch)
tree429e7e874c29a5f0c655fd3ed3cbaf62a705d89e /emacs/.emacs.d/init.org
parentbb3bc1ebb361f41febc7542b153ba1e92a88aa80 (diff)
downloadnixfiles-c7548f30622665198145067d32e44c2348ff7fbc.tar.lz
nixfiles-c7548f30622665198145067d32e44c2348ff7fbc.tar.zst
nixfiles-c7548f30622665198145067d32e44c2348ff7fbc.zip
Emacs: Move insensitive email configuration to init.org
Diffstat (limited to 'emacs/.emacs.d/init.org')
-rw-r--r--emacs/.emacs.d/init.org46
1 files changed, 46 insertions, 0 deletions
diff --git a/emacs/.emacs.d/init.org b/emacs/.emacs.d/init.org
index aa7add49..43a861df 100644
--- a/emacs/.emacs.d/init.org
+++ b/emacs/.emacs.d/init.org
@@ -1181,6 +1181,52 @@ rather useful.
             (setq eldoc-idle-delay 0.1)
             (eldoc-add-command 'paredit-backward-delete 'paredit-close-round)))
 #+END_SRC
+* Mail
+
+** Gnus
+
+At work, I use gnus for email.  Some of the setup is specific to my
+workplace, so I keep it in a host-specific, GPG-encrypted file.
+
+#+BEGIN_SRC emacs-lisp
+(use-package gnus
+  :config (progn
+            (setq gnus-gcc-mark-as-read t
+                  mml-secure-openpgp-encrypt-to-self t
+                  send-mail-function #'smtpmail-send-it
+                  message-send-mail-function #'smtpmail-send-it)))
+
+(with-eval-after-load 'gnus-mime
+  (define-key gnus-mime-button-map " " #'gnus-mime-view-part-externally))
+
+(with-eval-after-load "mailcap"
+  (when (eq system-type 'darwin)
+    (mailcap-add-mailcap-entry "application" "pdf" '((viewer . "/usr/bin/qlmanage -p %s") (type . "application/pdf")))))
+
+(with-eval-after-load "mm-decode"
+  (add-to-list 'mm-discouraged-alternatives "text/html")
+  (add-to-list 'mm-discouraged-alternatives "text/richtext"))
+#+END_SRC
+
+** BBDB
+
+As I'm using Emacs for email, it makes sense to have contact
+information here as well.
+
+#+BEGIN_SRC emacs-lisp
+(use-package bbdb
+  :config (progn
+            (bbdb-initialize 'gnus 'mail 'message 'pgp)
+            (bbdb-mua-auto-update-init 'gnus 'message)
+            (setq bbdb-send-mail-style 'gnus
+                  bbdb-complete-mail-allow-cycling t
+                  bbdb-mua-auto-update t
+                  bbdb-mua-update-interactive-p '(query . create)
+                  bbdb-message-all-addresses t
+                  bbdb-offer-save t
+                  bbdb-offer-to-create 1)))
+#+END_SRC
+
 * Misc
 
 #+BEGIN_SRC emacs-lisp