summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2020-08-06 15:53:24 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2020-08-06 15:53:24 +0200
commitd3fabff99d4aa74f752956ea5b02be7a977efb94 (patch)
tree6c38f76e8c8448fac9c6bf956b8030aa52b412ee
parent51d063e484c185b7e1d9cb4c6bf56d67b9af4781 (diff)
downloademacs-d3fabff99d4aa74f752956ea5b02be7a977efb94.tar.gz
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.
-rw-r--r--etc/NEWS10
-rw-r--r--lisp/gnus/message.el31
2 files changed, 32 insertions, 9 deletions
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)