all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#35272: [PATCH] * lisp/frame.el (frame--size-history): Fix infloop.
@ 2019-04-14 15:37 Alex Gramiak
  2019-04-14 16:04 ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Alex Gramiak @ 2019-04-14 15:37 UTC (permalink / raw)
  To: 35272

[-- Attachment #1: Type: text/plain, Size: 62 bytes --]

frame-size-history can be nil, which resulted in an infloop.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: infloop --]
[-- Type: text/x-patch, Size: 820 bytes --]

From 5695525ed1477e908536d159da670f0f1ab4a369 Mon Sep 17 00:00:00 2001
From: Alexander Gramiak <agrambot@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)))
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* bug#35272: [PATCH] * lisp/frame.el (frame--size-history): Fix infloop.
  2019-04-14 15:37 bug#35272: [PATCH] * lisp/frame.el (frame--size-history): Fix infloop Alex Gramiak
@ 2019-04-14 16:04 ` Eli Zaretskii
  2019-04-14 16:25   ` Alex Gramiak
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2019-04-14 16:04 UTC (permalink / raw)
  To: Alex Gramiak; +Cc: 35272

> From: Alex Gramiak <agrambot@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@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.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#35272: [PATCH] * lisp/frame.el (frame--size-history): Fix infloop.
  2019-04-14 16:04 ` Eli Zaretskii
@ 2019-04-14 16:25   ` Alex Gramiak
  2019-04-14 16:33     ` Basil L. Contovounesios
  2019-04-14 16:35     ` Eli Zaretskii
  0 siblings, 2 replies; 7+ messages in thread
From: Alex Gramiak @ 2019-04-14 16:25 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 35272

[-- Attachment #1: Type: text/plain, Size: 1274 bytes --]

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Alex Gramiak <agrambot@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@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:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: infloop --]
[-- Type: text/x-patch, Size: 1241 bytes --]

From 2231442f515514480a2cfcedc96972dbbe3e93e7 Mon Sep 17 00:00:00 2001
From: Alexander Gramiak <agrambot@gmail.com>
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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* bug#35272: [PATCH] * lisp/frame.el (frame--size-history): Fix infloop.
  2019-04-14 16:25   ` Alex Gramiak
@ 2019-04-14 16:33     ` Basil L. Contovounesios
  2019-04-14 17:43       ` Alex Gramiak
  2019-04-14 16:35     ` Eli Zaretskii
  1 sibling, 1 reply; 7+ messages in thread
From: Basil L. Contovounesios @ 2019-04-14 16:33 UTC (permalink / raw)
  To: Alex Gramiak; +Cc: 35272

Alex Gramiak <agrambot@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





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#35272: [PATCH] * lisp/frame.el (frame--size-history): Fix infloop.
  2019-04-14 16:25   ` Alex Gramiak
  2019-04-14 16:33     ` Basil L. Contovounesios
@ 2019-04-14 16:35     ` Eli Zaretskii
  1 sibling, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2019-04-14 16:35 UTC (permalink / raw)
  To: Alex Gramiak; +Cc: 35272

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





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#35272: [PATCH] * lisp/frame.el (frame--size-history): Fix infloop.
  2019-04-14 16:33     ` Basil L. Contovounesios
@ 2019-04-14 17:43       ` Alex Gramiak
  2019-04-14 18:21         ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Alex Gramiak @ 2019-04-14 17:43 UTC (permalink / raw)
  To: Basil L. Contovounesios; +Cc: 35272

close 35272
quit

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

> Alex Gramiak <agrambot@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?





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#35272: [PATCH] * lisp/frame.el (frame--size-history): Fix infloop.
  2019-04-14 17:43       ` Alex Gramiak
@ 2019-04-14 18:21         ` Eli Zaretskii
  0 siblings, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2019-04-14 18:21 UTC (permalink / raw)
  To: Alex Gramiak; +Cc: contovob, 35272

> From: Alex Gramiak <agrambot@gmail.com>
> Cc: Eli Zaretskii <eliz@gnu.org>,  35272@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.





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-04-14 18:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-14 15:37 bug#35272: [PATCH] * lisp/frame.el (frame--size-history): Fix infloop Alex Gramiak
2019-04-14 16:04 ` Eli Zaretskii
2019-04-14 16:25   ` Alex Gramiak
2019-04-14 16:33     ` Basil L. Contovounesios
2019-04-14 17:43       ` Alex Gramiak
2019-04-14 18:21         ` Eli Zaretskii
2019-04-14 16:35     ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.