From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Gary Fredericks Newsgroups: gmane.emacs.bugs Subject: bug#32720: term-mode ignores certain window size changes Date: Fri, 16 Nov 2018 06:15:56 -0600 Message-ID: References: <5BDEC23D.4080707@gmx.at> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000e31780057ac72160" X-Trace: blaine.gmane.org 1542370508 9011 195.159.176.226 (16 Nov 2018 12:15:08 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 16 Nov 2018 12:15:08 +0000 (UTC) Cc: 32720@debbugs.gnu.org To: rudalics@gmx.at Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Nov 16 13:15:04 2018 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 1gNd1a-0002DS-Ix for geb-bug-gnu-emacs@m.gmane.org; Fri, 16 Nov 2018 13:15:02 +0100 Original-Received: from localhost ([::1]:44427 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gNd3h-0000Tz-4U for geb-bug-gnu-emacs@m.gmane.org; Fri, 16 Nov 2018 07:17:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54509) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gNd3Z-0000Tq-LA for bug-gnu-emacs@gnu.org; Fri, 16 Nov 2018 07:17:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gNd3W-0000lc-D8 for bug-gnu-emacs@gnu.org; Fri, 16 Nov 2018 07:17:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:50577) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gNd3W-0000lW-8e for bug-gnu-emacs@gnu.org; Fri, 16 Nov 2018 07:17:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gNd3V-00058p-Te for bug-gnu-emacs@gnu.org; Fri, 16 Nov 2018 07:17:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Gary Fredericks Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 16 Nov 2018 12:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32720 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 32720-submit@debbugs.gnu.org id=B32720.154237058019709 (code B ref 32720); Fri, 16 Nov 2018 12:17:01 +0000 Original-Received: (at 32720) by debbugs.gnu.org; 16 Nov 2018 12:16:20 +0000 Original-Received: from localhost ([127.0.0.1]:54833 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gNd2o-00057n-LA for submit@debbugs.gnu.org; Fri, 16 Nov 2018 07:16:20 -0500 Original-Received: from mail-wm1-f44.google.com ([209.85.128.44]:39083) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gNd2l-00057Z-5f for 32720@debbugs.gnu.org; Fri, 16 Nov 2018 07:16:15 -0500 Original-Received: by mail-wm1-f44.google.com with SMTP id u13-v6so20963340wmc.4 for <32720@debbugs.gnu.org>; Fri, 16 Nov 2018 04:16:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=00ayqZodyn4WIyl2ttTJ+9F/Xmz4T+2MuUazls5Xogk=; b=coxfu/jRFY4YioD55zveVjTTNQAg35NBqsPjACFdThsMbS1YoYM7Foqfrct/uOSxoo oc1TBJWQjwSvvYRLx/KijLBjWVr4KfzsqR68dym9AgpChfIW0AZ6FInrzSjoUkLzFTI1 AfLUk3uC8vjgggTg9+HKcQCCd87mvXJK/6E8w4+0ab+dEiannsIiQEYdKvTacvYFNSbG r5hGtIkLrApEwP5Zf4rlgs+BY9akWB1UXX0ZrotSCb7DIHeFbSwM13BIlTszfUiBoQWs 8gW8E2EjdRcJRAqt2Jm8pAZbzAhwbo8oO+gN0pgKLJZ/uhIAPopDc4fHB/qjxmcdQof1 m0xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=00ayqZodyn4WIyl2ttTJ+9F/Xmz4T+2MuUazls5Xogk=; b=k2PZl2wLmzaztd4Gf2sjehzlOteILkAIZZbNurYZCllApto4EqSEmnNqoOAzGqG0CB fIf3Fxz2GewjG7Mb8uACbuNUxbeh/HU87/X8YA5iaBebrwQdC14uz6iD1CVZhTZR2vYJ 70Hyi1ThaVJVGzw8QW22n1B619HPImPYF8lbC2Y+KNs8yJzBtJmmekc0N+9H9OQNrNFo BmdUHinctHaK3fIurJ6Uyk4a208VOHSrYt4Yqnr7/XJvuzHFNgP+W9dvGUaYxvrmEanF jMEN4jwSplRWwCfN1TQCTQLheYHeh8oL+PK5MJ4XzP2R4Zptg/NsC9lR1pktE7hIyvsN kuiA== X-Gm-Message-State: AGRZ1gIJoY0v5uEfDoibWXvS69v9ob+PzPROt5AQ7KUmZRSd1+juhZ5w SuP+ooVC2fGSpVOT69o95PenkEQQW6lcJmk1DuE= X-Google-Smtp-Source: AJdET5dx/NdcPOYG27bW7Yyu/X3zWg+fAbOnS0JgvlgLVTQFRcSG6+9Ce13zuYsyuxv4Yz6Le/8GZKRlLF0PIfby5Tc= X-Received: by 2002:a1c:c10e:: with SMTP id r14mr2378406wmf.147.1542370569163; Fri, 16 Nov 2018 04:16:09 -0800 (PST) In-Reply-To: <5BDEC23D.4080707@gmx.at> 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:152452 Archived-At: --000000000000e31780057ac72160 Content-Type: text/plain; charset="UTF-8" Yep, it seems to work with the patch applied. Gary Fredericks (803)-295-0195 fredericksgary@gmail.com gfredericks.com On Sun, Nov 4, 2018 at 3:56 AM martin rudalics wrote: > > *Affects*: version 26 (git-bisected to commit 8e7712c7afc) > > > > Note: I have only tried this on --without-x emacs > > > > *Steps to reproduce* > > > > 1. start emacs > > 2. start a term buffer with M-x term > > 3. run `seq 1000` at the bash prompt to fill the screen > > 4. enlarge the terminal window that emacs is running in, so that the > > window size changes as well > > 5. run `seq 1000` again, and observe that the new space at the > bottom of > > the buffer is not being used > > > > *Analysis notes* > > > > term-mode *does* pick up changes after more explicit window > configurations, > > like splits; my workaround for months has been to split and join the > > terminal window whenever I've resized it. > > > > As best I can tell, term-mode subscribes to window size changes by > adding > > advice to the window-adjust-process-window-size-function variable, and > the > > 8e7712c7afc reduced the set of situations in which that function is > called. > > > > I've developed a more automated workaround with a term-load-hook of this > > form: > > > > (add-hook 'window-size-change-functions (lambda (_frame) > > (window--adjust-process-windows))) > > > > It might be that adding this line to the term-mode setup steps would be > > sufficient, but I'm not familiar enough with the window.el code to have > a > > guess whether that's actually a good approach. > > While all you write above is correct and I agree with the fix you > propose, I tend to restore the old behavior as with the attached > patch. The reason is that I have no idea in how many more yet > unrevealed occasions my commit had adverse effects so I'd rather be on > the safe side for Emacs 26.2. Please try the patch and tell me > whether it indeed restores the old behavior. > > Thanks, martin > --000000000000e31780057ac72160 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Yep, it seems to work with the patch applied.

