From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs 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 Message-ID: <83d1e6smjt.fsf@gnu.org> References: <8760k36als.fsf@tethera.net> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1488011295 2579 195.159.176.226 (25 Feb 2017 08:28:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 25 Feb 2017 08:28:15 +0000 (UTC) Cc: 25828@debbugs.gnu.org To: David Bremner , Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Feb 25 09:28:10 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1chXi5-0008Jz-9D for geb-bug-gnu-emacs@m.gmane.org; Sat, 25 Feb 2017 09:28:09 +0100 Original-Received: from localhost ([::1]:41764 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1chXiB-0001nG-64 for geb-bug-gnu-emacs@m.gmane.org; Sat, 25 Feb 2017 03:28:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52528) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1chXhz-0001lk-HW for bug-gnu-emacs@gnu.org; Sat, 25 Feb 2017 03:28:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1chXhy-00032s-D6 for bug-gnu-emacs@gnu.org; Sat, 25 Feb 2017 03:28:03 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:56938) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1chXhy-00032R-AE for bug-gnu-emacs@gnu.org; Sat, 25 Feb 2017 03:28:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1chXhy-0004QA-1q for bug-gnu-emacs@gnu.org; Sat, 25 Feb 2017 03:28:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 25 Feb 2017 08:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25828 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 25828-submit@debbugs.gnu.org id=B25828.148801125916961 (code B ref 25828); Sat, 25 Feb 2017 08:28:02 +0000 Original-Received: (at 25828) by debbugs.gnu.org; 25 Feb 2017 08:27:39 +0000 Original-Received: from localhost ([127.0.0.1]:55137 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1chXha-0004PV-Ml for submit@debbugs.gnu.org; Sat, 25 Feb 2017 03:27:38 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:33118) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1chXhZ-0004PI-36 for 25828@debbugs.gnu.org; Sat, 25 Feb 2017 03:27:37 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1chXhP-0002e9-2Z for 25828@debbugs.gnu.org; Sat, 25 Feb 2017 03:27:31 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:53045) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1chXhO-0002e3-TP; Sat, 25 Feb 2017 03:27:26 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2884 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1chXhO-0004x6-1X; Sat, 25 Feb 2017 03:27:26 -0500 In-reply-to: <8760k36als.fsf@tethera.net> (message from David Bremner on Tue, 21 Feb 2017 07:34:39 -0400) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:129765 Archived-At: > From: David Bremner > 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?