From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alex Gramiak Newsgroups: gmane.emacs.bugs Subject: bug#35272: [PATCH] * lisp/frame.el (frame--size-history): Fix infloop. Date: Sun, 14 Apr 2019 10:25:42 -0600 Message-ID: <8736mkv9ix.fsf@gmail.com> References: <87bm18vbrt.fsf@gmail.com> <83zhosine1.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="50069"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) Cc: 35272@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Apr 14 18:26:14 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 1hFhxN-000CuS-Px for geb-bug-gnu-emacs@m.gmane.org; Sun, 14 Apr 2019 18:26:14 +0200 Original-Received: from localhost ([127.0.0.1]:37689 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hFhxM-00055q-P4 for geb-bug-gnu-emacs@m.gmane.org; Sun, 14 Apr 2019 12:26:12 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:35363) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hFhxG-00055J-78 for bug-gnu-emacs@gnu.org; Sun, 14 Apr 2019 12:26:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hFhxD-00029Y-Qy for bug-gnu-emacs@gnu.org; Sun, 14 Apr 2019 12:26:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47755) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hFhxC-00028E-7f for bug-gnu-emacs@gnu.org; Sun, 14 Apr 2019 12:26:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hFhxC-0002RI-08 for bug-gnu-emacs@gnu.org; Sun, 14 Apr 2019 12:26:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alex Gramiak Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 14 Apr 2019 16:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35272 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 35272-submit@debbugs.gnu.org id=B35272.15552591509347 (code B ref 35272); Sun, 14 Apr 2019 16:26:01 +0000 Original-Received: (at 35272) by debbugs.gnu.org; 14 Apr 2019 16:25:50 +0000 Original-Received: from localhost ([127.0.0.1]:33066 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hFhwz-0002Qh-Mb for submit@debbugs.gnu.org; Sun, 14 Apr 2019 12:25:49 -0400 Original-Received: from mail-pf1-f170.google.com ([209.85.210.170]:37231) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hFhwy-0002QV-5C for 35272@debbugs.gnu.org; Sun, 14 Apr 2019 12:25:48 -0400 Original-Received: by mail-pf1-f170.google.com with SMTP id 8so7406418pfr.4 for <35272@debbugs.gnu.org>; Sun, 14 Apr 2019 09:25:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=PXZTrvJuyaicS1Mg4tPtnty0p6rxZUy+miynvunmTwI=; b=M/wjGxtUqxQ6vR2tlCgKWWc3kD6JIy3YM2igq44cLgKbRzB7cK716y+ZAd9nN0Nxyh Ya5LpxHBcyC8vEgq+7bBNez5oJc2xMTq9yAzKk3cHto+CjmT+DX4V+lBsMmhRhCwcTvQ MXqrZJKP5Dbj4ZxqLIpV/D10UispwLa9jnqeDuxkKxmHv02wNdz9P9bzk1rFHPhpRoZu tpDpJt/cDIb1liHy93Ibw2Lcq5h0X9Lm4dOroPfH5RQdV7S1y0xsKrrohC+8a2/WIjz/ h8nPhV6/iMqrIwOZjSGUT2NC+8AXp7Xc99QcIkDIa5YJr4XrqNT4+6CDsNb6k94gquvI fQsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=PXZTrvJuyaicS1Mg4tPtnty0p6rxZUy+miynvunmTwI=; b=N+IfiKy3khAs43FzfahYZwnvfj0Iz+FLTI4hkntMAnjPE4NqTW+hPfA8R1vTZsoW8W sU/4aNCzGPzbB+e9fH9TRr/BDA1j6ON2mpKmbqIMHx5nEBv0F6rzWk104RGbKPt7iAkz z97R/RsZII+DgyGQ/KfAiO+zoWwn1FKS6DdF1XKZhoAXzMYafSm8dL/z1cRqX1tdpqAa SbXIH+RPKEim71eCL3kcbysC1adVFe1sXlZzmesvyBoyVHdylJE0fuCqmFCIWhPJYq03 H2ktTIlfyc371FJaKnKdSKqFN3jt5U4zg88rxhEI9poVPzWrSkdVL3+VSPs/jdaomGaC vo4Q== X-Gm-Message-State: APjAAAU5RhMUh1FwLs7L7L9hs+Ct+5ujHsaNwK+VkrdqLPpjGGnW6Q3E 98RqYJq5mNVOSsS0uvylXLchDzl2 X-Google-Smtp-Source: APXvYqywABrE3L9h4p9TzX6cV4Y7PUYYd0l9lCs2/iC4iMR5Skx6urCzxtETCxyJvvBvJhObHItGaw== X-Received: by 2002:a62:1881:: with SMTP id 123mr69875626pfy.25.1555259141940; Sun, 14 Apr 2019 09:25:41 -0700 (PDT) Original-Received: from lylat ([2604:3d09:e37f:1500:1a72:4878:e793:7302]) by smtp.gmail.com with ESMTPSA id f6sm46895600pgq.11.2019.04.14.09.25.40 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 14 Apr 2019 09:25:41 -0700 (PDT) In-Reply-To: <83zhosine1.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 14 Apr 2019 19:04:38 +0300") 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:157632 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> From: Alex Gramiak >> Date: Sun, 14 Apr 2019 09:37:10 -0600 >> >> frame-size-history can be nil, which resulted in an infloop. >> >> >From 5695525ed1477e908536d159da670f0f1ab4a369 Mon Sep 17 00:00:00 2001 >> From: Alexander Gramiak >> Date: Sun, 14 Apr 2019 09:27:50 -0600 >> Subject: [PATCH] * lisp/frame.el (frame--size-history): Fix infloop. >> >> --- >> lisp/frame.el | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/lisp/frame.el b/lisp/frame.el >> index b5c936a51e..6f9e769e16 100644 >> --- a/lisp/frame.el >> +++ b/lisp/frame.el >> @@ -1610,7 +1610,7 @@ frame--size-history >> (with-current-buffer (get-buffer-create "*frame-size-history*") >> (erase-buffer) >> (insert (format "Frame size history of %s\n" frame)) >> - (while (listp (setq entry (pop history))) >> + (while (consp (setq entry (pop history))) >> (when (eq (car entry) frame) >> (pop entry) >> (insert (format "%s" (pop entry))) > > Thanks. > > But wouldn't it be better to special-case the nil value, and display > something to that effect, instead of just nothing after the header? I suppose so. Here's a version which does that: --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-lisp-frame.el-frame-size-history-Fix-infloop.-Bug-35.patch Content-Description: infloop >From 2231442f515514480a2cfcedc96972dbbe3e93e7 Mon Sep 17 00:00:00 2001 From: Alexander Gramiak Date: Sun, 14 Apr 2019 09:27:50 -0600 Subject: [PATCH] * lisp/frame.el (frame--size-history): Fix infloop. (Bug#35272) --- lisp/frame.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/frame.el b/lisp/frame.el index b5c936a51e..a4a597af02 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -1610,14 +1610,16 @@ frame--size-history (with-current-buffer (get-buffer-create "*frame-size-history*") (erase-buffer) (insert (format "Frame size history of %s\n" frame)) - (while (listp (setq entry (pop history))) + (while (consp (setq entry (pop history))) (when (eq (car entry) frame) (pop entry) (insert (format "%s" (pop entry))) (move-to-column 24 t) (while entry (insert (format " %s" (pop entry)))) - (insert "\n")))))) + (insert "\n"))) + (when (null frame-size-history) + (insert "No frame size history available.\n"))))) (declare-function x-frame-edges "xfns.c" (&optional frame type)) (declare-function w32-frame-edges "w32fns.c" (&optional frame type)) -- 2.21.0 --=-=-=--