Re: Avoiding the "huge INBOX of death"
[notmuch-archives.git] / 4b / 45d15e6a9ba28947e28adfffd2f638f9f7d199
1 Return-Path: <chrismgray@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 1A7C8431FD0\r
6         for <notmuch@notmuchmail.org>; Mon, 19 Dec 2011 22:38:58 -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: -0.799\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] 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 TOQ1LScJLhmG for <notmuch@notmuchmail.org>;\r
17         Mon, 19 Dec 2011 22:38:57 -0800 (PST)\r
18 Received: from mail-yx0-f181.google.com (mail-yx0-f181.google.com\r
19         [209.85.213.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id 7239D431FB6\r
22         for <notmuch@notmuchmail.org>; Mon, 19 Dec 2011 22:38:57 -0800 (PST)\r
23 Received: by yenm3 with SMTP id m3so5013203yen.26\r
24         for <notmuch@notmuchmail.org>; Mon, 19 Dec 2011 22:38:55 -0800 (PST)\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
26         h=from:to:subject:in-reply-to:references:user-agent:date:message-id\r
27         :mime-version:content-type;\r
28         bh=N6Na5KuFtHKt/pzJBS0DV8yRHUe+wJkuleZByB0V/vw=;\r
29         b=dynstkZOuD7CebnuiF1qDO3naZdgiweXHohS82+iVu5n11sNvmE6DE7nLSA70wn3PP\r
30         h4y2L3+aomkKj+u8qtKm9CKUwT4iUjbqu2rM1g4VcTIC5RAsio4f1r39NYVvgUZ/D+Md\r
31         XID+pr2pErn3isbsGParNRV6U6oowwN8dvYAE=\r
32 Received: by 10.236.197.42 with SMTP id s30mr1156160yhn.8.1324363135905;\r
33         Mon, 19 Dec 2011 22:38:55 -0800 (PST)\r
34 Received: from driftwood (S0106001f333bc36d.cg.shawcable.net. [68.144.78.164])\r
35         by mx.google.com with ESMTPS id\r
36         r68sm1490228yhm.18.2011.12.19.22.38.53\r
37         (version=TLSv1/SSLv3 cipher=OTHER);\r
38         Mon, 19 Dec 2011 22:38:54 -0800 (PST)\r
39 From: Chris Gray <chrismgray@gmail.com>\r
40 To: David Edmondson <dme@dme.org>, notmuch@notmuchmail.org\r
41 Subject: Re: [RFC][PATCH] emacs: Provide scaffolding so that the new `shr'\r
42         HTML renderer can run.\r
43 In-Reply-To: <1324309559-7993-1-git-send-email-dme@dme.org>\r
44 References: <1324309559-7993-1-git-send-email-dme@dme.org>\r
45 User-Agent: Notmuch/0.10.2+95~g2eb2694 (http://notmuchmail.org)\r
46         Emacs/24.0.92.1 (i486-pc-linux-gnu)\r
47 Date: Mon, 19 Dec 2011 23:38:36 -0700\r
48 Message-ID: <8762hbkas3.fsf@gmail.com>\r
49 MIME-Version: 1.0\r
50 Content-Type: text/plain\r
51 X-BeenThere: notmuch@notmuchmail.org\r
52 X-Mailman-Version: 2.1.13\r
53 Precedence: list\r
54 List-Id: "Use and development of the notmuch mail system."\r
55         <notmuch.notmuchmail.org>\r
56 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
57         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
58 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
59 List-Post: <mailto:notmuch@notmuchmail.org>\r
60 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
61 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
62         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
63 X-List-Received-Date: Tue, 20 Dec 2011 06:38:58 -0000\r
64 \r
65 On Mon, 19 Dec 2011 15:45:59 +0000, David Edmondson <dme@dme.org> wrote:\r
66 > Latest gnus provides a new HTML renderer entirely in lisp. It requires\r
67 > some minor but ugly scaffolding to allow use with notmuch.\r
68 > ---\r
69\r
70 > This is pretty horrible, but works in the cases that I tested. It\r
71 > would be useful if a few other people could test. Note that `cid:'\r
72 > images included with a text/html part are not inserted in the correct\r
73 > place, but that also appears to be the case for gnus.\r
74\r
75 > This should be tagged `notmuch::wip' in the new world order!\r
76\r
77 >  emacs/notmuch-show.el |   14 +++++++++++++-\r
78 >  1 files changed, 13 insertions(+), 1 deletions(-)\r
79\r
80 > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
81 > index 63b01e5..f52f233 100644\r
82 > --- a/emacs/notmuch-show.el\r
83 > +++ b/emacs/notmuch-show.el\r
84 > @@ -320,6 +320,13 @@ message at DEPTH in the current thread."\r
85 >       ;; ange-ftp, which is reasonable to use here.\r
86 >       (mm-write-region (point-min) (point-max) file nil nil nil 'no-conversion t)))))\r
87 >  \r
88 > +;; Nonsense required to have the new gnus `shr' HTML display code\r
89 > +;; work.\r
90 > +(defvar gnus-summary-buffer)\r
91 > +(defvar gnus-inhibit-images)\r
92 \r
93 I believe that gnus-inhibit-images is defined in gnus-art.el.  Perhaps\r
94 that file should just be require'd rather than having this workaround.\r
95 \r
96 > +(if (not (fboundp 'gnus-blocked-images))\r
97 > +    (defun gnus-blocked-images () nil))\r
98 > +\r
99 >  (defun notmuch-show-mm-display-part-inline (msg part nth content-type)\r
100 >    "Use the mm-decode/mm-view functions to display a part in the\r
101 >  current buffer, if possible."\r
102 > @@ -331,7 +338,12 @@ current buffer, if possible."\r
103 >           (let ((content (notmuch-show-get-bodypart-content msg part nth)))\r
104 >             (insert content)\r
105 >             (set-buffer display-buffer)\r
106 > -           (mm-display-part handle)\r
107 > +\r
108 > +           ;; Nonsense required to have the new gnus `shr' HTML\r
109 > +           ;; display code work.\r
110 > +           (let ((gnus-inhibit-images nil))\r
111 > +             (makunbound 'gnus-summary-buffer) ; Blech.\r
112 \r
113 This is working around a bug in gnus.  I think the better solution would\r
114 be for gnus to fix the bug.  The following patch against gnus works for\r
115 me.  (I have tried submitting it to the gnus bug list, but have not been\r
116 able to check if it got through.)\r
117 \r
118 Cheers,\r
119 Chris\r
120 \r
121 commit 45e5a06ea63d8d9f9a962db7d739c7d7056ef712 (HEAD, refs/heads/master)\r
122 Author: Chris Gray <chrismgray@gmail.com>\r
123 Date:   Mon Dec 19 23:33:30 2011 -0700\r
124 \r
125     mm-decode.el (mm-shr): Added check to bufferp for gnus-summary-buffer\r
126     \r
127     If gnus-summary-buffer is a string, then (buffer-name\r
128     gnus-summary-buffer) gives an error.\r
129 \r
130         Modified lisp/mm-decode.el\r
131 diff --git a/lisp/mm-decode.el b/lisp/mm-decode.el\r
132 index 44e2af5..7005dd7 100644\r
133 --- a/lisp/mm-decode.el\r
134 +++ b/lisp/mm-decode.el\r
135 @@ -1724,6 +1724,7 @@ If RECURSIVE, search recursively."\r
136                                       (buffer-string))))))\r
137         shr-inhibit-images shr-blocked-images charset char)\r
138      (if (and (boundp 'gnus-summary-buffer)\r
139 +            (bufferp gnus-summary-buffer)\r
140              (buffer-name gnus-summary-buffer))\r
141         (with-current-buffer gnus-summary-buffer\r
142           (setq shr-inhibit-images gnus-inhibit-images\r
143 \r
144 \r