Re: [BUG/PATCH] emacs: Fix header problem in reply for emacs 23.2
authorAustin Clements <amdragon@MIT.EDU>
Thu, 29 Mar 2012 05:38:33 +0000 (01:38 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:45:50 +0000 (09:45 -0800)
ba/ef8394c91eeca9e7e27627aca93437781a494b [new file with mode: 0644]

diff --git a/ba/ef8394c91eeca9e7e27627aca93437781a494b b/ba/ef8394c91eeca9e7e27627aca93437781a494b
new file mode 100644 (file)
index 0000000..bfeeec0
--- /dev/null
@@ -0,0 +1,145 @@
+Return-Path: <amdragon@mit.edu>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 3566F431FAF\r
+       for <notmuch@notmuchmail.org>; Wed, 28 Mar 2012 22:38:37 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id v1SF4vpxgLv0 for <notmuch@notmuchmail.org>;\r
+       Wed, 28 Mar 2012 22:38:36 -0700 (PDT)\r
+Received: from dmz-mailsec-scanner-3.mit.edu (DMZ-MAILSEC-SCANNER-3.MIT.EDU\r
+       [18.9.25.14])\r
+       by olra.theworths.org (Postfix) with ESMTP id 9880E431FAE\r
+       for <notmuch@notmuchmail.org>; Wed, 28 Mar 2012 22:38:36 -0700 (PDT)\r
+X-AuditID: 1209190e-b7f7c6d0000008c3-0d-4f73f55ca4ab\r
+Received: from mailhub-auth-2.mit.edu ( [18.7.62.36])\r
+       by dmz-mailsec-scanner-3.mit.edu (Symantec Messaging Gateway) with SMTP\r
+       id A4.90.02243.C55F37F4; Thu, 29 Mar 2012 01:38:36 -0400 (EDT)\r
+Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
+       by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id q2T5cZcj029887; \r
+       Thu, 29 Mar 2012 01:38:35 -0400\r
+Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\r
+       (authenticated bits=0)\r
+       (User authenticated as amdragon@ATHENA.MIT.EDU)\r
+       by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q2T5cYEX010353\r
+       (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+       Thu, 29 Mar 2012 01:38:34 -0400 (EDT)\r
+Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77)\r
+       (envelope-from <amdragon@mit.edu>)\r
+       id 1SD84A-0006qX-0U; Thu, 29 Mar 2012 01:38:34 -0400\r
+Date: Thu, 29 Mar 2012 01:38:33 -0400\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: Adam Wolfe Gordon <awg+notmuch@xvx.ca>\r
+Subject: Re: [BUG/PATCH] emacs: Fix header problem in reply for emacs 23.2\r
+Message-ID: <20120329053833.GB2670@mit.edu>\r
+References: <87obrh3ufi.fsf@nikula.org>\r
+       <1332943338-9708-1-git-send-email-awg+notmuch@xvx.ca>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Content-Disposition: inline\r
+In-Reply-To: <1332943338-9708-1-git-send-email-awg+notmuch@xvx.ca>\r
+User-Agent: Mutt/1.5.21 (2010-09-15)\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFuplleLIzCtJLcpLzFFi42IRYrdT0Y35WuxvcPy4kMWRPbPYLZqmO1tc\r
+       vzmT2YHZ49b91+wez1bdYvZo+rGYNYA5issmJTUnsyy1SN8ugSvj0cdt7AWvxSueP93I0sC4\r
+       QriLkZNDQsBE4vbtZhYIW0ziwr31bF2MXBxCAvsYJZ6c28EO4WxglJj+eCczhHOSSWLe8mtQ\r
+       ZUsYJR73X2AG6WcRUJU4tXEVK4jNJqAhsW3/ckYQW0RAS+LH+q9gcWYBHYnXh9+D7RMW8JJ4\r
+       +Os8WA2vgLbE3R9X2UFsIYF4iTUbF7BDxAUlTs58wgLRqyVx499Lpi5GDiBbWmL5Pw6QMKeA\r
+       k8TNDfPAxogKqEhMObmNbQKj0Cwk3bOQdM9C6F7AyLyKUTYlt0o3NzEzpzg1Wbc4OTEvL7VI\r
+       11gvN7NELzWldBMjKNQ5Jfl2MH49qHSIUYCDUYmHV0mn2F+INbGsuDL3EKMkB5OSKG/jF6AQ\r
+       X1J+SmVGYnFGfFFpTmrxIUYJDmYlEV73c0A53pTEyqrUonyYlDQHi5I4r5rWOz8hgfTEktTs\r
+       1NSC1CKYrAwHh5IErwfIUMGi1PTUirTMnBKENBMHJ8hwHqDhE0FqeIsLEnOLM9Mh8qcYFaXE\r
+       edNAEgIgiYzSPLheWCp6xSgO9Iowbx5IFQ8wjcF1vwIazAQ0eMmRfJDBJYkIKakGRrulOx5V\r
+       Rz6qqRRsUX9fd/On0ZsdO3MXTje3V5z2xWqFlxHTrcyV+n9+vtd1XiKxwnDr1fsl5y6rbQ+/\r
+       GLeo37+1szE8ZZW6c9Ee89N/8/4/s7y+8atICmNR/3rVl284jk64umTm03XvpzNve/pk7do5\r
+       aquSnygfub342e626KaUjRO6pWepTHmixFKckWioxVxUnAgATZFUGCADAAA=\r
+Cc: notmuch@notmuchmail.org\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Thu, 29 Mar 2012 05:38:37 -0000\r
+\r
+Quoth Adam Wolfe Gordon on Mar 28 at  8:02 am:\r
+> The new reply code used strings instead of symbols for header names,\r
+> which message-mail is OK with on emacs 23.3, but not 23.2. The symptom\r
+> is that on 23.2 (and presumably on earlier versions) the reply message\r
+> would end up with two of some headers.\r
+> \r
+> This fixes the problem by converting the header names to symbols of\r
+> the type message.el usually expects before passing the headers to\r
+> message-mail.\r
+> ---\r
+>  emacs/notmuch-lib.el |    5 ++++-\r
+>  emacs/notmuch-mua.el |   10 +++++-----\r
+>  2 files changed, 9 insertions(+), 6 deletions(-)\r
+> \r
+> diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el\r
+> index c146748..af46611 100644\r
+> --- a/emacs/notmuch-lib.el\r
+> +++ b/emacs/notmuch-lib.el\r
+> @@ -232,9 +232,12 @@ the given type."\r
+>    (or (plist-get part :content)\r
+>        (notmuch-get-bodypart-internal (concat "id:" (plist-get msg :id)) nth process-crypto)))\r
+>  \r
+> +;; Converts a plist of headers to an alist of headers. The input plist should\r
+> +;; have symbols of the form :Header as keys, and the resulting alist will have\r
+> +;; symbols of the form 'Header as keys.\r
+>  (defun notmuch-plist-to-alist (plist)\r
+\r
+This name isn't really appropriate now.\r
+notmuch-plist-to-headers-list?  notmuch-headers-plist-to-alist?\r
+\r
+Otherwise LGTM, though I don't run such ancient versions of Emacs, so\r
+I can't verify that it fixes the problem.\r
+\r
+>    (loop for (key value . rest) on plist by #'cddr\r
+> -    collect (cons (substring (symbol-name key) 1) value)))\r
+> +    collect (cons (intern (substring (symbol-name key) 1)) value)))\r
+>  \r
+>  ;; Compatibility functions for versions of emacs before emacs 23.\r
+>  ;;\r
+> diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el\r
+> index 9805d79..24918d3 100644\r
+> --- a/emacs/notmuch-mua.el\r
+> +++ b/emacs/notmuch-mua.el\r
+> @@ -185,11 +185,11 @@ OTHER-ARGS are passed through to `message-mail'."\r
+>    (when notmuch-mua-user-agent-function\r
+>      (let ((user-agent (funcall notmuch-mua-user-agent-function)))\r
+>        (when (not (string= "" user-agent))\r
+> -    (push (cons "User-Agent" user-agent) other-headers))))\r
+> +    (push (cons 'User-Agent user-agent) other-headers))))\r
+>  \r
+> -  (unless (assoc "From" other-headers)\r
+> -    (push (cons "From" (concat\r
+> -                    (notmuch-user-name) " <" (notmuch-user-primary-email) ">")) other-headers))\r
+> +  (unless (assq 'From other-headers)\r
+> +    (push (cons 'From (concat\r
+> +                   (notmuch-user-name) " <" (notmuch-user-primary-email) ">")) other-headers))\r
+>  \r
+>    (apply #'message-mail to subject other-headers other-args)\r
+>    (message-sort-headers)\r
+> @@ -250,7 +250,7 @@ the From: address first."\r
+>    (interactive "P")\r
+>    (let ((other-headers\r
+>       (when (or prompt-for-sender notmuch-always-prompt-for-sender)\r
+> -       (list (cons "From" (notmuch-mua-prompt-for-sender))))))\r
+> +       (list (cons 'From (notmuch-mua-prompt-for-sender))))))\r
+>      (notmuch-mua-mail nil nil other-headers)))\r
+>  \r
+>  (defun notmuch-mua-new-forward-message (&optional prompt-for-sender)\r