1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-11 16:08:13 +00:00

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.
This commit is contained in:
Katsumi Yamaoka 2017-03-27 09:05:41 +00:00
parent bd074d9bab
commit 8ce827426e

View File

@ -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)