]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix issues with dedicated windows in shr.el
authorDavid Bremner <david@tethera.net>
Sat, 4 Mar 2017 10:19:32 +0000 (12:19 +0200)
committerEli Zaretskii <eliz@gnu.org>
Sat, 4 Mar 2017 10:19:32 +0000 (12:19 +0200)
* lisp/net/shr.el (shr-pixel-buffer-width, shr-render-td-1): Make
the window not dedicated, to avoid errors if it was, before
setting its buffer temporarily.  (Bug#25828)

Copyright-paperwork-exempt: yes

lisp/net/shr.el

index b7c48288494b21f46d9568a5a2e313f99b50f204..6ec647e802857b806da9b3f23164cc78cf06d2a4 100644 (file)
@@ -2228,6 +2228,9 @@ flags that control whether to collect or render objects."
     (if (get-buffer-window)
        (car (window-text-pixel-size nil (point-min) (point-max)))
       (save-window-excursion
+        ;; Avoid errors if the selected window is a dedicated one,
+        ;; and they just want to insert a document into it.
+        (set-window-dedicated-p nil nil)
        (set-window-buffer nil (current-buffer))
        (car (window-text-pixel-size nil (point-min) (point-max)))))))
 
@@ -2271,6 +2274,9 @@ flags that control whether to collect or render objects."
            (shr-indentation 0))
        (shr-descend dom))
       (save-window-excursion
+        ;; Avoid errors if the selected window is a dedicated one,
+        ;; and they just want to insert a document into it.
+        (set-window-dedicated-p nil nil)
        (set-window-buffer nil (current-buffer))
        (unless fill
          (setq natural-width