GNU bug report logs - #35272
[PATCH] * lisp/frame.el (frame--size-history): Fix infloop.

Previous Next

Package: emacs;

Reported by: Alex Gramiak <agrambot <at> gmail.com>

Date: Sun, 14 Apr 2019 15:38:02 UTC

Severity: normal

Tags: patch

Done: Alex Gramiak <agrambot <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 35272 in the body.
You can then email your comments to 35272 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#35272; Package emacs. (Sun, 14 Apr 2019 15:38:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Alex Gramiak <agrambot <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 14 Apr 2019 15:38:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Alex Gramiak <agrambot <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] * lisp/frame.el (frame--size-history): Fix infloop.
Date: Sun, 14 Apr 2019 09:37:10 -0600
[Message part 1 (text/plain, inline)]
frame-size-history can be nil, which resulted in an infloop.

[0001-lisp-frame.el-frame-size-history-Fix-infloop.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35272; Package emacs. (Sun, 14 Apr 2019 16:05:02 GMT) Full text and rfc822 format available.

Message #8 received at 35272 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Alex Gramiak <agrambot <at> gmail.com>
Cc: 35272 <at> debbugs.gnu.org
Subject: Re: bug#35272: [PATCH] * lisp/frame.el (frame--size-history): Fix
 infloop.
Date: Sun, 14 Apr 2019 19:04:38 +0300
> From: Alex Gramiak <agrambot <at> gmail.com>
> 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 <agrambot <at> gmail.com>
> 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?

P.S. Regardless, please be sure to mention the bug number when you
push, as it is not in the patch you sent.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35272; Package emacs. (Sun, 14 Apr 2019 16:26:01 GMT) Full text and rfc822 format available.

Message #11 received at 35272 <at> debbugs.gnu.org (full text, mbox):

From: Alex Gramiak <agrambot <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 35272 <at> debbugs.gnu.org
Subject: Re: bug#35272: [PATCH] * lisp/frame.el (frame--size-history): Fix
 infloop.
Date: Sun, 14 Apr 2019 10:25:42 -0600
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Alex Gramiak <agrambot <at> gmail.com>
>> 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 <agrambot <at> gmail.com>
>> 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:

[0001-lisp-frame.el-frame-size-history-Fix-infloop.-Bug-35.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35272; Package emacs. (Sun, 14 Apr 2019 16:34:02 GMT) Full text and rfc822 format available.

Message #14 received at 35272 <at> debbugs.gnu.org (full text, mbox):

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: Alex Gramiak <agrambot <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 35272 <at> debbugs.gnu.org
Subject: Re: bug#35272: [PATCH] * lisp/frame.el (frame--size-history): Fix
 infloop.
Date: Sun, 14 Apr 2019 17:33:31 +0100
Alex Gramiak <agrambot <at> gmail.com> writes:

> +      (when (null frame-size-history)
> +        (insert "No frame size history available.\n")))))

AKA (unless frame-size-history ...), if you prefer.

Thanks,

-- 
Basil




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35272; Package emacs. (Sun, 14 Apr 2019 16:37:01 GMT) Full text and rfc822 format available.

Message #17 received at 35272 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Alex Gramiak <agrambot <at> gmail.com>
Cc: 35272 <at> debbugs.gnu.org
Subject: Re: bug#35272: [PATCH] * lisp/frame.el (frame--size-history): Fix
 infloop.
Date: Sun, 14 Apr 2019 19:35:49 +0300
> From: Alex Gramiak <agrambot <at> gmail.com>
> Cc: 35272 <at> debbugs.gnu.org
> Date: Sun, 14 Apr 2019 10:25:42 -0600
> 
> +      (when (null frame-size-history)
> +        (insert "No frame size history available.\n")))))

LGTM, but maybe say "Frame size history is nil" or some such.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35272; Package emacs. (Sun, 14 Apr 2019 17:45:02 GMT) Full text and rfc822 format available.

Message #20 received at 35272 <at> debbugs.gnu.org (full text, mbox):

From: Alex Gramiak <agrambot <at> gmail.com>
To: "Basil L. Contovounesios" <contovob <at> tcd.ie>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 35272 <at> debbugs.gnu.org
Subject: Re: bug#35272: [PATCH] * lisp/frame.el (frame--size-history): Fix
 infloop.
Date: Sun, 14 Apr 2019 11:43:56 -0600
close 35272
quit

"Basil L. Contovounesios" <contovob <at> tcd.ie> writes:

> Alex Gramiak <agrambot <at> gmail.com> writes:
>
>> +      (when (null frame-size-history)
>> +        (insert "No frame size history available.\n")))))
>
> AKA (unless frame-size-history ...), if you prefer.

Of course, I just felt like being more explicit when I made the commit.
Though unless is generally better, so I used changed the patch to use
it.

It's pushed as e233dedde to master.

P.S. Eli, is there going to be an Emacs 26.3? If so, could this patch
and perhaps the GTK memory leak patches be applied to emacs-26?




bug closed, send any further explanations to 35272 <at> debbugs.gnu.org and Alex Gramiak <agrambot <at> gmail.com> Request was from Alex Gramiak <agrambot <at> gmail.com> to control <at> debbugs.gnu.org. (Sun, 14 Apr 2019 17:45:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35272; Package emacs. (Sun, 14 Apr 2019 18:23:01 GMT) Full text and rfc822 format available.

Message #25 received at 35272 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Alex Gramiak <agrambot <at> gmail.com>
Cc: contovob <at> tcd.ie, 35272 <at> debbugs.gnu.org
Subject: Re: bug#35272: [PATCH] * lisp/frame.el (frame--size-history): Fix
 infloop.
Date: Sun, 14 Apr 2019 21:21:49 +0300
> From: Alex Gramiak <agrambot <at> gmail.com>
> Cc: Eli Zaretskii <eliz <at> gnu.org>,  35272 <at> debbugs.gnu.org
> Date: Sun, 14 Apr 2019 11:43:56 -0600
> 
> P.S. Eli, is there going to be an Emacs 26.3?

I don't know yet.

> If so, could this patch and perhaps the GTK memory leak patches be
> applied to emacs-26?

Yes, you can backport them.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 13 May 2019 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 35 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.