diff options
| author | David Bremner | 2017-03-04 12:19:32 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2017-03-04 12:19:32 +0200 |
| commit | 43e792cd7f752cc0cff5845c5399cab1272670fa (patch) | |
| tree | 38a3a5671efec2be1690b32a268304c0eb62dabc | |
| parent | 69dde0c54ce8d4ae9600bd10fa15b2b1e227c1f3 (diff) | |
| download | emacs-43e792cd7f752cc0cff5845c5399cab1272670fa.tar.gz emacs-43e792cd7f752cc0cff5845c5399cab1272670fa.zip | |
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
| -rw-r--r-- | lisp/net/shr.el | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lisp/net/shr.el b/lisp/net/shr.el index b7c48288494..6ec647e8028 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el | |||
| @@ -2228,6 +2228,9 @@ flags that control whether to collect or render objects." | |||
| 2228 | (if (get-buffer-window) | 2228 | (if (get-buffer-window) |
| 2229 | (car (window-text-pixel-size nil (point-min) (point-max))) | 2229 | (car (window-text-pixel-size nil (point-min) (point-max))) |
| 2230 | (save-window-excursion | 2230 | (save-window-excursion |
| 2231 | ;; Avoid errors if the selected window is a dedicated one, | ||
| 2232 | ;; and they just want to insert a document into it. | ||
| 2233 | (set-window-dedicated-p nil nil) | ||
| 2231 | (set-window-buffer nil (current-buffer)) | 2234 | (set-window-buffer nil (current-buffer)) |
| 2232 | (car (window-text-pixel-size nil (point-min) (point-max))))))) | 2235 | (car (window-text-pixel-size nil (point-min) (point-max))))))) |
| 2233 | 2236 | ||
| @@ -2271,6 +2274,9 @@ flags that control whether to collect or render objects." | |||
| 2271 | (shr-indentation 0)) | 2274 | (shr-indentation 0)) |
| 2272 | (shr-descend dom)) | 2275 | (shr-descend dom)) |
| 2273 | (save-window-excursion | 2276 | (save-window-excursion |
| 2277 | ;; Avoid errors if the selected window is a dedicated one, | ||
| 2278 | ;; and they just want to insert a document into it. | ||
| 2279 | (set-window-dedicated-p nil nil) | ||
| 2274 | (set-window-buffer nil (current-buffer)) | 2280 | (set-window-buffer nil (current-buffer)) |
| 2275 | (unless fill | 2281 | (unless fill |
| 2276 | (setq natural-width | 2282 | (setq natural-width |