summary refs log tree commit diff stats
path: root/lisp/acdw-mail.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/acdw-mail.el')
-rw-r--r--lisp/acdw-mail.el12
1 files changed, 7 insertions, 5 deletions
diff --git a/lisp/acdw-mail.el b/lisp/acdw-mail.el index d0ee28e..9545808 100644 --- a/lisp/acdw-mail.el +++ b/lisp/acdw-mail.el
@@ -3,6 +3,7 @@
3;;; Code: 3;;; Code:
4 4
5(require 'cl-lib) 5(require 'cl-lib)
6(require 'message)
6 7
7;;; Variables 8;;; Variables
8 9
@@ -56,6 +57,7 @@ Useful in `message-send-hook'."
56 "Concatenate `notmuch' QUERIES with AND." 57 "Concatenate `notmuch' QUERIES with AND."
57 (mapconcat #'identity queries " AND ")) 58 (mapconcat #'identity queries " AND "))
58 59
60;;;###autoload
59(defun +notmuch-goto (&optional prefix) 61(defun +notmuch-goto (&optional prefix)
60 "Perform a saved `notmuch' search. 62 "Perform a saved `notmuch' search.
61Without a PREFIX argument, perform the first search in 63Without a PREFIX argument, perform the first search in
@@ -91,7 +93,7 @@ reversing the tag changes."
91 (when (eq start end) 93 (when (eq start end)
92 (notmuch-search-next-thread))) 94 (notmuch-search-next-thread)))
93 95
94(defun +notmuch-tree-mark-spam (&optional ham) 96(defun +notmuch-tree-mark-spam (&optional ham _ _)
95 "Mark the current message as spam. 97 "Mark the current message as spam.
96That is, add the tags in `+notmuch-spam-tags' to the message. 98That is, add the tags in `+notmuch-spam-tags' to the message.
97With an optional HAM argument (interactively, 99With an optional HAM argument (interactively,
@@ -152,6 +154,7 @@ the saved search as well."
152 :preface (defdir notmuch/ (sync/ "emacs/notmuch/") 154 :preface (defdir notmuch/ (sync/ "emacs/notmuch/")
153 "Notmuch configuration directory." 155 "Notmuch configuration directory."
154 :makedir) 156 :makedir)
157 :bind (("C-c m" . notmuch-mua-new-mail))
155 :config 158 :config
156 ;; Options 159 ;; Options
157 (setopt notmuch-init-file (notmuch/ "notmuch-init.el" t) 160 (setopt notmuch-init-file (notmuch/ "notmuch-init.el" t)
@@ -172,8 +175,6 @@ the saved search as well."
172 message-envelope-from 'header 175 message-envelope-from 'header
173 notmuch-saved-searches nil) 176 notmuch-saved-searches nil)
174 ;; Key bindings 177 ;; Key bindings
175 (keymap-global-set "C-c m" #'nomtuch-mua-new-mail)
176 (keymap-global-set "C-c n" #'+notmuch-goto)
177 (keymap-set notmuch-search-mode-map "!" #'+notmuch-search-mark-spam) 178 (keymap-set notmuch-search-mode-map "!" #'+notmuch-search-mark-spam)
178 (keymap-set notmuch-search-mode-map "RET" #'notmuch-search-show-thread) 179 (keymap-set notmuch-search-mode-map "RET" #'notmuch-search-show-thread)
179 (keymap-set notmuch-search-mode-map "M-RET" #'notmuch-tree-from-search-thread) 180 (keymap-set notmuch-search-mode-map "M-RET" #'notmuch-tree-from-search-thread)
@@ -197,7 +198,7 @@ the saved search as well."
197 "tag:draft") 198 "tag:draft")
198 (+notmuch-define-saved-search "all mail" "a" 'tree "*") 199 (+notmuch-define-saved-search "all mail" "a" 'tree "*")
199 ;; Hooks and advice 200 ;; Hooks and advice
200 (add-hook 'message-send-hook #'+message-send-dispatch-rules) 201 (add-hook 'message-send-hook #'+message-send-set-variables)
201 (add-hook 'message-setup-hook #'+message-signature-setup) 202 (add-hook 'message-setup-hook #'+message-signature-setup)
202 (autoload 'visual-fill-column-mode "visual-fill-column" nil t) 203 (autoload 'visual-fill-column-mode "visual-fill-column" nil t)
203 (add-hook 'notmuch-message-mode-hook #'visual-fill-column-mode) 204 (add-hook 'notmuch-message-mode-hook #'visual-fill-column-mode)
@@ -214,13 +215,14 @@ This version doesn't add any initial-input."
214 "Make `notmuch-mua-new-reply' list-aware." 215 "Make `notmuch-mua-new-reply' list-aware."
215 (let ((ml (notmuch-show-get-header :List-Post))) 216 (let ((ml (notmuch-show-get-header :List-Post)))
216 (apply orig r) 217 (apply orig r)
218 (require 'message)
217 (when ml 219 (when ml
218 (with-buffer-modified-unmodified 220 (with-buffer-modified-unmodified
219 (message-remove-header "To") 221 (message-remove-header "To")
220 (message-add-header 222 (message-add-header
221 (format "To: %s" (replace-regexp-in-string "<mailto:\\(.*\\)>" "\\1" 223 (format "To: %s" (replace-regexp-in-string "<mailto:\\(.*\\)>" "\\1"
222 ml))) 224 ml)))
223 (messgage-goto-body))))) 225 (message-goto-body)))))
224 226
225 (define-advice notmuch-tag (:filter-args (args) trim) 227 (define-advice notmuch-tag (:filter-args (args) trim)
226 "Trim whitespace from ends of tags." 228 "Trim whitespace from ends of tags."