Hi all
[notmuch-archives.git] / 1c / af9c035898e5987873f3ee9356bc8f4b86b622
1 Return-Path: <cworth@cworth.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 B62EA431FC3\r
6         for <notmuch@notmuchmail.org>; Wed, 10 Feb 2010 12:54:54 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -2.28\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-2.28 tagged_above=-999 required=5\r
12         tests=[ALL_TRUSTED=-1.8, AWL=0.260, BAYES_20=-0.74] autolearn=ham\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 5n56h39awRyC; Wed, 10 Feb 2010 12:54:53 -0800 (PST)\r
16 Received: from yoom.home.cworth.org (localhost [127.0.0.1])\r
17         by olra.theworths.org (Postfix) with ESMTP id A6FA4431FC0;\r
18         Wed, 10 Feb 2010 12:54:53 -0800 (PST)\r
19 Received: by yoom.home.cworth.org (Postfix, from userid 1000)\r
20         id 629FF55011E; Wed, 10 Feb 2010 12:54:53 -0800 (PST)\r
21 From: Carl Worth <cworth@cworth.org>\r
22 To: notmuch@notmuchmail.org\r
23 In-Reply-To: <87vde4derz.fsf@yoom.home.cworth.org>\r
24 References: <87vde4derz.fsf@yoom.home.cworth.org>\r
25 Date: Wed, 10 Feb 2010 12:54:52 -0800\r
26 Message-ID: <877hqk4xr7.fsf@yoom.home.cworth.org>\r
27 MIME-Version: 1.0\r
28 Content-Type: multipart/mixed; boundary="=-=-="\r
29 Subject: Re: [notmuch] emacs: On getting support for inline images\r
30 X-BeenThere: notmuch@notmuchmail.org\r
31 X-Mailman-Version: 2.1.13\r
32 Precedence: list\r
33 List-Id: "Use and development of the notmuch mail system."\r
34         <notmuch.notmuchmail.org>\r
35 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
36         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
37 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
38 List-Post: <mailto:notmuch@notmuchmail.org>\r
39 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
40 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
41         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
42 X-List-Received-Date: Wed, 10 Feb 2010 20:54:54 -0000\r
43 \r
44 --=-=-=\r
45 Content-Type: multipart/signed; boundary="==-=-=";\r
46         micalg=pgp-sha1; protocol="application/pgp-signature"\r
47 \r
48 --==-=-=\r
49 Content-Transfer-Encoding: quoted-printable\r
50 \r
51 On Wed, 10 Feb 2010 12:20:00 -0800, Carl Worth <cworth@cworth.org> wrote:\r
52 > Here are some ideas for possible (and independent) fixes:\r
53 >=20\r
54 > 1. With the current setup, we know we are using a temporary buffer that\r
55 >    the user won't see, so notmuch could temporarily set\r
56 >    mm-inline-media-tests to nil forcing everything to use external\r
57 >    viewers when the user presses 'v'.\r
58 \r
59 Below is a patch to implement this piece.\r
60 \r
61 It seems to do the trick so that I can now actually view image\r
62 attachments with 'v' (hurrah!). So I think I'll push this now.\r
63 \r
64 =2DCarl\r
65 \r
66 PS. I know that attaching the output of "git format-patch" to a message\r
67 like this isn't the "git way". (That is, you won't get the right result\r
68 by simply piping this message to "git am".) But I really wish it\r
69 were. It seems I often write code in response to an email message and I\r
70 often want to reply to that *message* and incidentally provide a\r
71 patch. The git way, with the commit message in the subject and the first\r
72 part of the body seems backwards to me, (as far as the conversation is\r
73 concerned).\r
74 \r
75 PPS. If I did want to construct this message in the "git way", but\r
76 without using git-send-mail, I know how to construct the subject line\r
77 and how to put explanatory text like this below the separator. But what\r
78 am I supposed to do with the commit identifier that appears in an mbox\r
79 "From" line in the format-patch output? I assume this is required for\r
80 "git am -3" to work, but where can I put it in an email message?\r
81 \r
82 \r
83 --==-=-=\r
84 Content-Type: application/pgp-signature\r
85 \r
86 -----BEGIN PGP SIGNATURE-----\r
87 Version: GnuPG v1.4.10 (GNU/Linux)\r
88 \r
89 iD8DBQFLcx0d6JDdNq8qSWgRAqw0AKCoiN1oM2xYTeEu0w2VWcjbSgInowCePZIH\r
90 dDueQLRSv0PJCdcfYYWBDjg=\r
91 =I92K\r
92 -----END PGP SIGNATURE-----\r
93 --==-=-=--\r
94 \r
95 --=-=-=\r
96 Content-Type: text/x-diff\r
97 Content-Disposition: inline;\r
98  filename=0001-notmuch.el-Handle-attached-images-via-an-external-vi.patch\r
99 \r
100 >From 2174adf374370135061bd80db21cbd43bbac95ab Mon Sep 17 00:00:00 2001\r
101 From: Carl Worth <cworth@cworth.org>\r
102 Date: Wed, 10 Feb 2010 12:40:47 -0800\r
103 Subject: [PATCH] notmuch.el: Handle attached images via an external viewer.\r
104 \r
105 We temporarily override the mm-inline-media-tests variable so that the\r
106 only parts inserted into the temporary buffer (and lost) are those\r
107 parts that the user has already seen in the notmuch-show buffer.\r
108 \r
109 Anything else, (such as images), will now be left to be handled via\r
110 mailcap, just like other attachment types.\r
111 ---\r
112  notmuch.el |   17 ++++++++++++++++-\r
113  1 files changed, 16 insertions(+), 1 deletions(-)\r
114 \r
115 diff --git a/notmuch.el b/notmuch.el\r
116 index b909567..040997e 100644\r
117 --- a/notmuch.el\r
118 +++ b/notmuch.el\r
119 @@ -327,7 +327,22 @@ buffer."\r
120    "Use external viewers to view all attachments from the current message."\r
121    (interactive)\r
122    (with-current-notmuch-show-message\r
123 -   (mm-display-parts (mm-dissect-buffer))))\r
124 +   ; We ovverride the mm-inline-media-tests to indicate which message\r
125 +   ; parts are already sufficiently handled by the original\r
126 +   ; presentation of the message in notmuch-show mode. These parts\r
127 +   ; will be inserted directly into the temporary buffer of\r
128 +   ; with-current-notmuch-show-message and silently discarded.\r
129 +   ;\r
130 +   ; Any MIME part not explicitly mentioned here will be handled by an\r
131 +   ; external viewer as configured in the various mailcap files.\r
132 +   (let ((mm-inline-media-tests '(\r
133 +                                 ("text/.*" ignore identity)\r
134 +                                 ("application/pgp-signature" ignore identity)\r
135 +                                 ("multipart/alternative" ignore identity)\r
136 +                                 ("multipart/mixed" ignore identity)\r
137 +                                 ("multipart/related" ignore identity)\r
138 +                                )))\r
139 +     (mm-display-parts (mm-dissect-buffer)))))\r
140  \r
141  (defun notmuch-foreach-mime-part (function mm-handle)\r
142    (cond ((stringp (car mm-handle))\r
143 -- \r
144 1.6.5.7\r
145 \r
146 \r
147 --=-=-=--\r