2019-03-17 09:27:18 +01:00
|
|
|
;; Notmuch
|
|
|
|
|
2019-03-17 20:18:01 +01:00
|
|
|
(require 'init-message)
|
|
|
|
(require 'patch-notmuch)
|
|
|
|
|
|
|
|
;; To find files matching email:
|
|
|
|
;; notmuch search --output=files FOO
|
2019-03-18 10:22:29 +01:00
|
|
|
;; The following is good enough for multiple-account support if they use the
|
|
|
|
;; same SMTP server.
|
2019-03-17 20:18:01 +01:00
|
|
|
(setq notmuch-fcc-dirs
|
2019-03-18 10:22:29 +01:00
|
|
|
'(("mail@ambrevar.xyz" . "mail/Sent +sent -inbox -unread")
|
|
|
|
("pierre@atlas.engineer" . "atlas/Sent +sent -inbox -unread")))
|
2019-03-17 20:18:01 +01:00
|
|
|
|
|
|
|
(defun notmuch-change-sender ()
|
|
|
|
(interactive)
|
|
|
|
(unless (derived-mode-p 'message-mode)
|
|
|
|
(error "Must be in message mode"))
|
|
|
|
(let ((sender (completing-read "Sender: " (mapcar 'car notmuch-fcc-dirs))))
|
|
|
|
(message-replace-header "From" sender)
|
|
|
|
(message-remove-header "Fcc")
|
|
|
|
(notmuch-fcc-header-setup)))
|
|
|
|
|
2019-03-17 09:27:18 +01:00
|
|
|
(when (require 'patch-helm nil 'noerror)
|
|
|
|
(helm-defswitcher
|
|
|
|
"notmuch"
|
|
|
|
(lambda (b)
|
|
|
|
(with-current-buffer b
|
|
|
|
(or
|
|
|
|
(derived-mode-p 'notmuch-hello-mode)
|
|
|
|
(derived-mode-p 'notmuch-search-mode)
|
|
|
|
(derived-mode-p 'notmuch-show-mode)
|
|
|
|
(derived-mode-p 'notmuch-message-mode))))
|
|
|
|
notmuch-hello))
|
|
|
|
|
|
|
|
(when (require 'helm-notmuch nil t)
|
2019-03-17 20:18:01 +01:00
|
|
|
(setq helm-notmuch-match-incomplete-words t)
|
|
|
|
(require 'patch-helm-notmuch)
|
|
|
|
(dolist (map (list notmuch-search-mode-map
|
|
|
|
notmuch-hello-mode-map
|
|
|
|
notmuch-show-mode-map
|
|
|
|
notmuch-tree-mode-map))
|
2019-03-17 09:27:18 +01:00
|
|
|
(define-key map "s" 'helm-notmuch)))
|
|
|
|
|
2019-03-17 20:18:01 +01:00
|
|
|
(require 'org-notmuch nil 'noerror)
|
|
|
|
|
|
|
|
(defun notmuch-show-bounce (&optional address)
|
|
|
|
"Bounce the current message."
|
|
|
|
(interactive "sBounce To: ")
|
|
|
|
(notmuch-show-view-raw-message)
|
|
|
|
(message-resend address))
|
|
|
|
|
|
|
|
(define-key notmuch-show-mode-map "b" #'notmuch-show-bounce)
|
|
|
|
|
2019-03-17 09:27:18 +01:00
|
|
|
(provide 'init-notmuch)
|