1 Return-Path: <alex.boterolowry@gmail.com>
\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 A7251431FC3
\r
6 for <notmuch@notmuchmail.org>; Wed, 25 Nov 2009 01:13:32 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
8 Received: from olra.theworths.org ([127.0.0.1])
\r
9 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
10 with ESMTP id d3U-6x5PJm1u for <notmuch@notmuchmail.org>;
\r
11 Wed, 25 Nov 2009 01:13:31 -0800 (PST)
\r
12 Received: from mail-yx0-f187.google.com (mail-yx0-f187.google.com
\r
14 by olra.theworths.org (Postfix) with ESMTP id 8F4DE431FBC
\r
15 for <notmuch@notmuchmail.org>; Wed, 25 Nov 2009 01:13:31 -0800 (PST)
\r
16 Received: by yxe17 with SMTP id 17so6439007yxe.33
\r
17 for <notmuch@notmuchmail.org>; Wed, 25 Nov 2009 01:13:31 -0800 (PST)
\r
18 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
\r
19 h=domainkey-signature:received:received:received:from:to:cc:subject
\r
20 :date:message-id:x-mailer:in-reply-to:references;
\r
21 bh=PyK/4N/jCy4clOP4LRELZRNPb7354wrI2nw4lGdxtMc=;
\r
22 b=xz0eRZSwVg8F4mdjZ9x0dg+a7kv3szKYgrao940qFrnC+iUwzFZge7sZtD9DiR6IcK
\r
23 3Vq//Imj1Um0FS77h4CvXW31s57hD8WGp854Y+rVxKQAp1YiUVWt4YPD5UlnhXJhnywm
\r
24 m1xDLeVrqAn76NIXeDoUpdye5qkHyWynAH/DY=
\r
25 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
\r
26 h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;
\r
27 b=NTJ7g1NWWya5tR0juAxEiDzZ28qxnOHeEy6IUU/cvam0TUr3fBw+28x1frfsnPbB4J
\r
28 /xt86tFgFNhKTN/ch81+eQnECBGv08DoDhhoRNtNbmE8bi9/IcBsss7p0S9VP+7rSGgP
\r
29 hHxj1cZDog4rCEClhhCtImlpyzrx6OiHhMlNE=
\r
30 Received: by 10.90.143.16 with SMTP id q16mr5225197agd.26.1259140411167;
\r
31 Wed, 25 Nov 2009 01:13:31 -0800 (PST)
\r
32 Received: from fortitudo (70-36-144-85.dsl.dynamic.sonic.net [70.36.144.85])
\r
33 by mx.google.com with ESMTPS id 34sm302105yxf.11.2009.11.25.01.13.30
\r
34 (version=TLSv1/SSLv3 cipher=RC4-MD5);
\r
35 Wed, 25 Nov 2009 01:13:30 -0800 (PST)
\r
36 Received: from alexbl (uid 1001) (envelope-from alexbl@fortitudo) id 710e
\r
37 by fortitudo (DragonFly Mail Agent) Wed, 25 Nov 2009 01:13:35 -0800
\r
38 From: Alexander Botero-Lowry <alex.boterolowry@gmail.com>
\r
39 To: notmuch@notmuchmail.org
\r
40 Date: Wed, 25 Nov 2009 01:13:33 -0800
\r
41 Message-Id: <1259140413-16278-2-git-send-email-alex.boterolowry@gmail.com>
\r
42 X-Mailer: git-send-email 1.6.5.2
\r
43 In-Reply-To: <1259140413-16278-1-git-send-email-alex.boterolowry@gmail.com>
\r
44 References: <1259140413-16278-1-git-send-email-alex.boterolowry@gmail.com>
\r
45 Subject: [notmuch] [PATCH 2/2] add some very rudimentary support for
\r
47 X-BeenThere: notmuch@notmuchmail.org
\r
48 X-Mailman-Version: 2.1.12
\r
50 List-Id: "Use and development of the notmuch mail system."
\r
51 <notmuch.notmuchmail.org>
\r
52 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
53 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
54 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
55 List-Post: <mailto:notmuch@notmuchmail.org>
\r
56 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
57 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
58 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
59 X-List-Received-Date: Wed, 25 Nov 2009 09:13:33 -0000
\r
61 I was planning to be committing super awesome mime-handling support
\r
62 that would make notmuch rival every mail program ever for pure mime
\r
63 awesomeness. It turns out, that mime is confusing and hard, and the
\r
64 mm-* functions do awesome things like provide different forms based
\r
65 on the number and composition of mime-parts in a document, so I set
\r
66 my first-pass goal a bit lower. What this does, is if there is an
\r
67 html mime-part in the message and it's the first part, it gets inlined
\r
68 using `mm-display-part'. This should solve the biggest problem I was
\r
69 facing, which is HTML only messages that I have to go into the awful
\r
72 This still even leaves in the Non-text part: message and all.
\r
74 notmuch.el | 41 ++++++++++++++++++++++++++++++++---------
\r
75 1 files changed, 32 insertions(+), 9 deletions(-)
\r
77 diff --git a/notmuch.el b/notmuch.el
\r
78 index 1853762..fa061c3 100644
\r
81 @@ -554,29 +554,52 @@ which this thread was originally shown."
\r
82 (goto-char end))))))
\r
85 -(defun notmuch-show-markup-part (beg end depth)
\r
86 +(defun notmuch-show-markup-part (beg end depth mime-message)
\r
87 (if (re-search-forward notmuch-show-part-begin-regexp nil t)
\r
89 + (if (eq mime-message nil)
\r
90 + (let ((filename (notmuch-show-get-filename)))
\r
92 + (insert-file-contents filename nil nil nil t)
\r
93 + (setq mime-message (mm-dissect-buffer)))))
\r
95 - (let ((beg (point-marker)))
\r
96 + (let ((part-beg (point-marker)))
\r
97 (re-search-forward notmuch-show-part-end-regexp)
\r
98 - (let ((end (copy-marker (match-beginning 0))))
\r
101 + (let ((part-end (copy-marker (match-beginning 0))))
\r
102 + (goto-char part-end)
\r
105 - (indent-rigidly beg end depth)
\r
106 - (notmuch-show-markup-citations-region beg end depth)
\r
107 + (indent-rigidly part-beg part-end depth)
\r
109 + (goto-char part-beg)
\r
110 + (forward-line -1)
\r
111 + (beginning-of-line)
\r
112 + (let ((handle-type (mm-handle-type mime-message))
\r
114 + (if (sequencep (car handle-type))
\r
115 + (setq mime-type (car handle-type))
\r
116 + (setq mime-type (car (car (cdr handle-type))))
\r
118 + (if (equal mime-type "text/html")
\r
119 + (mm-display-part mime-message))))
\r
121 + (notmuch-show-markup-citations-region part-beg part-end depth)
\r
122 ; Advance to the next part (if any) (so the outer loop can
\r
123 ; determine whether we've left the current message.
\r
124 (if (re-search-forward notmuch-show-part-begin-regexp nil t)
\r
125 (beginning-of-line)))))
\r
126 - (goto-char end)))
\r
130 (defun notmuch-show-markup-parts-region (beg end depth)
\r
133 - (while (< (point) end)
\r
134 - (notmuch-show-markup-part beg end depth))))
\r
135 + (let (mime-message)
\r
136 + (while (< (point) end)
\r
137 + (setq mime-message
\r
138 + (notmuch-show-markup-part
\r
139 + beg end depth mime-message))))))
\r
141 (defun notmuch-show-markup-body (depth btn)
\r
142 (re-search-forward notmuch-show-body-begin-regexp)
\r