diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2021-05-18 19:15:04 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2021-05-18 19:15:04 -0400 |
commit | 26041ec8d518806e29566af4428bb61d6d36d0b7 (patch) | |
tree | 28c51694257fc53a2ac934c738996f82b61e91b1 /lisp/net/shr.el | |
parent | 5e7b57ad8f11ad013f9b652637bb7fdaf7a3fd4a (diff) | |
download | emacs-26041ec8d518806e29566af4428bb61d6d36d0b7.tar.gz emacs-26041ec8d518806e29566af4428bb61d6d36d0b7.tar.bz2 emacs-26041ec8d518806e29566af4428bb61d6d36d0b7.zip |
* lisp/net/shr.el (shr-image-displayer): Use proper closures
Diffstat (limited to 'lisp/net/shr.el')
-rw-r--r-- | lisp/net/shr.el | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/lisp/net/shr.el b/lisp/net/shr.el index cbdeb65ba8b..873f0457e3a 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -1257,20 +1257,20 @@ Return a string with image data." 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))))) + (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))))) (defun shr-heading (dom &rest types) (shr-ensure-paragraph) |