From: Lars Ingebrigtsen Date: Thu, 6 Aug 2020 13:53:24 +0000 (+0200) Subject: Change how Mail-Copies-To: never is handled in Message X-Git-Tag: emacs-28.0.90~6788 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d3fabff99d4aa74f752956ea5b02be7a977efb94;p=emacs.git Change how Mail-Copies-To: never is handled in Message * lisp/gnus/message.el (message-get-reply-headers): Change how Mail-Copies-To: never is handled (bug#37591). When that header is present, put all the remaining recipients in the To header, instead of picking an arbitrary recipient to have in the To header, and the rest in the Cc header. --- diff --git a/etc/NEWS b/etc/NEWS index c57773922ed..185c649186a 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -236,6 +236,16 @@ not. ** Message +--- +*** A change to how Mail-Copies-To: never is handled. +If a user has specified Mail-Copies-To: never, and Message was asked +to do a "wide reply", some other arbitrary recipient would end up in +the resulting To header, while the remaining recipients would be put +in the Cc header. This is somewhat misleading, as it looks like +you're responding to a specific person in particular. This has been +changed so that all the recipients are put in the To header in these +instances. + +++ *** New function to start Emacs in Message mode to send an email. Emacs can be defined as a handler for the "x-scheme-handler/mailto" diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 71ab63de39e..6c0f9b5c9ba 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -6998,15 +6998,28 @@ want to get rid of this query permanently."))) ;; Build the header alist. Allow the user to be asked whether ;; or not to reply to all recipients in a wide reply. - (setq follow-to (list (cons 'To (cdr (pop recipients))))) - (when (and recipients - (or (not message-wide-reply-confirm-recipients) - (y-or-n-p "Reply to all recipients? "))) - (setq recipients (mapconcat - (lambda (addr) (cdr addr)) recipients ", ")) - (if (string-match "^ +" recipients) - (setq recipients (substring recipients (match-end 0)))) - (push (cons 'Cc recipients) follow-to))) + (when (or (< (length recipients) 2) + (not message-wide-reply-confirm-recipients) + (y-or-n-p "Reply to all recipients? ")) + (if never-mct + ;; The author has requested never to get a (wide) + ;; response, so put everybody else into the To header. + ;; This avoids looking as if we're To-in somebody else in + ;; specific, and just Cc-in the rest. + (setq follow-to (list + (cons 'To + (mapconcat + (lambda (addr) + (cdr addr)) recipients ", ")))) + ;; Put the first recipient in the To header. + (setq follow-to (list (cons 'To (cdr (pop recipients))))) + ;; Put the rest of the recipients in Cc. + (when recipients + (setq recipients (mapconcat + (lambda (addr) (cdr addr)) recipients ", ")) + (if (string-match "^ +" recipients) + (setq recipients (substring recipients (match-end 0)))) + (push (cons 'Cc recipients) follow-to))))) follow-to)) (defun message-prune-recipients (recipients)