diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 6c35a33c9c..2bc37c64bd 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -1993,6 +1993,9 @@ shr-pixel-buffer-width (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))))))) @@ -2036,6 +2039,9 @@ shr-render-td-1 (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