all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Thierry Volpiatto <thierry.volpiatto@gmail.com>
To: 13321@debbugs.gnu.org
Subject: bug#13321: 24.3.0.50; Gmail error when replying from Gnus to github
Date: Sat, 23 Feb 2013 11:34:50 +0100	[thread overview]
Message-ID: <878v6f5ned.fsf@gmail.com> (raw)
In-Reply-To: <87a9surugk.fsf@gmail.com>

Hi Katsumi,

Katsumi Yamaoka <yamaoka@jpl.org> writes:

> thierry.volpiatto@gmail.com wrote:
>> Katsumi Yamaoka <yamaoka@jpl.org> writes:
>>> Please let me say that a wide reply doesn't contain the author
>>> of an original mail in the recipient list is a bug.  To exclude
>>> an invalid address from a wide reply is not a feature;
>
>> It is not excluded in the patch, it is added to "cc" only if "wide" is
>> specified.
> [...]
>> Please have a look at the mail examples I sent in other posts.
>
> Hm, I haven't gotten it yet.  Could you try replying to a mail
> attached in this message as well (copy it to a mail group and do
> F)?
>
> [...]
>> The point is that with the patch I sent + the headers of the rejected
>> mail and the original mail where I reply to, you will be able to
>> understand what happen and fix it.
>
> Ok, I'll surely try it.

Here the whole patch:

