From: Katsumi Yamaoka Date: Fri, 13 May 2011 05:35:56 +0000 (+0000) Subject: gnus-html.el (gnus-html-put-image): Register a displayer. X-Git-Tag: emacs-pretest-24.0.90~104^2~618^2~283 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=195b25935c16b22de660c93e79de7969056d7785;p=emacs.git gnus-html.el (gnus-html-put-image): Register a displayer. shr.el (shr-image-displayer): Don't remove text props from alt text. --- diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 6f4bc302570..8dad14c44ae 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,9 @@ +2011-05-13 Katsumi Yamaoka + + * gnus-html.el (gnus-html-put-image): Register a displayer. + + * shr.el (shr-image-displayer): Don't remove text props from alt text. + 2011-05-13 Teodor Zlatanov * registry.el (prune-factor): New initialization parameter defaulting diff --git a/lisp/gnus/gnus-html.el b/lisp/gnus/gnus-html.el index b7f0c0922a3..a4c4fa55d9a 100644 --- a/lisp/gnus/gnus-html.el +++ b/lisp/gnus/gnus-html.el @@ -482,8 +482,14 @@ Return a string with image data." (gnus-put-text-property start (point) 'gnus-alt-text alt-text) (when url - (gnus-put-text-property start (point) - 'image-url url)) + (gnus-add-text-properties + start (point) + `(image-url + ,url + image-displayer + (lambda (url start end) + (gnus-html-display-image ,url ,start ,(point) + ,alt-text))))) (gnus-add-image 'external image) t) ;; Bad image, try to show something else diff --git a/lisp/gnus/shr.el b/lisp/gnus/shr.el index 75c6d5d9ce7..edd106618df 100644 --- a/lisp/gnus/shr.el +++ b/lisp/gnus/shr.el @@ -582,7 +582,7 @@ START, and END. Note that START and END should be merkers." (when image (goto-char start) (funcall shr-put-image-function - image (buffer-substring-no-properties start end)) + image (buffer-substring start end)) (delete-region (point) end)))) (url-retrieve url 'shr-image-fetched (list (current-buffer) start end)