unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [RFC][PATCH] emacs: Provide scaffolding so that the new `shr' HTML renderer can run.
@ 2011-12-19 15:45 David Edmondson
  2011-12-19 17:50 ` Aaron Ecay
  2011-12-20  6:38 ` Chris Gray
  0 siblings, 2 replies; 11+ messages in thread
From: David Edmondson @ 2011-12-19 15:45 UTC (permalink / raw)
  To: notmuch

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

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2012-01-23 17:15 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-19 15:45 [RFC][PATCH] emacs: Provide scaffolding so that the new `shr' HTML renderer can run David Edmondson
2011-12-19 17:50 ` Aaron Ecay
2011-12-20  6:38 ` Chris Gray
2011-12-20  8:35   ` David Edmondson
2011-12-20 14:27     ` Chris Gray
2011-12-20 14:33       ` David Edmondson
2011-12-20 16:09         ` Chris Gray
2011-12-20  8:40   ` Aaron Ecay
2011-12-20 17:06     ` Chris Gray
2012-01-23 14:43   ` Florian Friesdorf
2012-01-23 17:14     ` Chris Gray

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).