[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/autocrypt c9d7c13f0d 36/94: Translate mu4e implementati
From: |
ELPA Syncer |
Subject: |
[elpa] externals/autocrypt c9d7c13f0d 36/94: Translate mu4e implementation to methods |
Date: |
Sun, 26 Mar 2023 07:57:59 -0400 (EDT) |
branch: externals/autocrypt
commit c9d7c13f0d2c9329b444952a791dc6873cf1a1cd
Author: Philip K <philipk@posteo.net>
Commit: Philip K <philipk@posteo.net>
Translate mu4e implementation to methods
---
autocrypt-mu4e.el | 29 +++++++++++++++++++++--------
1 file changed, 21 insertions(+), 8 deletions(-)
diff --git a/autocrypt-mu4e.el b/autocrypt-mu4e.el
index ad092ab123..e4854eae5e 100644
--- a/autocrypt-mu4e.el
+++ b/autocrypt-mu4e.el
@@ -24,28 +24,41 @@
(require 'mu4e)
-;;;###autoload
-(cl-defmethod autocrypt-mode-hook ((_mode (derived-mode mu4e-main-mode)))
- "Return the hook to install autocrypt."
- 'gnus-view-mode-hook)
+;;; XXX: mu4e seems to share no common mode, and the `derived-mode'
+;;; specializer supports only one mode (currently). Therefore
+;;; the method definitions have to be duplicated.
-(defun autocrypt-mu4e-install ()
+(cl-defmethod autocrypt-install ((_mode (derived-mode mu4e-main-mode)))
"Install autocrypt hooks for mu4e."
(add-hook 'mu4e-view-mode-hook #'autocrypt-process-header)
(add-hook 'mu4e-compose-mode-hook #'autocrypt-compose-setup))
-(defun autocrypt-mu4e-uninstall ()
+(cl-defmethod autocrypt-uninstall ((_mode (derived-mode mu4e-main-mode)))
"Remove autocrypt hooks for mu4e."
(remove-hook 'mu4e-view-mode-hook #'autocrypt-process-header)
(remove-hook 'mu4e-compose-mode-hook #'autocrypt-compose-setup))
-(defun autocrypt-mu4e-header (field)
- "Ask mu4e to return header FIELD."
+(cl-defmethod autocrypt-get-header ((_mode (derived-mode mu4e-main-mode))
+ header)
+ "Ask mu4e to return HEADER."
(save-window-excursion
(with-current-buffer (mu4e-view-raw-message)
(prog1 (mail-fetch-field field)
(kill-buffer (current-buffer))))))
+(cl-defmethod autocrypt-install ((_mode (derived-mode mu4e-view-mode)))
+ "Install autocrypt hooks for mu4e."
+ (autocrypt-install 'mu4e-main-mode))
+
+(cl-defmethod autocrypt-uninstall ((_mode (derived-mode mu4e-view-mode)))
+ "Remove autocrypt hooks for mu4e."
+ (autocrypt-uninstall 'mu4e-main-mode))
+
+(cl-defmethod autocrypt-get-header ((_mode (derived-mode mu4e-view-mode))
+ header)
+ "Ask mu4e to return HEADER."
+ (autocrypt-get-header 'mu4e-main-mode header))
+
(provide 'autocrypt-mu4e)
;;; autocrypt-mu4e.el ends here
- [elpa] externals/autocrypt 75a0b62adb 64/94: Rename autocrypt-message--encrypted-p, (continued)
- [elpa] externals/autocrypt 75a0b62adb 64/94: Rename autocrypt-message--encrypted-p, ELPA Syncer, 2023/03/26
- [elpa] externals/autocrypt 1444f1861f 83/94: Remember to remove hook as modified in dd400cb, ELPA Syncer, 2023/03/26
- [elpa] externals/autocrypt cf63019b3f 89/94: Add a 'get-part' implementation for Gnus, ELPA Syncer, 2023/03/26
- [elpa] externals/autocrypt a90aa6b644 94/94: Bump version to 0.4.1 for GNU ELPA, ELPA Syncer, 2023/03/26
- [elpa] externals/autocrypt a3e77512f1 04/94: added .dir-locals.el, ELPA Syncer, 2023/03/26
- [elpa] externals/autocrypt 6071d0a971 11/94: added missing require statements, ELPA Syncer, 2023/03/26
- [elpa] externals/autocrypt cb40022cba 23/94: refactored message specific code into autocrypt-compose-* functions, ELPA Syncer, 2023/03/26
- [elpa] externals/autocrypt d771406544 28/94: Recognize mu4e modes in `autocrypt-get-mua', ELPA Syncer, 2023/03/26
- [elpa] externals/autocrypt 926b88e371 33/94: Use setup in README instead of use-package, ELPA Syncer, 2023/03/26
- [elpa] externals/autocrypt 56b7eea585 34/94: Use cl-generic to implement MUA specific code, ELPA Syncer, 2023/03/26
- [elpa] externals/autocrypt c9d7c13f0d 36/94: Translate mu4e implementation to methods,
ELPA Syncer <=
- [elpa] externals/autocrypt 9add1cc9b1 38/94: Autoload autocrypt-install for mu4e, ELPA Syncer, 2023/03/26
- [elpa] externals/autocrypt 211cb302dc 41/94: Add autocrypt-load-system, ELPA Syncer, 2023/03/26
- [elpa] externals/autocrypt 94bfdd049f 42/94: Fix autocrypt-gnus, ELPA Syncer, 2023/03/26
- [elpa] externals/autocrypt ca711395c7 47/94: Add note explaining eql-specializiers for rmail-mode, ELPA Syncer, 2023/03/26
- [elpa] externals/autocrypt 37e14c3b92 60/94: Handle autocrypt-do-gossip as advertised, ELPA Syncer, 2023/03/26
- [elpa] externals/autocrypt 49f4a1a09e 62/94: Update README section on extending autocrypt.el, ELPA Syncer, 2023/03/26
- [elpa] externals/autocrypt f3a556f216 66/94: Revert autocrypt-accounts back into a user option, ELPA Syncer, 2023/03/26
- [elpa] externals/autocrypt 8cc4b86db3 67/94: Reduce minimal version to 24.3, ELPA Syncer, 2023/03/26
- [elpa] externals/autocrypt 222954754a 73/94: Elaborate the autocrypt-install and -uninstall docstrings, ELPA Syncer, 2023/03/26
- [elpa] externals/autocrypt fe5a358566 85/94: Add missing `-hook` suffix in readme hook name, ELPA Syncer, 2023/03/26