diff lisp/gnus/gnus-art.el @ 111556:ee13ba492319

Rework how Gnus is supposed to be able to display all the images in HTML. shr.el (shr-tag-img): Put a displayer in the text property. gnus-util.el (gnus-find-text-property-region): New utility function. gnus-html.el (gnus-html-display-image): Make the alt optional. gnus-html.el (gnus-html-show-images): Remove. gnus-art.el (gnus-article-show-images): New, more general function. gnus-html.el, shr.el: Use image-url instead of gnus-image-url to unify the image url text properties.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Mon, 15 Nov 2010 23:45:55 +0000
parents ebad3de62d57
children db20adbc4108
line wrap: on
line diff
--- a/lisp/gnus/gnus-art.el	Mon Nov 15 22:12:43 2010 +0000
+++ b/lisp/gnus/gnus-art.el	Mon Nov 15 23:45:55 2010 +0000
@@ -2271,6 +2271,17 @@
     (dolist (elem gnus-article-image-alist)
       (gnus-delete-images (car elem)))))
 
+(defun gnus-article-show-images ()
+  "Show any images that are in the HTML-rendered article buffer.
+This only works if the article in question is HTML."
+  (interactive)
+  (gnus-with-article-buffer
+    (dolist (region (gnus-find-text-property-region (point-min) (point-max)
+						    'image-displayer))
+      (destructuring-bind (start end function) region
+	(funcall function (get-text-property start 'image-url)
+		 start end)))))
+
 (defun gnus-article-treat-fold-newsgroups ()
   "Unfold folded message headers.
 Only the headers that fit into the current window width will be