diff options
author | Katsumi Yamaoka <yamaoka@jpl.org> | 2017-03-27 09:05:41 +0000 |
---|---|---|
committer | Katsumi Yamaoka <yamaoka@jpl.org> | 2017-03-27 09:05:41 +0000 |
commit | 8ce827426e5400f2be80ae5d7394b74d8dd90373 (patch) | |
tree | 36172a131977734dde2a92ee16c73302af20d45d /lisp/net/shr.el | |
parent | bd074d9bab470da24dd79491d8c25b22c2a5bb3d (diff) | |
download | emacs-8ce827426e5400f2be80ae5d7394b74d8dd90373.tar.gz emacs-8ce827426e5400f2be80ae5d7394b74d8dd90373.tar.bz2 emacs-8ce827426e5400f2be80ae5d7394b74d8dd90373.zip |
shr-image-fetched: Work for narrowed Gnus article
See <8737e3msun.fsf@gmail.com> of bug#26231 in the bug-gnu-emacs list.
* lisp/net/shr.el (shr-image-fetched): Work for narrowed article.
Diffstat (limited to 'lisp/net/shr.el')
-rw-r--r-- | lisp/net/shr.el | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 6ec647e8028..7472c4133ad 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -933,17 +933,19 @@ If EXTERNAL, browse the URL using `shr-external-browser'." (let ((data (shr-parse-image-data))) (with-current-buffer buffer (save-excursion - (let ((alt (buffer-substring start end)) - (properties (text-properties-at start)) - (inhibit-read-only t)) - (delete-region start end) - (goto-char start) - (funcall shr-put-image-function data alt flags) - (while properties - (let ((type (pop properties)) - (value (pop properties))) - (unless (memq type '(display image-size)) - (put-text-property start (point) type value)))))))))) + (save-restriction + (widen) + (let ((alt (buffer-substring start end)) + (properties (text-properties-at start)) + (inhibit-read-only t)) + (delete-region start end) + (goto-char start) + (funcall shr-put-image-function data alt flags) + (while properties + (let ((type (pop properties)) + (value (pop properties))) + (unless (memq type '(display image-size)) + (put-text-property start (point) type value))))))))))) (kill-buffer image-buffer))) (defun shr-image-from-data (data) |