From a7c5eed95321c77d4e5069a508b4b16094f4a68d Mon Sep 17 00:00:00 2001 From: Alexander Adolf Date: Wed, 7 Dec 2022 23:07:11 +0100 Subject: [PATCH] Set completion-style for email addresses when EUDC contributes to CAPF * lisp/net/eudc-capf.el (eudc-capf-complete): when the user has not modified 'completion-styles', set it to a value better suited for email address completion than the default setting (bug#59314) --- lisp/net/eudc-capf.el | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lisp/net/eudc-capf.el b/lisp/net/eudc-capf.el index e2bbd5b28b..5bd2c92441 100644 --- a/lisp/net/eudc-capf.el +++ b/lisp/net/eudc-capf.el @@ -104,7 +104,16 @@ eudc-capf-complete (if (and (seq-some #'derived-mode-p eudc-capf-modes) (let ((mail-abbrev-mode-regexp message-email-recipient-header-regexp)) (mail-abbrev-in-expansion-header-p))) - (eudc-capf-message-expand-name))) + (progn + ;; FIXME: `completion-styles' is set to a value which seems + ;; better suited for email address completion if and when it + ;; has not been modified from it's default value (which is not + ;; well suited for this purpose). This is needed until + ;; `message.el' will be updated to use completion categories. + (when (equal completion-styles + (eval (car (get 'completion-styles 'standard-value)))) + (setq-local completion-styles '(substring partial-completion))) + (eudc-capf-message-expand-name)))) ;;;###autoload (defun eudc-capf-message-expand-name () -- 2.38.1