unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#29039: `iter-do' doesn't instrument its body
@ 2017-10-28 11:07 Paul Pogonyshev
  2017-10-28 11:32 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Pogonyshev @ 2017-10-28 11:07 UTC (permalink / raw)
  To: 29039

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

Attached trivial patch simply adds `(declare (debug ...))' to the
macro. I believe it is perfectly safe and trivial, no mention in NEWS
etc. is needed. I would ask to merge it to branch 26 if possible.

Note that it doesn't quite let you debug generators anyway because of
bug #28725, but the change makes sense regardless. In particular, with
`iter2' package you should be able to debug generator functions called
from `iter-do'.

Paul

[-- Attachment #2: 0001-Add-missing-debug-declaration-to-iter-do.patch --]
[-- Type: text/x-patch, Size: 952 bytes --]

From 40c6256eb7b74cadefe65f23cb6b79336e5b06c1 Mon Sep 17 00:00:00 2001
From: Paul Pogonyshev <pogonyshev@gmail.com>
Date: Sat, 28 Oct 2017 13:01:51 +0200
Subject: [PATCH] Add missing debug declaration to `iter-do'

---
 lisp/emacs-lisp/generator.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/emacs-lisp/generator.el b/lisp/emacs-lisp/generator.el
index 410e4edcc9..ef6cfba420 100644
--- a/lisp/emacs-lisp/generator.el
+++ b/lisp/emacs-lisp/generator.el
@@ -718,7 +718,8 @@ iter-close
   "Loop over values from an iterator.
 Evaluate BODY with VAR bound to each value from ITERATOR.
 Return the value with which ITERATOR finished iteration."
-  (declare (indent 1))
+  (declare (indent 1)
+           (debug ((symbolp form) body)))
   (let ((done-symbol (cps--gensym "iter-do-iterator-done"))
         (condition-symbol (cps--gensym "iter-do-condition"))
         (it-symbol (cps--gensym "iter-do-iterator"))
-- 
2.14.2


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

* bug#29039: `iter-do' doesn't instrument its body
  2017-10-28 11:07 bug#29039: `iter-do' doesn't instrument its body Paul Pogonyshev
@ 2017-10-28 11:32 ` Eli Zaretskii
  2017-10-28 12:48   ` Paul Pogonyshev
  0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2017-10-28 11:32 UTC (permalink / raw)
  To: Paul Pogonyshev; +Cc: 29039

> From: Paul Pogonyshev <pogonyshev@gmail.com>
> Date: Sat, 28 Oct 2017 13:07:00 +0200
> 
> Attached trivial patch simply adds `(declare (debug ...))' to the
> macro. I believe it is perfectly safe and trivial, no mention in NEWS
> etc. is needed. I would ask to merge it to branch 26 if possible.

Why do you want it on the emacs-26 branch?

Thanks.





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

* bug#29039: `iter-do' doesn't instrument its body
  2017-10-28 11:32 ` Eli Zaretskii
@ 2017-10-28 12:48   ` Paul Pogonyshev
  2017-11-03 13:51     ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Pogonyshev @ 2017-10-28 12:48 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 29039

Because it allows debugging generator functions with `iter2' package.
`iter2' replaces only `iter-defun' and `iter-lambda', but uses all the
rest of infrastructure (`iter-yield', `iter-next', `iter-do' and so
on).

I'm 100% sure this change cannot break anything in `generator' and is
logical in itself.

Paul

On 28 October 2017 at 13:32, Eli Zaretskii <eliz@gnu.org> wrote:
>> From: Paul Pogonyshev <pogonyshev@gmail.com>
>> Date: Sat, 28 Oct 2017 13:07:00 +0200
>>
>> Attached trivial patch simply adds `(declare (debug ...))' to the
>> macro. I believe it is perfectly safe and trivial, no mention in NEWS
>> etc. is needed. I would ask to merge it to branch 26 if possible.
>
> Why do you want it on the emacs-26 branch?
>
> Thanks.





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

* bug#29039: `iter-do' doesn't instrument its body
  2017-10-28 12:48   ` Paul Pogonyshev
@ 2017-11-03 13:51     ` Eli Zaretskii
  0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2017-11-03 13:51 UTC (permalink / raw)
  To: Paul Pogonyshev; +Cc: 29039-done

> From: Paul Pogonyshev <pogonyshev@gmail.com>
> Date: Sat, 28 Oct 2017 14:48:14 +0200
> Cc: 29039@debbugs.gnu.org
> 
> Because it allows debugging generator functions with `iter2' package.
> `iter2' replaces only `iter-defun' and `iter-lambda', but uses all the
> rest of infrastructure (`iter-yield', `iter-next', `iter-do' and so
> on).
> 
> I'm 100% sure this change cannot break anything in `generator' and is
> logical in itself.

Thanks, pushed.





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

end of thread, other threads:[~2017-11-03 13:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-28 11:07 bug#29039: `iter-do' doesn't instrument its body Paul Pogonyshev
2017-10-28 11:32 ` Eli Zaretskii
2017-10-28 12:48   ` Paul Pogonyshev
2017-11-03 13:51     ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).