From bde82832f9e9759d97595189966cc374fe0a6387 Mon Sep 17 00:00:00 2001 From: Adam Wolfe Gordon Date: Thu, 29 Mar 2012 08:02:18 +1800 Subject: [PATCH] [BUG/PATCH] emacs: Fix header problem in reply for emacs 23.2 --- e3/7959355fcaf885da64047a57877e287825d0cc | 117 ++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 e3/7959355fcaf885da64047a57877e287825d0cc diff --git a/e3/7959355fcaf885da64047a57877e287825d0cc b/e3/7959355fcaf885da64047a57877e287825d0cc new file mode 100644 index 000000000..2e015a3f4 --- /dev/null +++ b/e3/7959355fcaf885da64047a57877e287825d0cc @@ -0,0 +1,117 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id ED936431FAF + for ; Wed, 28 Mar 2012 07:02:29 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_NONE=-0.0001] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id nvt+UWz77nhS for ; + Wed, 28 Mar 2012 07:02:29 -0700 (PDT) +Received: from idcmail-mo1so.shaw.ca (idcmail-mo1so.shaw.ca [24.71.223.10]) + by olra.theworths.org (Postfix) with ESMTP id 77197431FAE + for ; Wed, 28 Mar 2012 07:02:29 -0700 (PDT) +Received: from pd3ml2so-ssvc.prod.shaw.ca ([10.0.141.138]) + by pd3mo1so-svcs.prod.shaw.ca with ESMTP; 28 Mar 2012 08:02:29 -0600 +X-Cloudmark-SP-Filtered: true +X-Cloudmark-SP-Result: v=1.1 cv=w8ylZ/s5/CpB4NtJ57cq/Y3wf+h+jIFeVVN4WVEh/uc= + c=1 sm=1 + a=S0R2Cj-5jVsA:10 a=BLceEmwcHowA:10 a=yQp6g8lIsgqumF79BAsFDg==:17 + a=Oc9B4HQ8RdShrQTKbjUA:9 a=LlVLWLaIUwi6vdQPZ44A:7 a=Eo7dM2StyDUXn3Oo:21 + a=AdxvkLXnfx2Hsqoe:21 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 +Received: from unknown (HELO lagos.xvx.ca) ([96.52.216.56]) + by pd3ml2so-dmz.prod.shaw.ca with ESMTP; 28 Mar 2012 08:02:28 -0600 +Received: by lagos.xvx.ca (Postfix, from userid 1000) + id 6E6C28004204; Wed, 28 Mar 2012 08:02:28 -0600 (MDT) +From: Adam Wolfe Gordon +To: notmuch@notmuchmail.org, + jani@nikula.org +Subject: [BUG/PATCH] emacs: Fix header problem in reply for emacs 23.2 +Date: Wed, 28 Mar 2012 08:02:18 -0600 +Message-Id: <1332943338-9708-1-git-send-email-awg+notmuch@xvx.ca> +X-Mailer: git-send-email 1.7.5.4 +In-Reply-To: <87obrh3ufi.fsf@nikula.org> +References: <87obrh3ufi.fsf@nikula.org> +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Wed, 28 Mar 2012 14:02:30 -0000 + +The new reply code used strings instead of symbols for header names, +which message-mail is OK with on emacs 23.3, but not 23.2. The symptom +is that on 23.2 (and presumably on earlier versions) the reply message +would end up with two of some headers. + +This fixes the problem by converting the header names to symbols of +the type message.el usually expects before passing the headers to +message-mail. +--- + emacs/notmuch-lib.el | 5 ++++- + emacs/notmuch-mua.el | 10 +++++----- + 2 files changed, 9 insertions(+), 6 deletions(-) + +diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el +index c146748..af46611 100644 +--- a/emacs/notmuch-lib.el ++++ b/emacs/notmuch-lib.el +@@ -232,9 +232,12 @@ the given type." + (or (plist-get part :content) + (notmuch-get-bodypart-internal (concat "id:" (plist-get msg :id)) nth process-crypto))) + ++;; Converts a plist of headers to an alist of headers. The input plist should ++;; have symbols of the form :Header as keys, and the resulting alist will have ++;; symbols of the form 'Header as keys. + (defun notmuch-plist-to-alist (plist) + (loop for (key value . rest) on plist by #'cddr +- collect (cons (substring (symbol-name key) 1) value))) ++ collect (cons (intern (substring (symbol-name key) 1)) value))) + + ;; Compatibility functions for versions of emacs before emacs 23. + ;; +diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el +index 9805d79..24918d3 100644 +--- a/emacs/notmuch-mua.el ++++ b/emacs/notmuch-mua.el +@@ -185,11 +185,11 @@ OTHER-ARGS are passed through to `message-mail'." + (when notmuch-mua-user-agent-function + (let ((user-agent (funcall notmuch-mua-user-agent-function))) + (when (not (string= "" user-agent)) +- (push (cons "User-Agent" user-agent) other-headers)))) ++ (push (cons 'User-Agent user-agent) other-headers)))) + +- (unless (assoc "From" other-headers) +- (push (cons "From" (concat +- (notmuch-user-name) " <" (notmuch-user-primary-email) ">")) other-headers)) ++ (unless (assq 'From other-headers) ++ (push (cons 'From (concat ++ (notmuch-user-name) " <" (notmuch-user-primary-email) ">")) other-headers)) + + (apply #'message-mail to subject other-headers other-args) + (message-sort-headers) +@@ -250,7 +250,7 @@ the From: address first." + (interactive "P") + (let ((other-headers + (when (or prompt-for-sender notmuch-always-prompt-for-sender) +- (list (cons "From" (notmuch-mua-prompt-for-sender)))))) ++ (list (cons 'From (notmuch-mua-prompt-for-sender)))))) + (notmuch-mua-mail nil nil other-headers))) + + (defun notmuch-mua-new-forward-message (&optional prompt-for-sender) +-- +1.7.5.4 + -- 2.26.2