Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 01 / 88500ddd013fff1e93de9a3c8fc078c5ae72ea
1 Return-Path: <jrollins@servo.finestructure.net>\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 B1D14429E2D\r
6         for <notmuch@notmuchmail.org>; Sun,  5 Jun 2011 17:29:39 -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: -1.921\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-1.921 tagged_above=-999 required=5\r
12         tests=[NO_DNS_FOR_FROM=0.379, RCVD_IN_DNSWL_MED=-2.3]\r
13         autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id FnWd37KUdLrQ for <notmuch@notmuchmail.org>;\r
17         Sun,  5 Jun 2011 17:29:37 -0700 (PDT)\r
18 Received: from outgoing-mail.its.caltech.edu (outgoing-mail.its.caltech.edu\r
19         [131.215.239.19])\r
20         by olra.theworths.org (Postfix) with ESMTP id A450F431FB6\r
21         for <notmuch@notmuchmail.org>; Sun,  5 Jun 2011 17:29:37 -0700 (PDT)\r
22 Received: from earth-doxen.imss.caltech.edu (localhost [127.0.0.1])\r
23         by earth-doxen-postvirus (Postfix) with ESMTP id B394E66E02A6;\r
24         Sun,  5 Jun 2011 17:29:35 -0700 (PDT)\r
25 X-Spam-Scanned: at Caltech-IMSS on earth-doxen by amavisd-new\r
26 Received: from servo.finestructure.net (cpe-98-149-172-122.socal.res.rr.com\r
27         [98.149.172.122]) (Authenticated sender: jrollins)\r
28         by earth-doxen-submit (Postfix) with ESMTP id 73D3166E02D4;\r
29         Sun,  5 Jun 2011 17:29:32 -0700 (PDT)\r
30 Received: by servo.finestructure.net (Postfix, from userid 1000)\r
31         id 2592BB52; Sun,  5 Jun 2011 17:29:31 -0700 (PDT)\r
32 From: Jameson Graef Rollins <jrollins@finestructure.net>\r
33 To: Notmuch Mail <notmuch@notmuchmail.org>\r
34 Subject: [PATCH 5/5] emacs: Improve support for message/rfc822 parts.\r
35 Date: Sun,  5 Jun 2011 17:29:29 -0700\r
36 Message-Id: <1307320169-29905-6-git-send-email-jrollins@finestructure.net>\r
37 X-Mailer: git-send-email 1.7.4.4\r
38 In-Reply-To: <1307320169-29905-5-git-send-email-jrollins@finestructure.net>\r
39 References: <87sjrsi2b4.fsf@servo.factory.finestructure.net>\r
40         <1307320169-29905-1-git-send-email-jrollins@finestructure.net>\r
41         <1307320169-29905-2-git-send-email-jrollins@finestructure.net>\r
42         <1307320169-29905-3-git-send-email-jrollins@finestructure.net>\r
43         <1307320169-29905-4-git-send-email-jrollins@finestructure.net>\r
44         <1307320169-29905-5-git-send-email-jrollins@finestructure.net>\r
45 X-BeenThere: notmuch@notmuchmail.org\r
46 X-Mailman-Version: 2.1.13\r
47 Precedence: list\r
48 List-Id: "Use and development of the notmuch mail system."\r
49         <notmuch.notmuchmail.org>\r
50 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
51         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
52 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
53 List-Post: <mailto:notmuch@notmuchmail.org>\r
54 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
55 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
56         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
57 X-List-Received-Date: Mon, 06 Jun 2011 00:29:39 -0000\r
58 \r
59 The insert-part-message/rfc822 function is overhauled to properly\r
60 processes the new formatting of message/rfc822 parts.  The json output\r
61 for message parts now includes "headers" and "body" fields, which are\r
62 now parsed and output appropriately.\r
63 ---\r
64  emacs/notmuch-show.el |   21 +++++++++++++--------\r
65  1 files changed, 13 insertions(+), 8 deletions(-)\r
66 \r
67 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
68 index 7d848e3..0f1fe69 100644\r
69 --- a/emacs/notmuch-show.el\r
70 +++ b/emacs/notmuch-show.el\r
71 @@ -519,21 +519,26 @@ current buffer, if possible."\r
72    t)\r
73  \r
74  (defun notmuch-show-insert-part-message/rfc822 (msg part content-type nth depth declared-type)\r
75 -  (let* ((message-part (plist-get part :content))\r
76 -        (inner-parts (plist-get message-part :content)))\r
77 -    (notmuch-show-insert-part-header nth declared-type content-type nil)\r
78 +  (notmuch-show-insert-part-header nth declared-type content-type nil)\r
79 +  (let* ((message (car (plist-get part :content)))\r
80 +        (headers (plist-get message :headers))\r
81 +        (body (car (plist-get message :body)))\r
82 +        (start (point)))\r
83 +\r
84      ;; Override `notmuch-message-headers' to force `From' to be\r
85      ;; displayed.\r
86      (let ((notmuch-message-headers '("From" "Subject" "To" "Cc" "Date")))\r
87 -      (notmuch-show-insert-headers (plist-get part :headers)))\r
88 +      (notmuch-show-insert-headers (plist-get message :headers)))\r
89 +\r
90      ;; Blank line after headers to be compatible with the normal\r
91      ;; message display.\r
92      (insert "\n")\r
93  \r
94 -    ;; Show all of the parts.\r
95 -    (mapc (lambda (inner-part)\r
96 -           (notmuch-show-insert-bodypart msg inner-part depth))\r
97 -         inner-parts))\r
98 +    ;; Show the body\r
99 +    (notmuch-show-insert-bodypart msg body depth)\r
100 +\r
101 +    (when notmuch-show-indent-multipart\r
102 +      (indent-rigidly start (point) 1)))\r
103    t)\r
104  \r
105  (defun notmuch-show-insert-part-text/plain (msg part content-type nth depth declared-type)\r
106 -- \r
107 1.7.4.4\r
108 \r