From f143fcc0ed15fdaae65e14fd9280b2f5faac2c0a Mon Sep 17 00:00:00 2001 From: Alexander Adolf Date: Sat, 12 Mar 2022 18:15:24 +0100 Subject: [PATCH] Facilitate Customisation of Message-Mode Header Completion Behaviour * lisp/gnus/message.el (message-email-recipient-header-regexp): New user option. (message-completion-alist): Use it here. --- lisp/gnus/message.el | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index a5b3d404671..2e9242d3e1e 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -8265,17 +8265,23 @@ When FORCE, rebuild the tool bar." 'message-mode-map)))) message-tool-bar-map) -;;; Group name completion. +;;; Group name and email address completion. (defcustom message-newgroups-header-regexp "^\\(Newsgroups\\|Followup-To\\|Posted-To\\|Gcc\\):" - "Regexp that match headers that lists groups." + "Regexp matching headers that list groups." :group 'message :type 'regexp) +(defcustom message-email-recipient-header-regexp + "^\\([^ :]*-\\)?\\(To\\|B?Cc\\|From\\|Reply-to\\|Mail-Followup-To\\|Mail-Copies-To\\):" + "Regexp matching headers that list email addresses." + :version "29.1" + :type 'regexp) + (defcustom message-completion-alist `((,message-newgroups-header-regexp . ,#'message-expand-group) - ("^\\([^ :]*-\\)?\\(To\\|B?Cc\\|From\\):" . ,#'message-expand-name)) + (,message-email-recipient-header-regexp . ,#'message-expand-name)) "Alist of (RE . FUN). Use FUN for completion on header lines matching RE. FUN should be a function that obeys the same rules as those of `completion-at-point-functions'." -- 2.39.2