]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/net/shr.el (shr-image-displayer): Use proper closures
authorStefan Monnier <monnier@iro.umontreal.ca>
Tue, 18 May 2021 23:15:04 +0000 (19:15 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Tue, 18 May 2021 23:15:04 +0000 (19:15 -0400)
lisp/net/shr.el

index cbdeb65ba8b830b4aedc74d80ab58143480b9b8f..873f0457e3a9485023082839cc40dfa1401c4b07 100644 (file)
@@ -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)