aboutsummaryrefslogtreecommitdiff
path: root/modules/mu4e-org-contacts-integration.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-07-13 23:23:00 -0500
committerCraig Jennings <c@cjennings.net>2026-07-13 23:23:00 -0500
commit42cb6c172ebd8fa61de39244a049bb23e3d0a69a (patch)
treebcb1d946ba77e8b81c5e83292b186a7216223110 /modules/mu4e-org-contacts-integration.el
parent00f1246fa32fa65571a141b1b685b95994fbfbc9 (diff)
downloaddotemacs-42cb6c172ebd8fa61de39244a049bb23e3d0a69a.tar.gz
dotemacs-42cb6c172ebd8fa61de39244a049bb23e3d0a69a.zip
refactor(mu4e-contacts): drop no-op completion hook surgery
mu4e 1.14 calls mu4e--compose-setup-completion directly during compose setup, never via mu4e-compose-mode-hook, so the activate path's remove-hook did nothing and the deactivate path's add-hook installed a function that was never hook-driven. The mu4e-compose-complete-addresses variable already gates the built-in completion on both paths. I also declared that variable for the compiler, which clears the module's two free-variable warnings.
Diffstat (limited to 'modules/mu4e-org-contacts-integration.el')
-rw-r--r--modules/mu4e-org-contacts-integration.el17
1 files changed, 9 insertions, 8 deletions
diff --git a/modules/mu4e-org-contacts-integration.el b/modules/mu4e-org-contacts-integration.el
index 6062b8cf..fc0a7325 100644
--- a/modules/mu4e-org-contacts-integration.el
+++ b/modules/mu4e-org-contacts-integration.el
@@ -22,6 +22,7 @@
;; isolation doesn't warn about free variables / undefined functions; the
;; actual definitions live where named.
(eval-when-compile (defvar contacts-file)) ; user-constants.el
+(defvar mu4e-compose-complete-addresses) ; mu4e-compose.el (lazy)
(declare-function cj/get-all-contact-emails ; org-contacts-config.el
"org-contacts-config" ())
@@ -157,10 +158,10 @@ This bypasses the completion-at-point system for direct selection."
;; Setup hooks for org-msg-edit-mode (HTML email composition)
(with-eval-after-load 'org-msg
(add-hook 'org-msg-edit-mode-hook #'cj/mu4e-org-contacts-compose-setup))
-
- ;; Remove any existing mu4e completion setup
- (remove-hook 'mu4e-compose-mode-hook #'mu4e--compose-setup-completion)
-
+
+ ;; No hook surgery on mu4e--compose-setup-completion: mu4e 1.14 calls it
+ ;; directly during compose setup (never via this hook), and it is already
+ ;; gated by the `mu4e-compose-complete-addresses' nil above.
(message "mu4e org-contacts integration activated"))
(defun cj/deactivate-mu4e-org-contacts-integration ()
@@ -170,11 +171,11 @@ This bypasses the completion-at-point system for direct selection."
;; Remove our hooks
(remove-hook 'mu4e-compose-mode-hook #'cj/mu4e-org-contacts-compose-setup)
(remove-hook 'org-msg-edit-mode-hook #'cj/mu4e-org-contacts-compose-setup)
-
- ;; Re-enable mu4e's built-in completion if desired
+
+ ;; Re-enable mu4e's built-in completion: the var is enough, since mu4e's
+ ;; compose setup calls its completion function directly, gated on this.
(setq mu4e-compose-complete-addresses t)
- (add-hook 'mu4e-compose-mode-hook #'mu4e--compose-setup-completion)
-
+
(message "mu4e org-contacts integration deactivated"))
(provide 'mu4e-org-contacts-integration)