forked from purcell/emacs.d
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinit-email.el
74 lines (65 loc) · 2.3 KB
/
init-email.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
;; notmuch
(require 'notmuch)
(require 'org-notmuch)
(setq notmuch-fcc-dirs nil
notmuch-mua-user-agent-function 'notmuch-mua-user-agent-emacs
notmuch-search-oldest-first nil
notmuch-show-logo nil
notmuch-crypto-process-mime t)
(setq notmuch-saved-searches
'(("inbox" . "tag:inbox")
("i/inbox" . "tag:i/inbox")
("i/commits" . "tag:unread and tag:i/commits and not \"via pb\"")
("ml/emacs*" . "tag:unread and (tag:ml/emacs-help or tag:ml/emacs-devel)")
("ml/org" . "tag:unread and (tag:ml/org)")
("ml/cedet" . "tag:unread and (tag:ml/cedet-devel)")
("ml/notmuch" . "tag:unread and (tag:ml/notmuch)")
))
(require 'message)
(setq user-full-name "Felix Geller")
(setq user-mail-address "fgeller@gmail.com")
(setq
message-kill-buffer-on-exit t
message-send-mail-partially-limit nil
send-mail-function 'sendmail-send-it
mail-from-style 'angles
;; http://notmuchmail.org/emacstips/#index12h2
mail-specify-envelope-from t
message-sendmail-envelope-from 'header
mail-envelope-from 'header
gnus-inhibit-images t
message-signature "Felix Geller"
notmuch-search-line-faces nil
)
(defun fg/insert-message-sign-pgpmime ()
(interactive)
(save-excursion
(beginning-of-buffer)
(re-search-forward "--text follows this line--" (point-max) t)
(end-of-line)
(newline)
(insert "<#secure method=pgpmime mode=sign>")
(newline)))
(add-hook 'message-setup-hook 'fg/insert-message-sign-pgpmime)
(add-hook 'message-mode-hook 'turn-on-auto-fill)
(defun fg/goto-message-body ()
(interactive)
(message-goto-body)
(if (re-search-forward "sign>" (point-max) t)
(newline)))
(defun fg/notmuch-archive-all-and-quit ()
(interactive)
(notmuch-search-tag-all '(("-unread" "-inbox" "-i/inbox")))
(notmuch-search-quit))
(defun fg/notmuch-archive ()
(interactive)
(notmuch-search-tag '("-unread" "-inbox" "-i/inbox"))
(notmuch-search-refresh-view))
;; use open for PDFs (rather than gv) and images (rather than display)
(setcdr (assoc 'viewer (cdr (assoc "pdf" (assoc "application" mailcap-mime-data))))
"open %s")
(setcdr (assoc 'viewer (cdr (assoc ".*" (assoc "image" mailcap-mime-data))))
"open %s")
(setcdr (assoc 'test (cdr (assoc ".*" (assoc "image" mailcap-mime-data))))
'window-system)
(provide 'init-email)