1 Return-Path: <amdragon@mit.edu>
\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 CC9A0431FD7
\r
6 for <notmuch@notmuchmail.org>; Sat, 24 Jan 2015 13:17:15 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0.138 tagged_above=-999 required=5
\r
12 tests=[DNS_FROM_AHBL_RHSBL=2.438, RCVD_IN_DNSWL_MED=-2.3]
\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 yHvFVbUkkY5t for <notmuch@notmuchmail.org>;
\r
17 Sat, 24 Jan 2015 13:17:12 -0800 (PST)
\r
18 Received: from dmz-mailsec-scanner-8.mit.edu (dmz-mailsec-scanner-8.mit.edu
\r
20 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
\r
21 (No client certificate requested)
\r
22 by olra.theworths.org (Postfix) with ESMTPS id 7B416431FAE
\r
23 for <notmuch@notmuchmail.org>; Sat, 24 Jan 2015 13:17:12 -0800 (PST)
\r
24 X-AuditID: 12074425-f798e6d000000d1a-a2-54c40bd7af8d
\r
25 Received: from mailhub-auth-2.mit.edu ( [18.7.62.36])
\r
26 (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits))
\r
27 (Client did not present a certificate)
\r
28 by dmz-mailsec-scanner-8.mit.edu (Symantec Messaging Gateway) with SMTP
\r
29 id 9C.4B.03354.7DB04C45; Sat, 24 Jan 2015 16:17:11 -0500 (EST)
\r
30 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11])
\r
31 by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id t0OLH9L7000698;
\r
32 Sat, 24 Jan 2015 16:17:09 -0500
\r
33 Received: from drake (216-15-114-40.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com
\r
34 [216.15.114.40]) (authenticated bits=0)
\r
35 (User authenticated as amdragon@ATHENA.MIT.EDU)
\r
36 by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id t0OLH6L1007458
\r
37 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT);
\r
38 Sat, 24 Jan 2015 16:17:07 -0500
\r
39 Received: from amthrax by drake with local (Exim 4.84)
\r
40 (envelope-from <amdragon@mit.edu>)
\r
41 id 1YF84n-0005Rj-MN; Sat, 24 Jan 2015 16:17:05 -0500
\r
42 From: Austin Clements <amdragon@mit.edu>
\r
43 To: notmuch@notmuchmail.org
\r
44 Subject: [PATCH v2 6/8] emacs: Use generalized content caching in w3m CID code
\r
45 Date: Sat, 24 Jan 2015 16:17:01 -0500
\r
46 Message-Id: <1422134223-20739-7-git-send-email-amdragon@mit.edu>
\r
47 X-Mailer: git-send-email 2.1.3
\r
48 In-Reply-To: <1422134223-20739-1-git-send-email-amdragon@mit.edu>
\r
49 References: <1422134223-20739-1-git-send-email-amdragon@mit.edu>
\r
50 X-Brightmail-Tracker:
\r
51 H4sIAAAAAAAAA+NgFrrFIsWRmVeSWpSXmKPExsUixG6nonud+0iIwZZHGhY3WrsZLfbd2cJk
\r
52 sXouj8X1mzOZLd6snMfqwOqx6/lfJo+ds+6yexz+upDF49mqW8weWw69Zw5gjeKySUnNySxL
\r
53 LdK3S+DK2LzzBmvBVcGKt58uMTUwLuLrYuTkkBAwkTi8YDsbhC0mceHeeiCbi0NIYDGTxOn5
\r
54 O5ghnI2MEu/+N0M5F5kkHsy/yg7hTGKU+P39LCtIP5uAhsTvW4uZQGwRAWmJnXdng8WZBeok
\r
55 /s45zwhiCwv4SSzr/8QOYrMIqErcnncUrIZXwEFi+5HzQLs5gO6Qk9i6zhskzCngKHFjwy4W
\r
56 EFsIqKT7cyPbBEb+BYwMqxhlU3KrdHMTM3OKU5N1i5MT8/JSi3Qt9HIzS/RSU0o3MYKD0EV1
\r
57 B+OEQ0qHGAU4GJV4eH/8OxQixJpYVlyZe4hRkoNJSZR31a/DIUJ8SfkplRmJxRnxRaU5qcWH
\r
58 GCU4mJVEeC9sAMrxpiRWVqUW5cOkpDlYlMR5N/3gCxESSE8sSc1OTS1ILYLJynBwKEnwLuY6
\r
59 EiIkWJSanlqRlplTgpBm4uAEGc4DNPwkSA1vcUFibnFmOkT+FKOilDjvepCEAEgiozQPrheW
\r
60 JF4xigO9Isy7D6SKB5hg4LpfAQ1mAhpcsP0AyOCSRISUVAPj9sUL7m+cWNp8MWpudN2CA3cf
\r
61 P/mhe6lbc4MNq3q8/cXbdRft20uufJrpc7V6zjYN9tLPud3Cy52FPqcLMun7Htqs4Ftd1Dpz
\r
62 cvBc4+C/F722MbjZT4i3UJs4e+m/4u43RzdGF+ZNDgtpcuEWW9DULzpx8pVf8aXZuW9mX+L+
\r
63 fa93u/2iK6rsSizFGYmGWsxFxYkABjHC4O0CAAA=
\r
64 Cc: tomi.ollila@iki.fi
\r
65 X-BeenThere: notmuch@notmuchmail.org
\r
66 X-Mailman-Version: 2.1.13
\r
68 List-Id: "Use and development of the notmuch mail system."
\r
69 <notmuch.notmuchmail.org>
\r
70 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
71 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
72 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
73 List-Post: <mailto:notmuch@notmuchmail.org>
\r
74 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
75 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
76 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
77 X-List-Received-Date: Sat, 24 Jan 2015 21:17:16 -0000
\r
79 Previously this did its own caching, but this is now supported by more
\r
80 generally by `notmuch-get-bodypart-binary'.
\r
82 emacs/notmuch-show.el | 23 ++++++++---------------
\r
83 1 file changed, 8 insertions(+), 15 deletions(-)
\r
85 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
\r
86 index f29428a..11eac5f 100644
\r
87 --- a/emacs/notmuch-show.el
\r
88 +++ b/emacs/notmuch-show.el
\r
89 @@ -562,15 +562,14 @@ (defvar w3m-current-buffer) ;; From `w3m.el'.
\r
90 (defvar notmuch-show-w3m-cid-store nil)
\r
91 (make-variable-buffer-local 'notmuch-show-w3m-cid-store)
\r
93 -(defun notmuch-show-w3m-cid-store-internal (content-id msg part content)
\r
94 - (push (list content-id msg part content)
\r
95 - notmuch-show-w3m-cid-store))
\r
96 +(defun notmuch-show-w3m-cid-store-internal (content-id msg part)
\r
97 + (push (list content-id msg part) notmuch-show-w3m-cid-store))
\r
99 (defun notmuch-show-w3m-cid-store (msg part)
\r
100 (let ((content-id (plist-get part :content-id)))
\r
102 (notmuch-show-w3m-cid-store-internal (concat "cid:" content-id)
\r
106 (defun notmuch-show-w3m-cid-retrieve (url &rest args)
\r
107 (let ((matching-part (with-current-buffer w3m-current-buffer
\r
108 @@ -578,18 +577,12 @@ (defun notmuch-show-w3m-cid-retrieve (url &rest args)
\r
110 (let* ((msg (nth 1 matching-part))
\r
111 (part (nth 2 matching-part))
\r
112 - (content (nth 3 matching-part))
\r
113 (content-type (plist-get part :content-type)))
\r
114 - ;; If we don't already have the content, get it and cache
\r
115 - ;; it, as some messages reference the same cid: part many
\r
116 - ;; times (hundreds!), which results in many calls to
\r
117 - ;; `notmuch part'.
\r
119 - (setq content (notmuch-get-bodypart-binary
\r
120 - msg part notmuch-show-process-crypto))
\r
121 - (with-current-buffer w3m-current-buffer
\r
122 - (notmuch-show-w3m-cid-store-internal url msg part content)))
\r
124 + ;; Request content caching, as some messages reference the
\r
125 + ;; same cid: part many times (hundreds!), which results in
\r
126 + ;; many calls to `notmuch show'.
\r
127 + (insert (notmuch-get-bodypart-binary
\r
128 + msg part notmuch-show-process-crypto 'cache))
\r