Commit 43e792cd authored by David Bremner's avatar David Bremner Committed by Eli Zaretskii
Browse files

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
parent 69dde0c5
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment