[PATCH] configure: add --without-api-docs option
[notmuch-archives.git] / 51 / 79fcdcf6d4ea4e926b4a25ae70a617a4cbc974
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
13         [209.85.210.187])\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
46         handling html parts\r
47 X-BeenThere: notmuch@notmuchmail.org\r
48 X-Mailman-Version: 2.1.12\r
49 Precedence: list\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
60 \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
70 mime-mode to view.\r
71 \r
72 This still even leaves in the Non-text part: message and all.\r
73 ---\r
74  notmuch.el |   41 ++++++++++++++++++++++++++++++++---------\r
75  1 files changed, 32 insertions(+), 9 deletions(-)\r
76 \r
77 diff --git a/notmuch.el b/notmuch.el\r
78 index 1853762..fa061c3 100644\r
79 --- a/notmuch.el\r
80 +++ b/notmuch.el\r
81 @@ -554,29 +554,52 @@ which this thread was originally shown."\r
82                      (goto-char end))))))\r
83        (forward-line))))\r
84  \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
88        (progn\r
89 +        (if (eq mime-message nil)\r
90 +            (let ((filename (notmuch-show-get-filename)))\r
91 +              (with-temp-buffer\r
92 +                (insert-file-contents filename nil nil nil t)\r
93 +                (setq mime-message (mm-dissect-buffer)))))\r
94         (forward-line)\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
99 -           (goto-char end)\r
100 +\r
101 +         (let ((part-end (copy-marker (match-beginning 0))))\r
102 +           (goto-char part-end)\r
103             (if (not (bolp))\r
104                 (insert "\n"))\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
108 +            (save-excursion\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
113 +                    mime-type)\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
117 +                  )\r
118 +                (if (equal mime-type "text/html")\r
119 +                    (mm-display-part mime-message))))\r
120 +\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
127 +    (goto-char end))\r
128 +  mime-message)\r
129  \r
130  (defun notmuch-show-markup-parts-region (beg end depth)\r
131    (save-excursion\r
132      (goto-char beg)\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
140  \r
141  (defun notmuch-show-markup-body (depth btn)\r
142    (re-search-forward notmuch-show-body-begin-regexp)\r
143 -- \r
144 1.6.5.2\r
145 \r