From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#34179: 27.0.50; message hangs when buffer with process visible Date: Fri, 25 Jan 2019 15:32:34 +0200 Message-ID: <83woms6ex9.fsf@gnu.org> References: <87fttj4dgj.fsf@web.de> <83ef938hik.fsf@gnu.org> <874l9yp50z.fsf@web.de> <87y37anpoj.fsf@web.de> <83pnsm6rxs.fsf@gnu.org> <878szanlua.fsf@web.de> <8736pinlk4.fsf@web.de> <87womum615.fsf@web.de> <87r2d2m5jf.fsf@web.de> <5C49E24F.7080800@gmx.at> <87d0olncf4.fsf@web.de> <877eetnba1.fsf@web.de> <83ef917tf7.fsf@gnu.org> <83bm457s49.fsf@gnu.org> <5C4ADA96.4010400@gmx.at> <83y37959hp.fsf@gnu.org> <5C4AE6A8.9030006@gmx.at> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="60321"; mail-complaints-to="usenet@blaine.gmane.org" Cc: michael_heerdegen@web.de, 34179@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jan 25 14:43:00 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gn1l3-000FW9-GO for geb-bug-gnu-emacs@m.gmane.org; Fri, 25 Jan 2019 14:42:57 +0100 Original-Received: from localhost ([127.0.0.1]:44820 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gn1l2-0003TF-DE for geb-bug-gnu-emacs@m.gmane.org; Fri, 25 Jan 2019 08:42:56 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:46698) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gn1bT-0003dd-5T for bug-gnu-emacs@gnu.org; Fri, 25 Jan 2019 08:33:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gn1bS-0003WL-AS for bug-gnu-emacs@gnu.org; Fri, 25 Jan 2019 08:33:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45353) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gn1bS-0003W9-6a for bug-gnu-emacs@gnu.org; Fri, 25 Jan 2019 08:33:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gn1bR-00082v-SN for bug-gnu-emacs@gnu.org; Fri, 25 Jan 2019 08:33:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 25 Jan 2019 13:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34179 X-GNU-PR-Package: emacs Original-Received: via spool by 34179-submit@debbugs.gnu.org id=B34179.154842317330916 (code B ref 34179); Fri, 25 Jan 2019 13:33:01 +0000 Original-Received: (at 34179) by debbugs.gnu.org; 25 Jan 2019 13:32:53 +0000 Original-Received: from localhost ([127.0.0.1]:44634 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gn1bJ-00082a-Av for submit@debbugs.gnu.org; Fri, 25 Jan 2019 08:32:53 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:36418) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gn1bG-00082M-VX for 34179@debbugs.gnu.org; Fri, 25 Jan 2019 08:32:51 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:47522) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gn1bB-0003Fk-JU; Fri, 25 Jan 2019 08:32:45 -0500 Original-Received: from [176.228.60.248] (port=1028 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gn1bA-0007Kf-BP; Fri, 25 Jan 2019 08:32:45 -0500 In-reply-to: <5C4AE6A8.9030006@gmx.at> (message from martin rudalics on Fri, 25 Jan 2019 11:36:24 +0100) 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: 209.51.188.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:154769 Archived-At: > Date: Fri, 25 Jan 2019 11:36:24 +0100 > From: martin rudalics > CC: michael_heerdegen@web.de, 34179@debbugs.gnu.org > > >> If I replace the line > >> > >> (with-selected-window (window-normalize-window window t) > >> > >> of 'window-max-chars-per-line' by the line > >> > >> (with-current-buffer (window-buffer window) > >> > >> the problem persists. So it is not the 'select-window' call per se > >> that causes the trouble. > > > > That's because both selecting a window and changing its buffer sets > > windows_or_buffers_changed via redisplay_other_windows. > > But ‘with-current-buffer’ does not change a window's buffer. Or what > am I missing? You are right, but window-font-width called by window-max-chars-per-line also calls select-window. Btw, I don't think replacing with-selected-window with with-current-buffer will necessarily yield the same results. And we cannot in general forbid calls to with-selected-window in hooks called from run_window_change_functions anyway, can we? > >> The problem is with having that separate frame that gets its echo > >> area resized. > > > > What separate frame? > > The one from Michael's scenarios. As in > > I can provoke the hang in emacs -Q by just doing M-x shell, C-x 5 2, > and M-: (message "A\nB"). > > I can't get the hang with a single frame. Can you? OK, but does that change anything? Why is having a separate frame a problem? > >> Using 'window-size-change-functions' (patch attached) instead of > >> 'window-configuration-change-hook' fixes the problem here. > > > > That might be a good change anyway, but the more general problem of > > having an easily triggered infloop in redisplay_internal remains, and > > we should fix that, IMO. > > It's an infloop triggered in ‘window-configuration-change-hook’ and it > was always easy to trigger an infloop there. Not sure I understand what you mean. The loop is in redisplay_internal, not in window-configuration-change-hook. How was it easy to trigger that in the past? And even if it was, shouldn't we avoid such a loop? > > Let me turn the table and ask: why do we need to retry redisplay when > > some function called from run_window_change_functions does something > > that requires redisplay? Why not leave that to the next redisplay > > cycle? > > Bug#34138 is one example why redisplay should be triggered from within > a function on 'window-configuration-change-hook'. I'm not sure, but let's talk again after I study that case, using the recipe graciously provided by Andreas. In any case, it is way too easy to do in functions called from run_window_change_functions something that sets windows_or_buffers_changed, so automatically retrying redisplay based on that variable after run_window_change_functions returns is IMO dangerous.