[BUG/PATCH] emacs: Fix header problem in reply for emacs 23.2
authorAdam Wolfe Gordon <awg+notmuch@xvx.ca>
Wed, 28 Mar 2012 14:02:18 +0000 (08:02 +1800)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:45:49 +0000 (09:45 -0800)
e3/7959355fcaf885da64047a57877e287825d0cc [new file with mode: 0644]

diff --git a/e3/7959355fcaf885da64047a57877e287825d0cc b/e3/7959355fcaf885da64047a57877e287825d0cc
new file mode 100644 (file)
index 0000000..2e015a3
--- /dev/null
@@ -0,0 +1,117 @@
+Return-Path: <awg@lagos.xvx.ca>\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 ED936431FAF\r
+       for <notmuch@notmuchmail.org>; Wed, 28 Mar 2012 07:02:29 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_NONE=-0.0001] 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 nvt+UWz77nhS for <notmuch@notmuchmail.org>;\r
+       Wed, 28 Mar 2012 07:02:29 -0700 (PDT)\r
+Received: from idcmail-mo1so.shaw.ca (idcmail-mo1so.shaw.ca [24.71.223.10])\r
+       by olra.theworths.org (Postfix) with ESMTP id 77197431FAE\r
+       for <notmuch@notmuchmail.org>; Wed, 28 Mar 2012 07:02:29 -0700 (PDT)\r
+Received: from pd3ml2so-ssvc.prod.shaw.ca ([10.0.141.138])\r
+       by pd3mo1so-svcs.prod.shaw.ca with ESMTP; 28 Mar 2012 08:02:29 -0600\r
+X-Cloudmark-SP-Filtered: true\r
+X-Cloudmark-SP-Result: v=1.1 cv=w8ylZ/s5/CpB4NtJ57cq/Y3wf+h+jIFeVVN4WVEh/uc=\r
+       c=1 sm=1\r
+       a=S0R2Cj-5jVsA:10 a=BLceEmwcHowA:10 a=yQp6g8lIsgqumF79BAsFDg==:17\r
+       a=Oc9B4HQ8RdShrQTKbjUA:9 a=LlVLWLaIUwi6vdQPZ44A:7 a=Eo7dM2StyDUXn3Oo:21\r
+       a=AdxvkLXnfx2Hsqoe:21 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117\r
+Received: from unknown (HELO lagos.xvx.ca) ([96.52.216.56])\r
+       by pd3ml2so-dmz.prod.shaw.ca with ESMTP; 28 Mar 2012 08:02:28 -0600\r
+Received: by lagos.xvx.ca (Postfix, from userid 1000)\r
+       id 6E6C28004204; Wed, 28 Mar 2012 08:02:28 -0600 (MDT)\r
+From: Adam Wolfe Gordon <awg+notmuch@xvx.ca>\r
+To: notmuch@notmuchmail.org,\r
+       jani@nikula.org\r
+Subject: [BUG/PATCH] emacs: Fix header problem in reply for emacs 23.2\r
+Date: Wed, 28 Mar 2012 08:02:18 -0600\r
+Message-Id: <1332943338-9708-1-git-send-email-awg+notmuch@xvx.ca>\r
+X-Mailer: git-send-email 1.7.5.4\r
+In-Reply-To: <87obrh3ufi.fsf@nikula.org>\r
+References: <87obrh3ufi.fsf@nikula.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: Wed, 28 Mar 2012 14:02:30 -0000\r
+\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
+   (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
+-- \r
+1.7.5.4\r
+\r