Gary Fredericks
(803)-29= 5-0195
fre= dericksgary@gmail.com
gfredericks.com


On Sun, Nov 4, 2018 at 3:56 AM marti= n rudalics <rudalics@gmx.at> w= rote:
=C2=A0> *Affects*: version= 26 (git-bisected to commit 8e7712c7afc)
=C2=A0>
=C2=A0> Note: I have only tried this on --without-x emacs
=C2=A0>
=C2=A0> *Steps to reproduce*
=C2=A0>
=C2=A0>=C2=A0 =C2=A0 =C2=A01. start emacs
=C2=A0>=C2=A0 =C2=A0 =C2=A02. start a term buffer with M-x term
=C2=A0>=C2=A0 =C2=A0 =C2=A03. run `seq 1000` at the bash prompt to fill = the screen
=C2=A0>=C2=A0 =C2=A0 =C2=A04. enlarge the terminal window that emacs is = running in, so that the
=C2=A0>=C2=A0 =C2=A0 =C2=A0window size changes as well
=C2=A0>=C2=A0 =C2=A0 =C2=A05. run `seq 1000` again, and observe that the= new space at the bottom of
=C2=A0>=C2=A0 =C2=A0 =C2=A0the buffer is not being used
=C2=A0>
=C2=A0> *Analysis notes*
=C2=A0>
=C2=A0> term-mode *does* pick up changes after more explicit window conf= igurations,
=C2=A0> like splits; my workaround for months has been to split and join= the
=C2=A0> terminal window whenever I've resized it.
=C2=A0>
=C2=A0> As best I can tell, term-mode subscribes to window size changes = by adding
=C2=A0> advice to the window-adjust-process-window-size-function variabl= e, and the
=C2=A0> 8e7712c7afc reduced the set of situations in which that function= is called.
=C2=A0>
=C2=A0> I've developed a more automated workaround with a term-load-= hook of this
=C2=A0> form:
=C2=A0>
=C2=A0> (add-hook 'window-size-change-functions (lambda (_frame)
=C2=A0> (window--adjust-process-windows)))
=C2=A0>
=C2=A0> It might be that adding this line to the term-mode setup steps w= ould be
=C2=A0> sufficient, but I'm not familiar enough with the window.el c= ode to have a
=C2=A0> guess whether that's actually a good approach.

While all you write above is correct and I agree with the fix you
propose, I tend to restore the old behavior as with the attached
patch.=C2=A0 The reason is that I have no idea in how many more yet
unrevealed occasions my commit had adverse effects so I'd rather be on<= br> the safe side for Emacs 26.2.=C2=A0 Please try the patch and tell me
whether it indeed restores the old behavior.

Thanks, martin
--000000000000e31780057ac72160--