Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 5a / ba2e9f76ee45a113f8bbadac4901550511f229
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 8085A431FBC\r
6         for <notmuch@notmuchmail.org>; Mon, 21 Apr 2014 11:38:10 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\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 n0SWJZZ-L3Lz for <notmuch@notmuchmail.org>;\r
16         Mon, 21 Apr 2014 11:38:05 -0700 (PDT)\r
17 Received: from dmz-mailsec-scanner-3.mit.edu (dmz-mailsec-scanner-3.mit.edu\r
18         [18.9.25.14])\r
19         (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id 51E9D431FC0\r
22         for <notmuch@notmuchmail.org>; Mon, 21 Apr 2014 11:37:59 -0700 (PDT)\r
23 X-AuditID: 1209190e-f79ee6d000000c40-95-53556586fb18\r
24 Received: from mailhub-auth-3.mit.edu ( [18.9.21.43])\r
25         (using TLS with cipher AES256-SHA (256/256 bits))\r
26         (Client did not present a certificate)\r
27         by dmz-mailsec-scanner-3.mit.edu (Symantec Messaging Gateway) with SMTP\r
28         id A1.75.03136.68565535; Mon, 21 Apr 2014 14:37:58 -0400 (EDT)\r
29 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11])\r
30         by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id s3LIbuwm018332; \r
31         Mon, 21 Apr 2014 14:37:57 -0400\r
32 Received: from drake.dyndns.org\r
33         (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 s3LIbsGU029724\r
37         (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
38         Mon, 21 Apr 2014 14:37:56 -0400\r
39 Received: from amthrax by drake.dyndns.org with local (Exim 4.77)\r
40         (envelope-from <amdragon@mit.edu>)\r
41         id 1WcJ6I-0003lF-Gn; Mon, 21 Apr 2014 14:37:54 -0400\r
42 From: Austin Clements <amdragon@MIT.EDU>\r
43 To: notmuch@notmuchmail.org\r
44 Subject: [PATCH 09/11] emacs: Use generalized content caching in w3m CID code\r
45 Date: Mon, 21 Apr 2014 14:37:46 -0400\r
46 Message-Id: <1398105468-14317-10-git-send-email-amdragon@mit.edu>\r
47 X-Mailer: git-send-email 1.9.1\r
48 In-Reply-To: <1398105468-14317-1-git-send-email-amdragon@mit.edu>\r
49 References: <1398105468-14317-1-git-send-email-amdragon@mit.edu>\r
50 X-Brightmail-Tracker:\r
51  H4sIAAAAAAAAA+NgFtrIIsWRmVeSWpSXmKPExsUixCmqrduWGhps8PgGv8X1mzOZHRg9nq26\r
52         xRzAGMVlk5Kak1mWWqRvl8CVcWH6J7aCq4IVm9pWMjUwLuLrYuTgkBAwkdi4R6GLkRPIFJO4\r
53         cG89WxcjF4eQwGwmiZbDv5ghnI2MEtdnfGOFcO4wSZw/fw6qbC6jxLyuRhaQfjYBDYlt+5cz\r
54         gtgiAtISO+/OZgVZwSygJvGnSwUkLCzgK/Hh9Go2kDCLgKrEvhZ9kDCvgKPEq/6tbBBXyEmc\r
55         PDaZFcTmBIq3rX7JDmILCThIbNi7hmkCI/8CRoZVjLIpuVW6uYmZOcWpybrFyYl5ealFusZ6\r
56         uZkleqkppZsYwSEjybeD8etBpUOMAhyMSjy8BUahwUKsiWXFlbmHGCU5mJREeV9FAYX4kvJT\r
57         KjMSizPii0pzUosPMUpwMCuJ8K7XBMrxpiRWVqUW5cOkpDlYlMR531pbBQsJpCeWpGanphak\r
58         FsFkZTg4lCR4b6YANQoWpaanVqRl5pQgpJk4OEGG8wANvwhSw1tckJhbnJkOkT/FqCglztsG\r
59         khAASWSU5sH1wmL6FaM40CvCvC0gVTzAdADX/QpoMBPQ4CdbQkAGlyQipKQaGC2EmLxPnO1m\r
60         erPXgX3ubrPN5eLLE7JNLe8Fhl5sP7Jp8+I8Qfk7i6QSuh3uMa2b6cD57fPKF1r7tuiwFf9m\r
61         bJnsv/zhMYMaq5C6o27b0gUKlQ6pztjn99Vb/9AcrcUWAZJ2s5XYj99runLPpHjrzi0zcuZ9\r
62         unm1Vy9uV/NnphtJUsptZqGi/kosxRmJhlrMRcWJAPohi0DEAgAA\r
63 X-BeenThere: notmuch@notmuchmail.org\r
64 X-Mailman-Version: 2.1.13\r
65 Precedence: list\r
66 List-Id: "Use and development of the notmuch mail system."\r
67         <notmuch.notmuchmail.org>\r
68 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
69         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
70 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
71 List-Post: <mailto:notmuch@notmuchmail.org>\r
72 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
73 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
74         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
75 X-List-Received-Date: Mon, 21 Apr 2014 18:38:10 -0000\r
76 \r
77 Previously this did its own caching, but this is now supported by more\r
78 generally by `notmuch-get-bodypart-binary'.\r
79 ---\r
80  emacs/notmuch-show.el | 23 ++++++++---------------\r
81  1 file changed, 8 insertions(+), 15 deletions(-)\r
82 \r
83 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
84 index 537c558..9411c9a 100644\r
85 --- a/emacs/notmuch-show.el\r
86 +++ b/emacs/notmuch-show.el\r
87 @@ -540,15 +540,14 @@ (defvar w3m-current-buffer) ;; From `w3m.el'.\r
88  (defvar notmuch-show-w3m-cid-store nil)\r
89  (make-variable-buffer-local 'notmuch-show-w3m-cid-store)\r
90  \r
91 -(defun notmuch-show-w3m-cid-store-internal (content-id msg part content)\r
92 -  (push (list content-id msg part content)\r
93 -       notmuch-show-w3m-cid-store))\r
94 +(defun notmuch-show-w3m-cid-store-internal (content-id msg part)\r
95 +  (push (list content-id msg part) notmuch-show-w3m-cid-store))\r
96  \r
97  (defun notmuch-show-w3m-cid-store (msg part)\r
98    (let ((content-id (plist-get part :content-id)))\r
99      (when content-id\r
100        (notmuch-show-w3m-cid-store-internal (concat "cid:" content-id)\r
101 -                                          msg part nil))))\r
102 +                                          msg part))))\r
103  \r
104  (defun notmuch-show-w3m-cid-retrieve (url &rest args)\r
105    (let ((matching-part (with-current-buffer w3m-current-buffer\r
106 @@ -556,18 +555,12 @@ (defun notmuch-show-w3m-cid-retrieve (url &rest args)\r
107      (if matching-part\r
108         (let* ((msg (nth 1 matching-part))\r
109                (part (nth 2 matching-part))\r
110 -              (content (nth 3 matching-part))\r
111                (content-type (plist-get part :content-type)))\r
112 -         ;; If we don't already have the content, get it and cache\r
113 -         ;; it, as some messages reference the same cid: part many\r
114 -         ;; times (hundreds!), which results in many calls to\r
115 -         ;; `notmuch part'.\r
116 -         (unless content\r
117 -           (setq content (notmuch-get-bodypart-binary\r
118 -                          msg part notmuch-show-process-crypto))\r
119 -           (with-current-buffer w3m-current-buffer\r
120 -             (notmuch-show-w3m-cid-store-internal url msg part content)))\r
121 -         (insert content)\r
122 +         ;; Request content caching, as some messages reference the\r
123 +         ;; same cid: part many times (hundreds!), which results in\r
124 +         ;; many calls to `notmuch show'.\r
125 +         (insert (notmuch-get-bodypart-binary\r
126 +                  msg part notmuch-show-process-crypto 'cache))\r
127           content-type)\r
128        nil)))\r
129  \r
130 -- \r
131 1.9.1\r
132 \r