~pkal/autocrypt

ref: 39c06eb4020c38de8f282340449691210cc23bb8 autocrypt/autocrypt-rmail.el -rw-r--r-- 1.3 KiB
39c06eb4Philip K Rename autocrypt-load for Rmail 1 year, 1 month ago
                                                                                
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
;;; autocrypt-rmail.el --- Autocrypt for Rmail -*- lexical-binding:t -*-

;; Author: Philip K. <philip@warpmail.net>
;; Version: 0.4.0
;; Keywords: comm
;; Package-Requires: ((emacs "25.1"))
;; URL: https://git.sr.ht/~zge/autocrypt

;; This file is NOT part of Emacs.
;;
;; This file is in the public domain, to the extent possible under law,
;; published under the CC0 1.0 Universal license.
;;
;; For a full copy of the CC0 license see
;; https://creativecommons.org/publicdomain/zero/1.0/legalcode

;;; Commentary:

;; MUA specific functions for Rmail
;;
;; Setup with (add-hook 'rmail-mode-hook #'autocrypt-mode)

;;; Code:

(require 'rmail)

;;; NOTE: rmail does not use derived modes, so these methods match the
;;;       exact mode.

;;;###autoload
(cl-defmethod autocrypt-load-system ((_mode (eql rmail-mode)))
  "Load this module."
  (require 'autocrypt-rmail))

(cl-defmethod autocrypt-mode-hooks ((_mode (eql rmail-mode)))
  "Return the hook to install autocrypt."
  (require 'autocrypt-mu4e)
  '(rmail-show-message-hook))

(cl-defmethod autocrypt-get-header ((_mode (eql rmail-mode))
                                    header)
  "Ask Rmail to return HEADER."
  (rmail-apply-in-message rmail-current-message
                          (lambda () (mail-fetch-field header))))

(provide 'autocrypt-rmail)

;;; autocrypt-rmail.el ends here