mirror of https://github.com/djcb/mu.git
mu4e-compose: don't interfere with non-mu4e completion
When enabled, attempt mu4e's auto-completion the first in line (in completion-at-point-functions); but don't remove any other completions the user may have set up. Fixes #2697.
This commit is contained in:
parent
a0d60d23b0
commit
6349091061
|
@ -390,16 +390,18 @@ contact fields."
|
||||||
(mu4e-complete-contact))))
|
(mu4e-complete-contact))))
|
||||||
|
|
||||||
(defun mu4e--compose-setup-completion ()
|
(defun mu4e--compose-setup-completion ()
|
||||||
"Set up auto-completion of addresses if enabled."
|
"Maybe enable auto-completion of addresses.
|
||||||
;; turn off message-mode's completion, it's just interfering.
|
Do this when `mu4e-compose-complete-addresses' is non-nil.
|
||||||
(remove-hook 'completion-at-point-functions
|
|
||||||
#'message-completion-function 'local)
|
When enabled, this attempts to put mu4e's completions at the
|
||||||
|
start of the buffer-local `completion-at-point-functions'. Other
|
||||||
|
completion functions still apply."
|
||||||
(when mu4e-compose-complete-addresses
|
(when mu4e-compose-complete-addresses
|
||||||
(set (make-local-variable 'completion-ignore-case) t)
|
(set (make-local-variable 'completion-ignore-case) t)
|
||||||
(set (make-local-variable 'completion-cycle-threshold) 7)
|
(set (make-local-variable 'completion-cycle-threshold) 7)
|
||||||
(add-to-list (make-local-variable 'completion-styles) 'substring)
|
(add-to-list (make-local-variable 'completion-styles) 'substring)
|
||||||
(add-hook 'completion-at-point-functions
|
(add-hook 'completion-at-point-functions
|
||||||
#'mu4e--compose-complete-contact-field nil t)))
|
#'mu4e--compose-complete-contact-field -10 t)))
|
||||||
|
|
||||||
(defun mu4e--fcc-handler (msgpath)
|
(defun mu4e--fcc-handler (msgpath)
|
||||||
"Handle Fcc: for MSGPATH.
|
"Handle Fcc: for MSGPATH.
|
||||||
|
|
Loading…
Reference in New Issue