Re: [PATCH] Fix typo in Message.maildir_flags_to_tags
[notmuch-archives.git] / 30 / 9f5e1c16e8a11456d78ed9b0da4a772d29c0d2
1 Return-Path: <dme@dme.org>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id F2448431FC0\r
6         for <notmuch@notmuchmail.org>; Wed,  7 May 2014 23:24:40 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id 773RKFVxfXuw for <notmuch@notmuchmail.org>;\r
16         Wed,  7 May 2014 23:24:36 -0700 (PDT)\r
17 Received: from mail-wg0-f47.google.com (mail-wg0-f47.google.com\r
18  [74.125.82.47])        (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
19  certificate requested) by olra.theworths.org (Postfix) with ESMTPS id\r
20  65010431FAE    for <notmuch@notmuchmail.org>; Wed,  7 May 2014 23:24:36 -0700\r
21  (PDT)\r
22 Received: by mail-wg0-f47.google.com with SMTP id x12so1987326wgg.18\r
23         for <notmuch@notmuchmail.org>; Wed, 07 May 2014 23:24:35 -0700 (PDT)\r
24 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
25         d=1e100.net; s=20130820;\r
26         h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to\r
27         :references;\r
28         bh=k7lGn+r3PVEj5mpRiYdGS0/uH6KAbWHS3chP1tmr6Vw=;\r
29         b=ZpGMObJi4B2ab1PvfPI8YuvlUIJK8dR7BXhYqzMIUTAVIRbRCjJ/aRiOxSkSwYw/7y\r
30         1ZzYt16K610Ehil5pFOhmmY3DrRl5WBC8qRIQUDgAm5gnRRnO/J0H00/I7nImsQUeF+e\r
31         XohEpw0sZcmxQcd1Cuz5rNHJyGViM1JB2ilgAA+RorJSGzZdXoE3lY+qY/p6XJnrxpGC\r
32         1F+2LErtGClZ/aQJWyuIT3cPoYvGd6YVfH788M5SxYCu2eTfVwGDLARWfcCzka5LpfhW\r
33         xx1C05jaJV3hwyC/1XNw8sLWMJxDnOAKEUpJnXGL7s+lU+tWiqlUwa++T8FtDAvZ20Xb\r
34         rTjQ==\r
35 X-Gm-Message-State:\r
36  ALoCoQmDM86JGEyzOI4Nzn4YNDyPfqyLe9Np4jSp6gRy9JTtY0Wb1MNwVwkj2B061oezOsLcRsU4\r
37 X-Received: by 10.195.13.76 with SMTP id ew12mr85977wjd.80.1399530275143;\r
38         Wed, 07 May 2014 23:24:35 -0700 (PDT)\r
39 Received: from hotblack-desiato.hh.sledj.net (disaster-area.hh.sledj.net.\r
40         [81.149.164.25]) by mx.google.com with ESMTPSA id\r
41         fu10sm2703269wib.11.2014.05.07.23.24.33 for <notmuch@notmuchmail.org>\r
42         (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
43         Wed, 07 May 2014 23:24:34 -0700 (PDT)\r
44 Received: by hotblack-desiato.hh.sledj.net (Postfix, from userid 30000)\r
45         id BBD22108B19; Thu,  8 May 2014 07:24:32 +0100 (BST)\r
46 From: David Edmondson <dme@dme.org>\r
47 To: notmuch@notmuchmail.org\r
48 Subject: [PATCH v2] emacs/notmuch-mua: Generate improved cited text for\r
49  replies\r
50 Date: Thu,  8 May 2014 07:24:32 +0100\r
51 Message-Id: <1399530272-11857-2-git-send-email-dme@dme.org>\r
52 X-Mailer: git-send-email 2.0.0.rc0\r
53 In-Reply-To: <1399530272-11857-1-git-send-email-dme@dme.org>\r
54 References: <1399482846-25308-1-git-send-email-dme@dme.org>\r
55         <1399530272-11857-1-git-send-email-dme@dme.org>\r
56 X-BeenThere: notmuch@notmuchmail.org\r
57 X-Mailman-Version: 2.1.13\r
58 Precedence: list\r
59 List-Id: "Use and development of the notmuch mail system."\r
60         <notmuch.notmuchmail.org>\r
61 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
62         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
63 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
64 List-Post: <mailto:notmuch@notmuchmail.org>\r
65 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
66 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
67         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
68 X-List-Received-Date: Thu, 08 May 2014 06:24:41 -0000\r
69 \r
70 Use the message display code to generate message text to cite in\r
71 replies.\r
72 ---\r
73  emacs/notmuch-mua.el | 38 ++++++++------------------------------\r
74  1 file changed, 8 insertions(+), 30 deletions(-)\r
75 \r
76 diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el\r
77 index 95e4a4d..09c922f 100644\r
78 --- a/emacs/notmuch-mua.el\r
79 +++ b/emacs/notmuch-mua.el\r
80 @@ -28,7 +28,7 @@\r
81  \r
82  (eval-when-compile (require 'cl))\r
83  \r
84 -(declare-function notmuch-show-insert-bodypart "notmuch-show" (msg part depth &optional hide))\r
85 +(declare-function notmuch-show-insert-body "notmuch-show" (msg body depth))\r
86  \r
87  ;;\r
88  \r
89 @@ -123,31 +123,6 @@ list."\r
90         else if (notmuch-match-content-type (plist-get part :content-type) "multipart/*")\r
91           do (notmuch-mua-reply-crypto (plist-get part :content))))\r
92  \r
93 -(defun notmuch-mua-get-quotable-parts (parts)\r
94 -  (loop for part in parts\r
95 -       if (notmuch-match-content-type (plist-get part :content-type) "multipart/alternative")\r
96 -         collect (let* ((subparts (plist-get part :content))\r
97 -                       (types (mapcar (lambda (part) (plist-get part :content-type)) subparts))\r
98 -                       (chosen-type (car (notmuch-multipart/alternative-choose types))))\r
99 -                  (loop for part in (reverse subparts)\r
100 -                        if (notmuch-match-content-type (plist-get part :content-type) chosen-type)\r
101 -                        return part))\r
102 -       else if (notmuch-match-content-type (plist-get part :content-type) "multipart/*")\r
103 -         append (notmuch-mua-get-quotable-parts (plist-get part :content))\r
104 -       else if (notmuch-match-content-type (plist-get part :content-type) "text/*")\r
105 -         collect part))\r
106 -\r
107 -(defun notmuch-mua-insert-quotable-part (message part)\r
108 -  ;; We don't want text properties leaking from the show renderer into\r
109 -  ;; the reply so we use a temp buffer. Also we don't want hooks, such\r
110 -  ;; as notmuch-wash-*, to be run on the quotable part so we set\r
111 -  ;; notmuch-show-insert-text/plain-hook to nil.\r
112 -  (insert (with-temp-buffer\r
113 -           (let ((notmuch-show-insert-text/plain-hook nil))\r
114 -             ;; Show the part but do not add buttons.\r
115 -             (notmuch-show-insert-bodypart message part 0 'no-buttons))\r
116 -           (buffer-substring-no-properties (point-min) (point-max)))))\r
117 -\r
118  ;; There is a bug in emacs 23's message.el that results in a newline\r
119  ;; not being inserted after the References header, so the next header\r
120  ;; is concatenated to the end of it. This function fixes the problem,\r
121 @@ -225,10 +200,13 @@ list."\r
122         (insert "From: " from "\n")\r
123         (insert "Date: " date "\n\n")\r
124  \r
125 -       ;; Get the parts of the original message that should be quoted; this includes\r
126 -       ;; all the text parts, except the non-preferred ones in a multipart/alternative.\r
127 -       (let ((quotable-parts (notmuch-mua-get-quotable-parts (plist-get original :body))))\r
128 -         (mapc (apply-partially 'notmuch-mua-insert-quotable-part original) quotable-parts))\r
129 +       (insert (with-temp-buffer\r
130 +                 ;; Don't attempt to clean up messages, excerpt\r
131 +                 ;; citations, etc. in the original message before\r
132 +                 ;; quoting.\r
133 +                 (let ((notmuch-show-insert-text/plain-hook nil))\r
134 +                   (notmuch-show-insert-body original (plist-get original :body) 0)\r
135 +                   (buffer-substring-no-properties (point-min) (point-max)))))\r
136  \r
137         (set-mark (point))\r
138         (goto-char start)\r
139 -- \r
140 2.0.0.rc0\r
141 \r