Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 6F060431FC7 for ; Sat, 29 Sep 2012 10:55:23 -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 mlceA+4S8Bdu for ; Sat, 29 Sep 2012 10:55:22 -0700 (PDT) Received: from dmz-mailsec-scanner-3.mit.edu (DMZ-MAILSEC-SCANNER-3.MIT.EDU [18.9.25.14]) by olra.theworths.org (Postfix) with ESMTP id E627F431FC0 for ; Sat, 29 Sep 2012 10:55:21 -0700 (PDT) X-AuditID: 1209190e-b7f756d000000904-4b-506736096d94 Received: from mailhub-auth-1.mit.edu ( [18.9.21.35]) by dmz-mailsec-scanner-3.mit.edu (Symantec Messaging Gateway) with SMTP id E4.81.02308.90637605; Sat, 29 Sep 2012 13:55:21 -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 q8THtK5t018534; Sat, 29 Sep 2012 13:55:20 -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 q8THtJBD004648 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Sat, 29 Sep 2012 13:55:20 -0400 (EDT) Received: from amthrax by drake.dyndns.org with local (Exim 4.77) (envelope-from ) id 1TI1G3-0003Er-0c; Sat, 29 Sep 2012 13:55:19 -0400 From: Austin Clements To: notmuch@notmuchmail.org Subject: [PATCH 3/3] emacs: Work around gnus-inhibit-images bug in mm-shr Date: Sat, 29 Sep 2012 13:55:14 -0400 Message-Id: <1348941314-8377-4-git-send-email-amdragon@mit.edu> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1348941314-8377-1-git-send-email-amdragon@mit.edu> References: <1348941314-8377-1-git-send-email-amdragon@mit.edu> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrEIsWRmVeSWpSXmKPExsUixCmqrMtplh5gcOiqqMX1mzOZHRg9nq26 xRzAGMVlk5Kak1mWWqRvl8CVcf99O0vBW6GKB20zWBoY9/F3MXJySAiYSPx5coMJwhaTuHBv PVsXIxeHkMA+RoknU24wQzgbGCUOvF0M5Txikniy5C4jSIuQwFxGifVHYkFsNgENiW37l4PF RQSkJXbenc3axcjBwSygJvGnSwUkLCzgKbFx5WOwbSwCqhJt89eygti8AvYSC369Z4W4Ql7i 6f0+NhCbU8BB4sCUbWwQq+wlbh6exTSBkX8BI8MqRtmU3Crd3MTMnOLUZN3i5MS8vNQiXWO9 3MwSvdSU0k2M4KCR5NvB+PWg0iFGAQ5GJR7eG6dTA4RYE8uKK3MPMUpyMCmJ8rropAcI8SXl p1RmJBZnxBeV5qQWH2KU4GBWEuHNKAYq501JrKxKLcqHSUlzsCiJ815JuekvJJCeWJKanZpa kFoEk5Xh4FCS4BUzBRoqWJSanlqRlplTgpBm4uAEGc4DNNwCpIa3uCAxtzgzHSJ/ilFRSpxX FCQhAJLIKM2D64VF9StGcaBXhCGqeIAJAa77FdBgJqDBVavSQAaXJCKkpBoYtVTPWy2cHne8 kS3pwfzkTKm4sl+6xqLyGmI8yx0u7c87U3szvnQ6C9OOOw9fRtVblmoene4eYCd3dpvUKtVt lbzWocpc5WcP99yTvZi19fCMLF0jz4Mqsvvbrm9iVZpz37Xv+pLpFc8r7i270VJ38PZNj8RN kXlGGjG/puua/z8tfZIzVWOBEktxRqKhFnNRcSIA08eWHMUCAAA= 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 17:55:24 -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 providing a definition for gnus-inhibit-images. This fixes the "Rendering HTML mail with images" test for Emacs 24. --- emacs/notmuch-lib.el | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el index 20d990d..c74035c 100644 --- a/emacs/notmuch-lib.el +++ b/emacs/notmuch-lib.el @@ -254,6 +254,30 @@ 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. Unfortunately, gnus-art and its dependencies +;; are very large and often not needed, making it undesirable to +;; simply load gnus-art here. Instead, we directly define the +;; variable here. We use defcustom instead of defvar so that it +;; interacts properly with user customizations of the variable (if the +;; custom value has already been loaded, only defcustom will make it +;; visible). There is a danger of overriding the documentation string +;; if gnus-art is already loaded, so we don't do anything if the +;; variable is already defined. If the user attempts to customize the +;; variable, we instruct custom to load gnus-art before displaying the +;; widget, which will override this definition with the proper +;; documentation string, groups, etc. +(if (and (>= emacs-major-version 24) + (not (boundp 'gnus-inhibit-images))) + (defcustom gnus-inhibit-images nil + "Documentation will be available after loading gnus-art." + :load "gnus-art")) + (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