Function: shr-image-displayer
shr-image-displayer is a byte-compiled function defined in shr.el.gz.
Signature
(shr-image-displayer CONTENT-FUNCTION)
Documentation
Return a function to display an image.
CONTENT-FUNCTION is a function to retrieve an image for a cid url that is an argument. The function to be returned takes three arguments URL, START, and END. Note that START and END should be markers.
Source Code
;; Defined in /usr/src/emacs/lisp/net/shr.el.gz
(defun shr-image-displayer (content-function)
"Return a function to display an image.
CONTENT-FUNCTION is a function to retrieve an image for a cid url that
is an argument. The function to be returned takes three arguments URL,
START, and END. Note that START and END should be markers."
(lambda (url start end)
(when url
(if (string-match "\\`cid:" url)
(when content-function
(let ((image (funcall content-function
(substring url (match-end 0)))))
(when image
(goto-char start)
(funcall shr-put-image-function
image (buffer-substring start end))
(delete-region (point) end))))
(url-retrieve url #'shr-image-fetched
(list (current-buffer) start end)
t t)))))