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 A0E37429E25 for ; Mon, 19 Dec 2011 07:46:11 -0800 (PST) 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 YiKjXjPyBQRm for ; Mon, 19 Dec 2011 07:46:11 -0800 (PST) Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com [74.125.82.45]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id DB894431FB6 for ; Mon, 19 Dec 2011 07:46:10 -0800 (PST) Received: by wgbds13 with SMTP id ds13so8885979wgb.2 for ; Mon, 19 Dec 2011 07:46:08 -0800 (PST) Received: by 10.227.208.129 with SMTP id gc1mr15456811wbb.4.1324309568091; Mon, 19 Dec 2011 07:46:08 -0800 (PST) Received: from hotblack-desiato.hh.sledj.net (host81-149-164-25.in-addr.btopenworld.com. [81.149.164.25]) by mx.google.com with ESMTPS id hn15sm26279256wib.22.2011.12.19.07.46.06 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 19 Dec 2011 07:46:07 -0800 (PST) Received: by hotblack-desiato.hh.sledj.net (Postfix, from userid 30000) id 24650A032E; Mon, 19 Dec 2011 15:46:05 +0000 (GMT) From: David Edmondson To: notmuch@notmuchmail.org Subject: [RFC][PATCH] emacs: Provide scaffolding so that the new `shr' HTML renderer can run. Date: Mon, 19 Dec 2011 15:45:59 +0000 Message-Id: <1324309559-7993-1-git-send-email-dme@dme.org> X-Mailer: git-send-email 1.7.7.3 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: Mon, 19 Dec 2011 15:46:11 -0000 Latest gnus provides a new HTML renderer entirely in lisp. It requires some minor but ugly scaffolding to allow use with notmuch. --- This is pretty horrible, but works in the cases that I tested. It would be useful if a few other people could test. Note that `cid:' images included with a text/html part are not inserted in the correct place, but that also appears to be the case for gnus. This should be tagged `notmuch::wip' in the new world order! emacs/notmuch-show.el | 14 +++++++++++++- 1 files changed, 13 insertions(+), 1 deletions(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 63b01e5..f52f233 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -320,6 +320,13 @@ message at DEPTH in the current thread." ;; ange-ftp, which is reasonable to use here. (mm-write-region (point-min) (point-max) file nil nil nil 'no-conversion t))))) +;; Nonsense required to have the new gnus `shr' HTML display code +;; work. +(defvar gnus-summary-buffer) +(defvar gnus-inhibit-images) +(if (not (fboundp 'gnus-blocked-images)) + (defun gnus-blocked-images () nil)) + (defun notmuch-show-mm-display-part-inline (msg part nth content-type) "Use the mm-decode/mm-view functions to display a part in the current buffer, if possible." @@ -331,7 +338,12 @@ current buffer, if possible." (let ((content (notmuch-show-get-bodypart-content msg part nth))) (insert content) (set-buffer display-buffer) - (mm-display-part handle) + + ;; Nonsense required to have the new gnus `shr' HTML + ;; display code work. + (let ((gnus-inhibit-images nil)) + (makunbound 'gnus-summary-buffer) ; Blech. + (mm-display-part handle)) t) nil))))) -- 1.7.7.3