emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 8ce8274: shr-image-fetched: Work for narrowed Gnus


From: Katsumi Yamaoka
Subject: [Emacs-diffs] master 8ce8274: shr-image-fetched: Work for narrowed Gnus article
Date: Mon, 27 Mar 2017 05:06:16 -0400 (EDT)

branch: master
commit 8ce827426e5400f2be80ae5d7394b74d8dd90373
Author: Katsumi Yamaoka <address@hidden>
Commit: Katsumi Yamaoka <address@hidden>

    shr-image-fetched: Work for narrowed Gnus article
    
    See <address@hidden> of bug#26231 in the bug-gnu-emacs list.
    
    * lisp/net/shr.el (shr-image-fetched): Work for narrowed article.
---
 lisp/net/shr.el | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/lisp/net/shr.el b/lisp/net/shr.el
index 6ec647e..7472c41 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]