emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master d3fabff: Change how Mail-Copies-To: never is handled in Message


From: Lars Ingebrigtsen
Subject: master d3fabff: Change how Mail-Copies-To: never is handled in Message
Date: Thu, 6 Aug 2020 09:53:35 -0400 (EDT)

branch: master
commit d3fabff99d4aa74f752956ea5b02be7a977efb94
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    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.
---
 etc/NEWS             | 10 ++++++++++
 lisp/gnus/message.el | 31 ++++++++++++++++++++++---------
 2 files changed, 32 insertions(+), 9 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index c577739..185c649 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 71ab63d..6c0f9b5 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]