From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Matt Beshara Newsgroups: gmane.emacs.bugs Subject: bug#54380: 29.0.50; Unexpected nil value of 'rest' in 'balance-windows-2' Date: Tue, 15 Mar 2022 21:20:13 +1100 Message-ID: <644A67C2-B669-4000-A2CF-D9101F4868F6@mfa.pw> References: <8735jl9qe9.fsf@mfa.pw> <4a197cfd-2598-95f2-328a-da987b8e722b@gmx.at> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29483"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: K-9 Mail for Android To: martin rudalics , 54380@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Mar 15 11:21:20 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nU4Ip-0007Ry-5K for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 15 Mar 2022 11:21:20 +0100 Original-Received: from localhost ([::1]:39192 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nU4In-00049X-UC for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 15 Mar 2022 06:21:17 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:46628) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nU4IZ-00042Z-Lc for bug-gnu-emacs@gnu.org; Tue, 15 Mar 2022 06:21:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53723) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nU4IY-00046V-Lz for bug-gnu-emacs@gnu.org; Tue, 15 Mar 2022 06:21:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nU4IY-0000rP-HQ for bug-gnu-emacs@gnu.org; Tue, 15 Mar 2022 06:21:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Matt Beshara Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 15 Mar 2022 10:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54380 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 54380-submit@debbugs.gnu.org id=B54380.16473396263242 (code B ref 54380); Tue, 15 Mar 2022 10:21:02 +0000 Original-Received: (at 54380) by debbugs.gnu.org; 15 Mar 2022 10:20:26 +0000 Original-Received: from localhost ([127.0.0.1]:47620 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nU4Hx-0000qD-NQ for submit@debbugs.gnu.org; Tue, 15 Mar 2022 06:20:26 -0400 Original-Received: from out2-smtp.messagingengine.com ([66.111.4.26]:36745) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nU4Hv-0000px-GC for 54380@debbugs.gnu.org; Tue, 15 Mar 2022 06:20:24 -0400 Original-Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 522995C02BB; Tue, 15 Mar 2022 06:20:18 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Tue, 15 Mar 2022 06:20:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mfa.pw; h=cc :content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; bh=nWl9FxD6jKlFU0 AoCxHet5Uf+DNFC/rwGtpsaIJzh5Y=; b=IaXRqG0Fw3EZTbGI/GjgCZxUeO8lLA WcSjms55jd8hfPz1sfTjoMuhGk4DnDMKlvx8ycKUjlRilUzxZOjFoBEqG3xjzOt0 h5rHswUEt35EDhrlNU/o7VjlHR6vte3mODP1tprPoomX1ogSAk6C1rDYFQQfQfCD FQQVg26sIYXGfpOMoGl7aKjGFPf9iseD3o96K0pTOWdWI2k0Qy91s7blHwlS/RIn w2PBLNM0CYl4PrXQ5ZXZot91iJEoTUOlXcQpeY+F/dCkuvO91hGwraHjv+kLQ9UO jKhrwcTZTGCulFEaRjXpEIOKCjiipSEucjR87RLXO/AH/cWSN9/Bd3oQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=nWl9FxD6jKlFU0AoCxHet5Uf+DNFC/rwGtpsaIJzh5Y=; b=jLkFnaOb mmyQScsHZ5NOvMfcxmjioskCl2tKAvUpFSqNWirE+VYmUh/gQfDIxQu/v3/oOyZn rgq1RLLw1QK7JKPb7+DJ65neL5lQ29iBZV89KGmxRT52GIFtG3rvOo5VfCH+DgyO dgWz0coeTxKcY2Qq3VGCpBO4As/JEBiF1wbKzjYo98F/PaTNAQHFNpc1nCKe7wYF 8P7Co3ctMYgdIpEyp4Wj5d6DAeHSWtnmkuAeKIiLQK4bpwN49u8FVbwpgMGxtZGx kvEvXgaEfJEpQOOnrMF+B1aj6/THOHLbSziDuIemHfc2iJY4+HLtmbt5y6FaURD4 nK7VdbsGl6ZKnQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudeftddgudegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdludehmdenucfjughrpeffhffvufgfjghfkfggtgfgsehtqhhmtddt reejnecuhfhrohhmpeforghtthcuuegvshhhrghrrgcuoehmsehmfhgrrdhpfieqnecugg ftrfgrthhtvghrnhephfdvieegfeeiffetgfejiefhteetleelhfdtfffgjedvieethfel ffdthfelffdvnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepmhesmhhfrgdrphif X-ME-Proxy: Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 15 Mar 2022 06:20:16 -0400 (EDT) In-Reply-To: <4a197cfd-2598-95f2-328a-da987b8e722b@gmx.at> Autocrypt: addr=m@mfa.pw; prefer-encrypt=mutual; keydata= mDMEYDt1JBYJKwYBBAHaRw8BAQdAWI792OgF8Aqgs5PGgkhT+OlK6qw3q52lvYU9XZVMKRi0F01h dHQgQmVzaGFyYSA8bUBtZmEucHc+iJMEExYIADsCGwEFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AW IQS81hgar5/gI6IEFWF7dKSbnTn5zAUCYDxbCQIZAQAKCRB7dKSbnTn5zCSUAQDZeGR68VS9RQ5J bgxEtO0sqk4ZIEoXQV8e027Hlm66EgEAiJ+OKRKCZ0g3e4a4DR9IElOt1IodqFxLce4pG8fj/Qa4 OARgO3VMEgorBgEEAZdVAQUBAQdALHhOE6ct04GJ3Xax+XhSbol/8EAxLf6Khc+6sgUIZXkDAQgH iHgEGBYIACAWIQS81hgar5/gI6IEFWF7dKSbnTn5zAUCYDt1TAIbDAAKCRB7dKSbnTn5zKpTAP40 pzHN9zm27r8BeEwYYrpC2pLLO9GPQ1ae3xCH1qVfAQEAlW0aLGpO04WLFEfU/TClgUmXVi7/LaX/ /O+TG1L9VAW4MwRgO3VhFgkrBgEEAdpHDwEBB0DQAyvOfa50S9n3Ka+ZN56YkNSsP52A4pqYPj4D oKFLbYjvBBgWCAAgFiEEvNYYGq+f4COiBBVhe3Skm505+cwFAmA7dWECGwIAgQkQe3Skm505+cx2 IAQZFggAHRYhBACyklZt70z5r2uBhUgi7wm7IjcKBQJgO3VhAAoJEEgi7wm7IjcK7tcBANPxNUdH x+7T4rOPY+VhTh9tfmzENs8tvjS6J3KeK2J0AP0R+KSYoGVnuFvmD3avejIxQ X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:228403 Archived-At: On 14 March 2022 8:30:40 pm AEDT, martin rudalics wrote= : >If the code had used a term like say 'number-of-resizable-children' we >might have been able to avoid this bug in the first place=2E Too bad =2E= =2E=2E > > > Attempting to use =E2=80=98balance-windows=E2=80=99 in a frame display= ing many > > windows, two of which are displaying buffers which both have the > > buffer-local variable =E2=80=98window-size-fixed=E2=80=99 set to t, fa= ils with the > > error =E2=80=9CWrong type argument: number-or-marker-p, nil=E2=80=9D= =2E This error is > > produced by line 5765 of window=2Eel, =E2=80=9C(while (and sub (> rest= 0))=E2=80=9D=2E It > > appears that the code in this function always expects =E2=80=98rest=E2= =80=99 to have a > > non-nil value, but in this case =E2=80=98rest=E2=80=99 is nil=2E Modif= ying line 5765 to > > read =E2=80=9C(while (and sub rest (> rest 0))=E2=80=9D so that it che= cks =E2=80=98rest=E2=80=99 is > > non-nil before attemping to call =E2=80=98>=E2=80=99 seems to fix it= =2E I haven=E2=80=99t > > attached a patch as a patch for a one-line diff seems excessive, but > > if it would be useful, I can provide one=2E > >Thanks for the report=2E The bug is a consequence of the following >sequence of steps in 'balance-windows-2': > >- If an internal window has only fixed-size children, we eventually set > 'number-of-children' to zero here > > (setq number-of-children (1- number-of-children)) > >- We set 'rest' only if 'number-of-children' is greater zero here > > (when (> number-of-children 0) > (setq rest (% total-sum number-of-children)) > >- We ask for the value of 'rest' when a window has at least one child as > > (let* (=2E=2E=2E > (first (window-child window)) > > (setq sub first) > (while (and sub (> rest 0)) > >I checked in a fix, please try with latest master=2E > >Thanks again, martin The fix works very well, thank you=2E