[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r102416: shr.el (shr-image-displayer)
From: |
Katsumi Yamaoka |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r102416: shr.el (shr-image-displayer): Protect function against non-existent image source. |
Date: |
Wed, 17 Nov 2010 08:28:15 +0000 |
User-agent: |
Bazaar (2.0.3) |
------------------------------------------------------------
revno: 102416
committer: Katsumi Yamaoka <address@hidden>
branch nick: trunk
timestamp: Wed 2010-11-17 08:28:15 +0000
message:
shr.el (shr-image-displayer): Protect function against non-existent image
source.
modified:
lisp/gnus/ChangeLog
lisp/gnus/shr.el
=== modified file 'lisp/gnus/ChangeLog'
--- a/lisp/gnus/ChangeLog 2010-11-17 07:22:19 +0000
+++ b/lisp/gnus/ChangeLog 2010-11-17 08:28:15 +0000
@@ -1,5 +1,8 @@
2010-11-17 Katsumi Yamaoka <address@hidden>
+ * shr.el (shr-image-displayer): Protect function against non-existent
+ image source.
+
* gnus-art.el (gnus-inhibit-images): New user option.
(gnus-mime-display-single): Don't display image if it is non-nil.
=== modified file 'lisp/gnus/shr.el'
--- a/lisp/gnus/shr.el 2010-11-17 07:22:19 +0000
+++ b/lisp/gnus/shr.el 2010-11-17 08:28:15 +0000
@@ -441,19 +441,20 @@
is an argument. The function to be returned takes three arguments URL,
START, and END."
`(lambda (url start end)
- (if (string-match "\\`cid:" url)
- ,(when content-function
- `(let ((image (funcall ,content-function
- (substring url (match-end 0)))))
- (when image
- (goto-char start)
- (shr-put-image image
- (prog1
- (buffer-substring-no-properties start end)
- (delete-region start end))))))
- (url-retrieve url 'shr-image-fetched
- (list (current-buffer) start end)
- t))))
+ (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)
+ (shr-put-image image
+ (prog1
+ (buffer-substring-no-properties start end)
+ (delete-region start end))))))
+ (url-retrieve url 'shr-image-fetched
+ (list (current-buffer) start end)
+ t)))))
(defun shr-heading (cont &rest types)
(shr-ensure-paragraph)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r102416: shr.el (shr-image-displayer): Protect function against non-existent image source.,
Katsumi Yamaoka <=