diff --git a/lisp/message.el b/lisp/message.el
index 21847ac..d92c9ae 100644
--- a/lisp/message.el
+++ b/lisp/message.el
@@ -6753,8 +6753,7 @@ The function is called with one parameter, a cons cell ..."
       ;; message-header-synonyms.
       (setq to (or (message-fetch-field "to")
 		   (and (loop for synonym in message-header-synonyms
-			      when (memq 'Original-To synonym)
-			      return t)
+			      thereis (memq 'Original-To synonym))
 			(message-fetch-field "original-to")))
 	    cc (message-fetch-field "cc")
 	    extra (when message-extra-wide-headers
@@ -6764,16 +6763,15 @@ The function is called with one parameter, a cons cell ..."
 			       ", "))
 	    mct (message-fetch-field "mail-copies-to")
 	    author (or (message-fetch-field "mail-reply-to")
-		       (message-fetch-field "reply-to"))
+		       (message-fetch-field "reply-to")
+		       (message-fetch-field "from") "")
 	    mft (and message-use-mail-followup-to
 		     (message-fetch-field "mail-followup-to")))
       ;; Make sure this message goes to the author if this is a wide
       ;; reply, since Reply-To address may be a list address a mailing
       ;; list server added.
       (when (and wide author)
-	(setq cc (concat author ", " cc)))
-      (when (or wide (not author))
-	(setq author (or (message-fetch-field "from") ""))))
+	(setq cc (concat author ", " cc))))
 
     ;; Handle special values of Mail-Copies-To.
     (when mct
@@ -6829,13 +6827,9 @@ want to get rid of this query permanently.")))
 	(setq recipients (concat ", " mft)))
        (t
 	(setq recipients (if never-mct "" (concat ", " author)))
-	(if to (setq recipients (concat recipients ", " to)))
-	(if cc (setq recipients (concat recipients ", " cc)))
-	(if extra (setq recipients (concat recipients ", " extra)))
-	(if mct (setq recipients (concat recipients ", " mct)))))
-      (if (>= (length recipients) 2)
-	  ;; Strip the leading ", ".
-	  (setq recipients (substring recipients 2)))
+	(loop for h in `(,to ,cc ,extra ,mct)
+	      for recip = (and recipients (not (string= recipients "")))
+	      when h do (setq recipients (concat recipients (and recip ", ") h)))))
       ;; Squeeze whitespace.
       (while (string-match "[ \t][ \t]+" recipients)
 	(setq recipients (replace-match " " t t recipients)))
@@ -6854,31 +6848,20 @@ want to get rid of this query permanently.")))
 			    (cons (downcase (mail-strip-quoted-names addr))
 				  addr))
 		 (cons (downcase (mail-strip-quoted-names addr)) addr)))
-	     (message-tokenize-header recipients)))
-      ;; Remove all duplicates.
-      (let ((s recipients))
-	(while s
-	  (let ((address (car (pop s))))
-	    (while (assoc address s)
-	      (setq recipients (delq (assoc address s) recipients)
-		    s (delq (assoc address s) s))))))
+	     ;; Remove all duplicates.
+	     (loop with recip for mess in (message-tokenize-header recipients)
+		   unless (member mess recip) collect mess into recip
+		   finally return recip)))
 
       ;; Remove hierarchical lists that are contained within each other,
       ;; if message-hierarchical-addresses is defined.
       (when message-hierarchical-addresses
-	(let ((plain-addrs (mapcar 'car recipients))
-	      subaddrs recip)
-	  (while plain-addrs
-	    (setq subaddrs (assoc (car plain-addrs)
-				  message-hierarchical-addresses)
-		  plain-addrs (cdr plain-addrs))
-	    (when subaddrs
-	      (setq subaddrs (cdr subaddrs))
-	      (while subaddrs
-		(setq recip (assoc (car subaddrs) recipients)
-		      subaddrs (cdr subaddrs))
-		(if recip
-		    (setq recipients (delq recip recipients))))))))
+        (setq recipients
+              (loop for (r . a) in recipients
+                    for assoc = (cdr (assoc r message-hierarchical-addresses))
+                    when assoc append assoc into recip
+                    unless (or (member r recip) (assoc r results))
+                    collect (cons r a) into results finally return results)))
 
       (setq recipients (message-prune-recipients recipients))
 

-- 
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 






  parent reply	other threads:[~2013-02-23 10:34 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-31 17:40 bug#13321: 24.3.0.50; Gmail error when replying from Gnus to github Thierry Volpiatto
2012-12-31 20:26 ` Andreas Schwab
2013-01-02 20:13 ` Lars Magne Ingebrigtsen
2013-01-02 21:14   ` Thierry Volpiatto
2013-01-02 22:50     ` Lars Magne Ingebrigtsen
2013-01-03  5:34       ` Thierry Volpiatto
2013-01-03  6:10         ` Lars Magne Ingebrigtsen
2013-01-03  6:41           ` Thierry Volpiatto
2013-01-08  6:35             ` Thierry Volpiatto
2013-02-14  6:35               ` Thierry Volpiatto
2013-02-21 16:22               ` Thierry Volpiatto
2013-02-21 16:53                 ` Thierry Volpiatto
2013-02-21 19:40                   ` Thierry Volpiatto
2013-02-22  7:15                     ` Katsumi Yamaoka
2013-02-22  7:33                       ` Thierry Volpiatto
2013-02-22  9:34                         ` Katsumi Yamaoka
2013-02-22 10:06                           ` Thierry Volpiatto
2013-02-22 11:17                             ` Katsumi Yamaoka
2013-02-22 14:09                               ` Thierry Volpiatto
2013-02-23  6:56                               ` Thierry Volpiatto
2013-02-23  8:18                               ` Thierry Volpiatto
2013-02-23 10:06                                 ` Thierry Volpiatto
2013-02-23 10:34                               ` Thierry Volpiatto [this message]
2013-02-24  6:49                               ` Thierry Volpiatto
2013-02-25  6:59                                 ` Katsumi Yamaoka
2013-02-25  7:08                                   ` Katsumi Yamaoka
2013-02-25  7:15                                   ` Thierry Volpiatto
2013-02-25  7:33                                     ` Katsumi Yamaoka
2013-02-25  9:17                                       ` Thierry Volpiatto
2013-02-25 11:29                                         ` Katsumi Yamaoka
2013-02-22  7:43                       ` Thierry Volpiatto
2013-02-22  7:51                       ` Thierry Volpiatto
2013-02-22  7:53                       ` Thierry Volpiatto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878v6f5ned.fsf@gmail.com \
    --to=thierry.volpiatto@gmail.com \
    --cc=13321@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.