-
Notifications
You must be signed in to change notification settings - Fork 0
/
notmuch-config.el
224 lines (183 loc) · 8.45 KB
/
notmuch-config.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
;; -*- coding: utf-8 -*-
(define-key notmuch-search-mode-map "g"
'notmuch-poll-and-refresh-this-buffer)
(define-key notmuch-hello-mode-map "g"
'notmuch-poll-and-refresh-this-buffer)
(define-key notmuch-search-mode-map "d"
(lambda ()
"toggle deleted tag for thread"
(interactive)
(if (member "deleted" (notmuch-search-get-tags))
(notmuch-search-tag '("-deleted"))
(notmuch-search-tag '("+deleted" "-inbox" "-unread")))))
(define-key notmuch-search-mode-map "!"
(lambda ()
"toggle unread tag for thread"
(interactive)
(if (member "unread" (notmuch-search-get-tags))
(notmuch-search-tag '("-unread"))
(notmuch-search-tag '("+unread")))))
(define-key notmuch-show-mode-map "d"
(lambda ()
"toggle deleted tag for message"
(interactive)
(if (member "deleted" (notmuch-show-get-tags))
(notmuch-show-tag '("-deleted"))
(notmuch-show-tag '("+deleted" "-inbox" "-unread")))))
(define-key notmuch-search-mode-map "a"
(lambda ()
"toggle archive"
(interactive)
(if (member "archive" (notmuch-search-get-tags))
(notmuch-search-tag '("-archive"))
(notmuch-search-tag '("+archive" "-inbox" "-unread")))))
(define-key notmuch-show-mode-map "a"
(lambda ()
"toggle archive"
(interactive)
(if (member "archive" (notmuch-show-get-tags))
(notmuch-show-tag '("-archive"))
(notmuch-show-tag '("+archive" "-inbox" "-unread")))))
(define-key notmuch-hello-mode-map "i"
(lambda ()
(interactive)
(notmuch-hello-search "tag:inbox")))
(define-key notmuch-hello-mode-map "u"
(lambda ()
(interactive)
(notmuch-hello-search "tag:unread")))
(define-key notmuch-hello-mode-map "a"
(lambda ()
(interactive)
(notmuch-hello-search "tag:archive")))
(setq notmuch-search-oldest-first nil
message-sendmail-envelope-from 'header
mail-specify-envelope-from 'header
mail-envelope-from 'header
notmuch-show-all-multipart/alternative-parts nil
mime-edit-split-message nil
mime-edit-pgp-signers '("C84EF897")
mime-edit-pgp-encrypt-to-self t
mml2015-encrypt-to-self t
mml2015-sign-with-sender t
notmuch-crypto-process-mime t
message-send-mail-function 'message-send-mail-with-sendmail
sendmail-program "~/dev/mail/msmtp-enqueue.sh"
message-sendmail-f-is-evil nil
mail-interactive t
user-full-name "Christian Kruse"
user-mail-address "[email protected]"
message-kill-buffer-on-exit t
mail-user-agent 'message-user-agent
notmuch-always-prompt-for-sender t
notmuch-fcc-dirs '(("[email protected]" . "Defunct/Sent")
("[email protected]" . "Defunct/Sent")
("[email protected]" . "Defunct/Sent")
("[email protected]" . "Defunct/Sent")
("[email protected]" . "Termitel/Sent")
("[email protected]" . "Termitel/Sent")
("[email protected]" . "Termitel/Sent")
("[email protected]" . "Termitel/Sent")
(".*" . "Defunct/Sent"))
notmuch-show-indent-messages-width 4
notmuch-saved-searches '((:name "inbox" :query "tag:inbox" :key "i")
(:name "CForum" :query "folder:Defunct/Lists.cforum")
(:name "Warpzone" :query "tag:list and tag:warpzone and not tag:intern")
(:name "Warpzone Unread" :query "tag:list and tag:warpzone and not tag:intern and tag:unread")
(:name "Warpzone intern" :query "tag:list and tag:warpzone and tag:intern")
(:name "Warpzone intern Unread" :query "tag:list and tag:warpzone and tag:intern and tag:unread")
(:name "PostgreSQL" :query "tag:pg and tag:list")
(:name "PostgreSQL Unread" :query "tag:pg and tag:list and tag:unread")
(:name "Phoenix" :query "tag:phoenix and tag:list")
(:name "Phoenix Unread" :query "tag:phoenix and tag:list and tag:unread")
(:name "Emacs:Devel" :query "tag:emacs and tag:devel and tag:list")
(:name "Emacs:Devel Unread" :query "tag:emacs and tag:devel and tag:list and tag:unread")
(:name "Emacs:Help" :query "tag:emacs and tag:help and tag:list")
(:name "Emacs:Help Unread" :query "tag:emacs and tag:help and tag:list and tag:unread")
(:name "Emacs:Org Unread" :query "tag:emacs and tag:org and tag:list and tag:unread")
(:name "unread" :query "tag:unread" :key "u")
(:name "flagged" :query "tag:flagged" :key "f")
(:name "sent" :query "tag:sent" :key "t")
(:name "drafts" :query "tag:draft" :key "d")
(:name "all mail" :query "*" :key "a")))
(define-key notmuch-show-mode-map "\C-c\C-o" 'browse-url-at-point)
(require 'gnus-alias)
(setq gnus-alias-debug-buffer-name 1)
;(add-hook 'message-setup-hook 'gnus-alias-determine-identity)
;(setq gnus-alias-unknown-identity-rule 'gnus-alias-select-identity)
(defun ck/choose-identity ()
(interactive)
(let ((ident (gnus-alias-determine-identity t)))
(if (not (equal ident ""))
(gnus-alias-use-identity ident)
(gnus-alias-select-identity))
(goto-char (point-max))
(search-backward "--text follows this line--")
(end-of-line)
(insert "\n")
(search-forward "-- \n")
(goto-char (- (point) 4))
(insert "Liebe Grüsse,\n")
(mml-secure-message-sign-pgpmime)))
(add-hook 'message-setup-hook 'ck/choose-identity)
;(add-hook 'message-setup-hook 'mml-secure-sign-pgpmime)
(setq gnus-alias-identity-alist
'(("Defunct"
nil ;; Does not refer to any other identity
"Christian Kruse <[email protected]>" ;; Sender address
nil ;; No organization header
(("Fcc" . " ~/Mail/Defunct/Sent"))
nil ;; No extra body text
"~/dev/mail/signature-defunct")
("Termitel"
nil
"Christian Kruse <[email protected]>"
"Termitel GmbH"
(("Fcc" . " ~/Mail/Termitel/Sent"))
nil
"~/dev/mail/signature-termitel")))
;;(setq gnus-alias-default-identity "Defunct")
;; Define rules to match work identity
(setq gnus-alias-identity-rules
'(("Defunct" ("any" "\\(cjk\\|c.kruse\\|ckruse\\)@\\(defunct\\.ch\\|wwwtech\\.de\\)" both) "Defunct")
("Termitel" ("any" "c.kruse@\\(termitel\\.de\\|mwbenson\\.de\\|mwbenson\\.ch\\|sourceflow\\.ch\\)" both) "Termitel")))
(require 'org-notmuch)
;; decryption
(defun jho/notmuch-show-decrypt-message ()
(interactive)
;; make sure the content is not indented, as this confuses epa
(when notmuch-show-indent-content
(notmuch-show-toggle-thread-indentation))
(cl-letf ((extent (notmuch-show-message-extent))
((symbol-function 'y-or-n-p) #'(lambda (msg) t)))
(epa-decrypt-armor-in-region (car extent) (cdr extent))))
(define-key notmuch-show-mode-map (kbd "C-c C-e d") 'jho/notmuch-show-decrypt-message)
;;; bbdb
(use-package bbdb
:config (progn
(bbdb-initialize)
(add-hook 'gnus-startup-hook 'bbdb-insinuate-gnus)
(add-hook 'gnus-startup-hook 'bbdb-insinuate-message)
;(add-hook 'message-setup-hook 'bbdb-define-all-aliases)
(setq bbdb-user-mail-address-re "cjk\\|c.kruse@\\(defunct\\|wwwtech\\|termitel\\|mwbenson\\|sourceflow\\)\\.\\(ch\\|de\\|com\\)"
bbdb-file "~/.emacs.d/.bbdb"
bbdb-auto-revert t
bbdb-check-auto-save-file t
bbdb-expand-mail-aliases t
bbdb-phone-style nil
bbdb-pop-up-window-size 10
bbdb/news-auto-create-p t
bbdb-complete-name-allow-cycling t
bbdb-complete-mail-allow-cycling t
bbdb-complete-name-full-completion t
bbdb-completion-type 'primary-or-name
bbdb-use-pop-up nil
bbdb-offer-save 1
bbdb-electric-p t)
(if (equal system-type 'darwin)
(progn
(setq osxb-import-with-timer t)
(require 'osx-bbdb))
(progn
(use-package bbdb-vcard)))))
;; eof