branch: externals/ebdb
commit 55bdcc37b28d1e827f5c03367bea989b707e0564
Author: Eric Abrahamsen <e...@ericabrahamsen.net>
Commit: Eric Abrahamsen <e...@ericabrahamsen.net>

    Add autoload cookies to all "insinuation" MUA functions
    
    Preparatory to changing the recommended load method from require, to
    adding hooks manually.
---
 ebdb-gnus.el    |  1 +
 ebdb-message.el | 10 ++++++----
 ebdb-mhe.el     |  6 ++++--
 ebdb-mu4e.el    |  1 +
 ebdb-notmuch.el |  2 ++
 ebdb-rmail.el   |  2 ++
 ebdb-vm.el      |  1 +
 ebdb-wl.el      |  2 ++
 8 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/ebdb-gnus.el b/ebdb-gnus.el
index cdc5bfa590..58a3285a16 100644
--- a/ebdb-gnus.el
+++ b/ebdb-gnus.el
@@ -336,6 +336,7 @@ composed to a certain record."
            (apply #'message-mail (ebdb-dwim-mail record mail) args)))
       (cl-call-next-method))))
 
+;;;###autoload
 (defun ebdb-insinuate-gnus ()
   "Hook EBDB into Gnus."
   ;; `ebdb-mua-display-sender' fails in *Article* buffers, where
diff --git a/ebdb-message.el b/ebdb-message.el
index e553dc33d9..3063b6bfa6 100644
--- a/ebdb-message.el
+++ b/ebdb-message.el
@@ -149,6 +149,7 @@ Also fires when postponing a draft."
   ;; do the undisplay manually.
   (ebdb-undisplay-records))
 
+;;;###autoload
 (defun ebdb-insinuate-mail ()
   "Hook EBDB into Mail Mode."
   ;; We don't currently bind the `ebdb-mua-keymap'.
@@ -171,16 +172,17 @@ Also fires when postponing a draft."
 
   (ebdb-undisplay-records))
 
+;;;###autoload
 (defun ebdb-message-auto-update ()
   (ebdb-mua-auto-update ebdb-message-auto-update-p))
 
 (defun ebdb-message-display-only ()
   (ebdb-mua-auto-update 'existing))
 
-(add-hook 'message-mode-hook 'ebdb-insinuate-message)
-(add-hook 'mail-setup-hook 'ebdb-insinuate-mail)
-(add-hook 'message-send-hook 'ebdb-message-auto-update)
-(add-hook 'mail-send-hook 'ebdb-message-auto-update)
+(add-hook 'message-mode-hook #'ebdb-insinuate-message)
+(add-hook 'mail-setup-hook #'ebdb-insinuate-mail)
+(add-hook 'message-send-hook #'ebdb-message-auto-update)
+(add-hook 'mail-send-hook #'ebdb-message-auto-update)
 
 (provide 'ebdb-message)
 ;;; ebdb-message.el ends here
diff --git a/ebdb-mhe.el b/ebdb-mhe.el
index 429adc6c49..40a16ab5a2 100644
--- a/ebdb-mhe.el
+++ b/ebdb-mhe.el
@@ -137,13 +137,15 @@ Returns the empty string if HEADER is not in the message."
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
+;;;###autoload
 (defun ebdb-insinuate-mh ()
   "Hook EBDB into MH-E."
   (define-key mh-folder-mode-map ";" ebdb-mua-keymap)
   (when ebdb-complete-mail
-      (define-key mh-letter-mode-map "\M-;" 'ebdb-complete-mail)
-      (define-key mh-letter-mode-map "\e\t" 'ebdb-complete-mail)))
+    (define-key mh-letter-mode-map "\M-;" 'ebdb-complete-mail)
+    (define-key mh-letter-mode-map "\e\t" 'ebdb-complete-mail)))
 
+;;;###autoload
 (defun ebdb-mhe-auto-update ()
   (ebdb-mua-auto-update ebdb-mhe-auto-update-p))
 
diff --git a/ebdb-mu4e.el b/ebdb-mu4e.el
index 158910bcea..b73f587737 100644
--- a/ebdb-mu4e.el
+++ b/ebdb-mu4e.el
@@ -67,6 +67,7 @@ the value of `ebdb-default-window-size'."
 (cl-defmethod ebdb-popup-window (&context (major-mode mu4e-view-mode))
   (list (get-buffer-window) ebdb-mu4e-window-size))
 
+;;;###autoload
 (defun ebdb-insinuate-mu4e ()
   "Hook EBDB into mu4e."
   ;; Tackle headers later
diff --git a/ebdb-notmuch.el b/ebdb-notmuch.el
index edc7d2dfeb..3775c25f29 100644
--- a/ebdb-notmuch.el
+++ b/ebdb-notmuch.el
@@ -62,10 +62,12 @@ the value of `ebdb-default-window-size'."
 (cl-defmethod ebdb-popup-window (&context (major-mode notmuch-show-mode))
   (list (get-buffer-window) ebdb-notmuch-window-size))
 
+;;;###autoload
 (defun ebdb-insinuate-notmuch-show ()
   "Hook EBDB into Notmuch's `notmuch-show-mode'."
   (define-key notmuch-show-mode-map ";" ebdb-mua-keymap))
 
+;;;###autoload
 (defun ebdb-insinuate-notmuch-message ()
   "Hook EBDB into Notmuch's `notmuch-message-mode'."
   (when ebdb-complete-mail
diff --git a/ebdb-rmail.el b/ebdb-rmail.el
index 20dc7984b8..09f075e6a0 100644
--- a/ebdb-rmail.el
+++ b/ebdb-rmail.el
@@ -79,10 +79,12 @@ the value of `ebdb-default-window-size'."
 (cl-defmethod ebdb-popup-buffer (&context (major-mode rmail-summary-mode))
   (list (get-buffer-window) ebdb-rmail-window-size))
 
+;;;###autoload
 (defun ebdb-insinuate-rmail ()
   "Hook EBDB into RMAIL."
   (define-key rmail-mode-map ";" ebdb-mua-keymap))
 
+;;;###autoload
 (defun ebdb-rmail-auto-update ()
   (ebdb-mua-auto-update ebdb-rmail-auto-update-p))
 
diff --git a/ebdb-vm.el b/ebdb-vm.el
index e244ed0c83..b364e94198 100644
--- a/ebdb-vm.el
+++ b/ebdb-vm.el
@@ -399,6 +399,7 @@ from different senders."
             ;; the EBDB record of the sender.
             (lambda (m) (ebdb-mua-summary-mark (vm-su-from m))))))
 
+;;;###autoload
 (defun ebdb-vm-auto-update ()
   (ebdb-mua-auto-update ebdb-vm-auto-update-p))
 
diff --git a/ebdb-wl.el b/ebdb-wl.el
index bc85642da4..8091f38ea2 100644
--- a/ebdb-wl.el
+++ b/ebdb-wl.el
@@ -134,6 +134,7 @@ beginning) of the signature separator."
       (when win
        (quit-window nil win)))))
 
+;;;###autoload
 (defun ebdb-insinuate-wl ()
   "Hook EBDB into Wanderlust."
   (define-key wl-summary-mode-map ";" ebdb-mua-keymap)
@@ -142,6 +143,7 @@ beginning) of the signature separator."
     (define-key wl-draft-mode-map (kbd "TAB") #'ebdb-complete-mail))
   (add-hook 'wl-summary-exit-hook #'ebdb-wl-quit-window))
 
+;;;###autoload
 (defun ebdb-wl-auto-update ()
   (ebdb-mua-auto-update ebdb-wl-auto-update-p))
 

Reply via email to