bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#25828: 25.1; remaining errors from shr calling set-window-buffer-p i


From: Eli Zaretskii
Subject: bug#25828: 25.1; remaining errors from shr calling set-window-buffer-p in dedicated window
Date: Sat, 25 Feb 2017 10:27:02 +0200

> From: David Bremner <address@hidden>
> Date: Tue, 21 Feb 2017 07:34:39 -0400
> 
> In https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24950 I reported an
> error resulting from shr calling set-window-buffer-p in a dedicated
> window. Eli provided a patch for that, which works great for that code
> path. Unfortunately there are at least two more places in the shr code
> with the same issue. A notmuch user reported crashes rendering html on
> one of those other code paths. I have not produced a recipe for
> duplicating the problem without notmuch, but copying Eli's patch into
> these other two code paths fixes the problem. I have attached the diff
> against emacs-25.2-rc1-14-gec4226d810.  Both added calls to
> set-window-dedicated-p are inside save-window-excursion.  It occurs to
> me that maybe save-window-excursion should call set-window-dedicated-p,
> but I don't know the full implications.
> 
> 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

Lars, any objections to pushing this?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]