Fix issues with dedicated windows in shr.el

* 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
This commit is contained in:
David Bremner 2017-03-04 12:19:32 +02:00 committed by Eli Zaretskii
parent 69dde0c54c
commit 43e792cd7f

View 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