]> git.eshelyaron.com Git - emacs.git/commitdiff
Avoid errors in shr-pixel-column due to dedicated windows
authorEli Zaretskii <eliz@gnu.org>
Sun, 20 Nov 2016 19:08:47 +0000 (21:08 +0200)
committerEli Zaretskii <eliz@gnu.org>
Sun, 20 Nov 2016 19:08:47 +0000 (21:08 +0200)
* lisp/net/shr.el (shr-pixel-column): If we are switching to
another buffer in the selected window, make that window
temporarily non-dedicated.  (Bug#24950)

lisp/net/shr.el

index 2c8ff79763f3cc36219d49f864cb0bac17f1c53c..18bc7b867157d684c9e32e9bb1e2eb12ce3eec44 100644 (file)
@@ -518,6 +518,9 @@ size, and full-buffer size."
       (current-column)
     (if (not (get-buffer-window (current-buffer)))
        (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 (line-beginning-position) (point))))
       (car (window-text-pixel-size nil (line-beginning-position) (point))))))