djcb / mu

maildir indexer/searcher + emacs mail client + guile bindings
http://www.djcbsoftware.nl/code/mu
GNU General Public License v3.0
1.59k stars 384 forks source link

mu4e--compose-setup-completion is disabling message-completion-function unconditionaly #2697

Closed thierryvolpiatto closed 2 months ago

thierryvolpiatto commented 2 months ago

Describe the bug

As a result when mu4e-compose-complete-addresses is nil we have no completion at all. The only solution is to reenable the hook from mu4e-compose-mode-hook.

I think what is needed is this:

diff --git a/mu4e/mu4e-compose.el b/mu4e/mu4e-compose.el
index 3b458c5f..eea48ba1 100644
--- a/mu4e/mu4e-compose.el
+++ b/mu4e/mu4e-compose.el
@@ -391,10 +391,10 @@ contact fields."

 (defun mu4e--compose-setup-completion ()
   "Set up auto-completion of addresses if enabled."
-  ;; turn off message-mode's completion, it's just interfering.
-  (remove-hook 'completion-at-point-functions
-               #'message-completion-function 'local)
   (when mu4e-compose-complete-addresses
+    ;; turn off message-mode's completion, it's just interfering.
+    (remove-hook 'completion-at-point-functions
+                 #'message-completion-function 'local)
     (set (make-local-variable 'completion-ignore-case) t)
     (set (make-local-variable 'completion-cycle-threshold) 7)
     (add-to-list (make-local-variable 'completion-styles) 'substring)

Environment

Please describe the versions of OS, Emacs, mu/mu4e etc. you are using.

LinuxMint and Emacs-29.3

Checklist

Please make sure you all items in the checklist are set/met before filing the ticket.

Thank you!

djcb commented 2 months ago

Thanks, I've reworked it a little bit, just making sure mu4e's completion is at the beginning (when enabled). Seems to work fine.

thierryvolpiatto commented 2 months ago

"Dirk-Jan C. Binnema" @.***> writes:

  1. ( ) text/plain (*) text/html

Thanks, I've reworked it a little bit, just making sure mu4e's completion is at the beginning (when enabled).

Looks good thanks.

-- Thierry