Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / df / b9c4c6923139f303430fe85bd0e62effc8bee1
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 E03EA431FBF\r
6         for <notmuch@notmuchmail.org>; Sat, 29 Sep 2012 11:03:47 -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 8hTySBPEQ2P5 for <notmuch@notmuchmail.org>;\r
16         Sat, 29 Sep 2012 11:03:47 -0700 (PDT)\r
17 Received: from dmz-mailsec-scanner-4.mit.edu (DMZ-MAILSEC-SCANNER-4.MIT.EDU\r
18         [18.9.25.15])\r
19         by olra.theworths.org (Postfix) with ESMTP id 3249C431FBC\r
20         for <notmuch@notmuchmail.org>; Sat, 29 Sep 2012 11:03:47 -0700 (PDT)\r
21 X-AuditID: 1209190f-b7f636d00000095b-11-506738021bac\r
22 Received: from mailhub-auth-1.mit.edu ( [18.9.21.35])\r
23         by dmz-mailsec-scanner-4.mit.edu (Symantec Messaging Gateway) with SMTP\r
24         id 0D.9E.02395.20837605; Sat, 29 Sep 2012 14:03:46 -0400 (EDT)\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
26         by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id q8TI3kgi019124; \r
27         Sat, 29 Sep 2012 14:03:46 -0400\r
28 Received: from drake.dyndns.org\r
29         (209-6-116-242.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com\r
30         [209.6.116.242]) (authenticated bits=0)\r
31         (User authenticated as amdragon@ATHENA.MIT.EDU)\r
32         by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q8TI3jjH005274\r
33         (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
34         Sat, 29 Sep 2012 14:03:46 -0400 (EDT)\r
35 Received: from amthrax by drake.dyndns.org with local (Exim 4.77)\r
36         (envelope-from <amdragon@mit.edu>)\r
37         id 1TI1OC-00043Q-Vi; Sat, 29 Sep 2012 14:03:44 -0400\r
38 From: Austin Clements <amdragon@MIT.EDU>\r
39 To: notmuch@notmuchmail.org\r
40 Subject: [PATCH] emacs: Work around gnus-inhibit-images bug in mm-shr\r
41 Date: Sat, 29 Sep 2012 14:03:43 -0400\r
42 Message-Id: <1348941823-15516-1-git-send-email-amdragon@mit.edu>\r
43 X-Mailer: git-send-email 1.7.10\r
44 In-Reply-To: <1348941314-8377-4-git-send-email-amdragon@mit.edu>\r
45 References: <1348941314-8377-4-git-send-email-amdragon@mit.edu>\r
46 X-Brightmail-Tracker:\r
47  H4sIAAAAAAAAA+NgFtrIIsWRmVeSWpSXmKPExsUixCmqrMtkkR5gsKfR0OL6zZnMDowez1bd\r
48         Yg5gjOKySUnNySxLLdK3S+DKmL30LnPBT76KRxsvsjUwLuLpYuTkkBAwkfjzcwULhC0mceHe\r
49         ejYQW0hgH6PE5D7tLkYuIHsDo8SiK0vYIZxHTBJvT/azQjhzGSW+b9nCBNLCJqAhsW3/ckYQ\r
50         W0RAWmLn3dlARRwczAJqEn+6VEBMYQFXiV9vdUEqWARUJf68ewJWzSvgIDHrxh9GiCPkJZ7e\r
51         7wM7ghMo3rDyAwvEQfYSk09+Z5nAyL+AkWEVo2xKbpVubmJmTnFqsm5xcmJeXmqRrolebmaJ\r
52         XmpK6SZGcMhI8u9g/HZQ6RCjAAejEg+vxvHUACHWxLLiytxDjJIcTEqivC466QFCfEn5KZUZ\r
53         icUZ8UWlOanFhxglOJiVRHgzioHKeVMSK6tSi/JhUtIcLErivFdTbvoLCaQnlqRmp6YWpBbB\r
54         ZGU4OJQkePPNgYYKFqWmp1akZeaUIKSZODhBhvMADb9pBlTDW1yQmFucmQ6RP8WoKCXOawDS\r
55         LACSyCjNg+uFxfQrRnGgV4R5DUGqeIDpAK77FdBgJqDBVavSQAaXJCKkpBoYAz20V+9vOm6Q\r
56         xhpSKSAQW7pFyT7vbOV0X51XzzIWW1pLvJXfktzJ/scg+5jTHL6MF73Rcj0lh0IXB/1hWSQx\r
57         d3n7sv8Fmm91FzydGcDE2LWyIau3/7OG6tFotZllj39UOPAqXks9/ak8hpdRWfOQ7T0ly9kH\r
58         nNPcv8qLXDo/67pCfVAut7cSS3FGoqEWc1FxIgCAovjZxAIAAA==\r
59 X-BeenThere: notmuch@notmuchmail.org\r
60 X-Mailman-Version: 2.1.13\r
61 Precedence: list\r
62 List-Id: "Use and development of the notmuch mail system."\r
63         <notmuch.notmuchmail.org>\r
64 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
65         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
66 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
67 List-Post: <mailto:notmuch@notmuchmail.org>\r
68 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
69 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
70         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
71 X-List-Received-Date: Sat, 29 Sep 2012 18:03:48 -0000\r
72 \r
73 Emacs 24's mm-shr HTML email renderer fails to load gnus-art before\r
74 referencing gnus-inhibit-images, resulting in a void-variable error\r
75 when notmuch attempts to render an HTML email with inline images.\r
76 This works around this bug by advising mm-shr to load gnus-art.\r
77 \r
78 mm-shr is the only function outside of gnus-art itself that references\r
79 gnus-inhibit-images, so this workaround should be correct.  If this\r
80 ever changes, hopefully they will have fixed this bug upstream first.\r
81 \r
82 This fixes the "Rendering HTML mail with images" test for Emacs 24.\r
83 ---\r
84 \r
85 This is an alternate fix to the one provided in patch 3/3.\r
86 \r
87  emacs/notmuch-lib.el |   13 +++++++++++++\r
88  1 file changed, 13 insertions(+)\r
89 \r
90 diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el\r
91 index 20d990d..69867ad 100644\r
92 --- a/emacs/notmuch-lib.el\r
93 +++ b/emacs/notmuch-lib.el\r
94 @@ -254,6 +254,19 @@ the given type."\r
95    (or (plist-get part :content)\r
96        (notmuch-get-bodypart-internal (notmuch-id-to-query (plist-get msg :id)) nth process-crypto)))\r
97  \r
98 +;; Workaround: The call to `mm-display-part' below triggers a bug in\r
99 +;; Emacs 24 if it attempts to use the shr renderer to display an HTML\r
100 +;; part with images in it (demonstrated in 24.1 and 24.2 on Debian and\r
101 +;; Fedora 17, though unreproducable in other configurations).\r
102 +;; `mm-shr' references the variable `gnus-inhibit-images' without\r
103 +;; first loading gnus-art, which defines it, resulting in a\r
104 +;; void-variable error.  Hence, we advise `mm-shr' to ensure gnus-art\r
105 +;; is loaded.\r
106 +(if (>= emacs-major-version 24)\r
107 +    (defadvice mm-shr (before load-gnus-arts activate)\r
108 +      (require 'gnus-art nil t)\r
109 +      (ad-disable-advice 'mm-shr 'before 'load-gnus-arts)))\r
110 +\r
111  (defun notmuch-mm-display-part-inline (msg part nth content-type process-crypto)\r
112    "Use the mm-decode/mm-view functions to display a part in the\r
113  current buffer, if possible."\r
114 -- \r
115 1.7.10\r
116 \r