diff options
| author | Stefan Monnier | 2021-05-18 19:15:04 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2021-05-18 19:15:04 -0400 |
| commit | 26041ec8d518806e29566af4428bb61d6d36d0b7 (patch) | |
| tree | 28c51694257fc53a2ac934c738996f82b61e91b1 | |
| parent | 5e7b57ad8f11ad013f9b652637bb7fdaf7a3fd4a (diff) | |
| download | emacs-26041ec8d518806e29566af4428bb61d6d36d0b7.tar.gz emacs-26041ec8d518806e29566af4428bb61d6d36d0b7.zip | |
* lisp/net/shr.el (shr-image-displayer): Use proper closures
| -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." | |||
| 1257 | CONTENT-FUNCTION is a function to retrieve an image for a cid url that | 1257 | CONTENT-FUNCTION is a function to retrieve an image for a cid url that |
| 1258 | is an argument. The function to be returned takes three arguments URL, | 1258 | is an argument. The function to be returned takes three arguments URL, |
| 1259 | START, and END. Note that START and END should be markers." | 1259 | START, and END. Note that START and END should be markers." |
| 1260 | `(lambda (url start end) | 1260 | (lambda (url start end) |
| 1261 | (when url | 1261 | (when url |
| 1262 | (if (string-match "\\`cid:" url) | 1262 | (if (string-match "\\`cid:" url) |
| 1263 | ,(when content-function | 1263 | (when content-function |
| 1264 | `(let ((image (funcall ,content-function | 1264 | (let ((image (funcall content-function |
| 1265 | (substring url (match-end 0))))) | 1265 | (substring url (match-end 0))))) |
| 1266 | (when image | 1266 | (when image |
| 1267 | (goto-char start) | 1267 | (goto-char start) |
| 1268 | (funcall shr-put-image-function | 1268 | (funcall shr-put-image-function |
| 1269 | image (buffer-substring start end)) | 1269 | image (buffer-substring start end)) |
| 1270 | (delete-region (point) end)))) | 1270 | (delete-region (point) end)))) |
| 1271 | (url-retrieve url #'shr-image-fetched | 1271 | (url-retrieve url #'shr-image-fetched |
| 1272 | (list (current-buffer) start end) | 1272 | (list (current-buffer) start end) |
| 1273 | t t))))) | 1273 | t t))))) |
| 1274 | 1274 | ||
| 1275 | (defun shr-heading (dom &rest types) | 1275 | (defun shr-heading (dom &rest types) |
| 1276 | (shr-ensure-paragraph) | 1276 | (shr-ensure-paragraph) |