From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id E03EA431FBF for ; Sat, 29 Sep 2012 11:03:47 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8hTySBPEQ2P5 for ; Sat, 29 Sep 2012 11:03:47 -0700 (PDT) Received: from dmz-mailsec-scanner-4.mit.edu (DMZ-MAILSEC-SCANNER-4.MIT.EDU [18.9.25.15]) by olra.theworths.org (Postfix) with ESMTP id 3249C431FBC for ; Sat, 29 Sep 2012 11:03:47 -0700 (PDT) X-AuditID: 1209190f-b7f636d00000095b-11-506738021bac Received: from mailhub-auth-1.mit.edu ( [18.9.21.35]) by dmz-mailsec-scanner-4.mit.edu (Symantec Messaging Gateway) with SMTP id 0D.9E.02395.20837605; Sat, 29 Sep 2012 14:03:46 -0400 (EDT) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id q8TI3kgi019124; Sat, 29 Sep 2012 14:03:46 -0400 Received: from drake.dyndns.org (209-6-116-242.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com [209.6.116.242]) (authenticated bits=0) (User authenticated as amdragon@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q8TI3jjH005274 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Sat, 29 Sep 2012 14:03:46 -0400 (EDT) Received: from amthrax by drake.dyndns.org with local (Exim 4.77) (envelope-from ) id 1TI1OC-00043Q-Vi; Sat, 29 Sep 2012 14:03:44 -0400 From: Austin Clements To: notmuch@notmuchmail.org Subject: [PATCH] emacs: Work around gnus-inhibit-images bug in mm-shr Date: Sat, 29 Sep 2012 14:03:43 -0400 Message-Id: <1348941823-15516-1-git-send-email-amdragon@mit.edu> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1348941314-8377-4-git-send-email-amdragon@mit.edu> References: <1348941314-8377-4-git-send-email-amdragon@mit.edu> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrIIsWRmVeSWpSXmKPExsUixCmqrMtkkR5gsKfR0OL6zZnMDowez1bd Yg5gjOKySUnNySxLLdK3S+DKmL30LnPBT76KRxsvsjUwLuLpYuTkkBAwkfjzcwULhC0mceHe ejYQW0hgH6PE5D7tLkYuIHsDo8SiK0vYIZxHTBJvT/azQjhzGSW+b9nCBNLCJqAhsW3/ckYQ W0RAWmLn3dlARRwczAJqEn+6VEBMYQFXiV9vdUEqWARUJf68ewJWzSvgIDHrxh9GiCPkJZ7e 7wM7ghMo3rDyAwvEQfYSk09+Z5nAyL+AkWEVo2xKbpVubmJmTnFqsm5xcmJeXmqRrolebmaJ XmpK6SZGcMhI8u9g/HZQ6RCjAAejEg+vxvHUACHWxLLiytxDjJIcTEqivC466QFCfEn5KZUZ icUZ8UWlOanFhxglOJiVRHgzioHKeVMSK6tSi/JhUtIcLErivFdTbvoLCaQnlqRmp6YWpBbB ZGU4OJQkePPNgYYKFqWmp1akZeaUIKSZODhBhvMADb9pBlTDW1yQmFucmQ6RP8WoKCXOawDS LACSyCjNg+uFxfQrRnGgV4R5DUGqeIDpAK77FdBgJqDBVavSQAaXJCKkpBoYAz20V+9vOm6Q xhpSKSAQW7pFyT7vbOV0X51XzzIWW1pLvJXfktzJ/scg+5jTHL6MF73Rcj0lh0IXB/1hWSQx d3n7sv8Fmm91FzydGcDE2LWyIau3/7OG6tFotZllj39UOPAqXks9/ak8hpdRWfOQ7T0ly9kH nNPcv8qLXDo/67pCfVAut7cSS3FGoqEWc1FxIgCAovjZxAIAAA== X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Sep 2012 18:03:48 -0000 Emacs 24's mm-shr HTML email renderer fails to load gnus-art before referencing gnus-inhibit-images, resulting in a void-variable error when notmuch attempts to render an HTML email with inline images. This works around this bug by advising mm-shr to load gnus-art. mm-shr is the only function outside of gnus-art itself that references gnus-inhibit-images, so this workaround should be correct. If this ever changes, hopefully they will have fixed this bug upstream first. This fixes the "Rendering HTML mail with images" test for Emacs 24. --- This is an alternate fix to the one provided in patch 3/3. emacs/notmuch-lib.el | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el index 20d990d..69867ad 100644 --- a/emacs/notmuch-lib.el +++ b/emacs/notmuch-lib.el @@ -254,6 +254,19 @@ the given type." (or (plist-get part :content) (notmuch-get-bodypart-internal (notmuch-id-to-query (plist-get msg :id)) nth process-crypto))) +;; Workaround: The call to `mm-display-part' below triggers a bug in +;; Emacs 24 if it attempts to use the shr renderer to display an HTML +;; part with images in it (demonstrated in 24.1 and 24.2 on Debian and +;; Fedora 17, though unreproducable in other configurations). +;; `mm-shr' references the variable `gnus-inhibit-images' without +;; first loading gnus-art, which defines it, resulting in a +;; void-variable error. Hence, we advise `mm-shr' to ensure gnus-art +;; is loaded. +(if (>= emacs-major-version 24) + (defadvice mm-shr (before load-gnus-arts activate) + (require 'gnus-art nil t) + (ad-disable-advice 'mm-shr 'before 'load-gnus-arts))) + (defun notmuch-mm-display-part-inline (msg part nth content-type process-crypto) "Use the mm-decode/mm-view functions to display a part in the current buffer, if possible." -- 1.7.10