From: Austin Clements Date: Thu, 29 Mar 2012 05:38:33 +0000 (+2000) Subject: Re: [BUG/PATCH] emacs: Fix header problem in reply for emacs 23.2 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=dbf03e25e90a110b4e879470c898e278f014895b;p=notmuch-archives.git Re: [BUG/PATCH] emacs: Fix header problem in reply for emacs 23.2 --- diff --git a/ba/ef8394c91eeca9e7e27627aca93437781a494b b/ba/ef8394c91eeca9e7e27627aca93437781a494b new file mode 100644 index 000000000..bfeeec0b0 --- /dev/null +++ b/ba/ef8394c91eeca9e7e27627aca93437781a494b @@ -0,0 +1,145 @@ +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 3566F431FAF + for ; Wed, 28 Mar 2012 22:38:37 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.7 +X-Spam-Level: +X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 v1SF4vpxgLv0 for ; + Wed, 28 Mar 2012 22:38:36 -0700 (PDT) +Received: from dmz-mailsec-scanner-3.mit.edu (DMZ-MAILSEC-SCANNER-3.MIT.EDU + [18.9.25.14]) + by olra.theworths.org (Postfix) with ESMTP id 9880E431FAE + for ; Wed, 28 Mar 2012 22:38:36 -0700 (PDT) +X-AuditID: 1209190e-b7f7c6d0000008c3-0d-4f73f55ca4ab +Received: from mailhub-auth-2.mit.edu ( [18.7.62.36]) + by dmz-mailsec-scanner-3.mit.edu (Symantec Messaging Gateway) with SMTP + id A4.90.02243.C55F37F4; Thu, 29 Mar 2012 01:38:36 -0400 (EDT) +Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) + by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id q2T5cZcj029887; + Thu, 29 Mar 2012 01:38:35 -0400 +Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91]) + (authenticated bits=0) + (User authenticated as amdragon@ATHENA.MIT.EDU) + by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q2T5cYEX010353 + (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); + Thu, 29 Mar 2012 01:38:34 -0400 (EDT) +Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77) + (envelope-from ) + id 1SD84A-0006qX-0U; Thu, 29 Mar 2012 01:38:34 -0400 +Date: Thu, 29 Mar 2012 01:38:33 -0400 +From: Austin Clements +To: Adam Wolfe Gordon +Subject: Re: [BUG/PATCH] emacs: Fix header problem in reply for emacs 23.2 +Message-ID: <20120329053833.GB2670@mit.edu> +References: <87obrh3ufi.fsf@nikula.org> + <1332943338-9708-1-git-send-email-awg+notmuch@xvx.ca> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <1332943338-9708-1-git-send-email-awg+notmuch@xvx.ca> +User-Agent: Mutt/1.5.21 (2010-09-15) +X-Brightmail-Tracker: + H4sIAAAAAAAAA+NgFuplleLIzCtJLcpLzFFi42IRYrdT0Y35WuxvcPy4kMWRPbPYLZqmO1tc + vzmT2YHZ49b91+wez1bdYvZo+rGYNYA5issmJTUnsyy1SN8ugSvj0cdt7AWvxSueP93I0sC4 + QriLkZNDQsBE4vbtZhYIW0ziwr31bF2MXBxCAvsYJZ6c28EO4WxglJj+eCczhHOSSWLe8mtQ + ZUsYJR73X2AG6WcRUJU4tXEVK4jNJqAhsW3/ckYQW0RAS+LH+q9gcWYBHYnXh9+D7RMW8JJ4 + +Os8WA2vgLbE3R9X2UFsIYF4iTUbF7BDxAUlTs58wgLRqyVx499Lpi5GDiBbWmL5Pw6QMKeA + k8TNDfPAxogKqEhMObmNbQKj0Cwk3bOQdM9C6F7AyLyKUTYlt0o3NzEzpzg1Wbc4OTEvL7VI + 11gvN7NELzWldBMjKNQ5Jfl2MH49qHSIUYCDUYmHV0mn2F+INbGsuDL3EKMkB5OSKG/jF6AQ + X1J+SmVGYnFGfFFpTmrxIUYJDmYlEV73c0A53pTEyqrUonyYlDQHi5I4r5rWOz8hgfTEktTs + 1NSC1CKYrAwHh5IErwfIUMGi1PTUirTMnBKENBMHJ8hwHqDhE0FqeIsLEnOLM9Mh8qcYFaXE + edNAEgIgiYzSPLheWCp6xSgO9Iowbx5IFQ8wjcF1vwIazAQ0eMmRfJDBJYkIKakGRrulOx5V + Rz6qqRRsUX9fd/On0ZsdO3MXTje3V5z2xWqFlxHTrcyV+n9+vtd1XiKxwnDr1fsl5y6rbQ+/ + GLeo37+1szE8ZZW6c9Ee89N/8/4/s7y+8atICmNR/3rVl284jk64umTm03XvpzNve/pk7do5 + aquSnygfub342e626KaUjRO6pWepTHmixFKckWioxVxUnAgATZFUGCADAAA= +Cc: notmuch@notmuchmail.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: Thu, 29 Mar 2012 05:38:37 -0000 + +Quoth Adam Wolfe Gordon on Mar 28 at 8:02 am: +> 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) + +This name isn't really appropriate now. +notmuch-plist-to-headers-list? notmuch-headers-plist-to-alist? + +Otherwise LGTM, though I don't run such ancient versions of Emacs, so +I can't verify that it fixes the problem. + +> (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)