Subject: bug#29039: closed (Re: bug#29039: `iter-do' doesn't instrument its body)

From: [email-masked] (GNU bug Tracking System)
Date: Fri, 03 Nov 2017 13:53:02 +0000

Your bug report

#29039: `iter-do' doesn't instrument its body

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
29039: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=29039
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#29039: `iter-do' doesn't instrument its body
From: Eli Zaretskii <[email-masked]>
To: Paul Pogonyshev <[email-masked]>
Cc: [email-masked]
Date: Fri, 03 Nov 2017 15:51:51 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

> From: Paul Pogonyshev <[email-masked]>
> Date: Sat, 28 Oct 2017 14:48:14 +0200
> Cc: [email-masked]
> 
> 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.

Subject: `iter-do' doesn't instrument its body
From: Paul Pogonyshev <[email-masked]>
To: [email-masked]
Date: Sat, 28 Oct 2017 13:07:00 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

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
From 40c6256eb7b74cadefe65f23cb6b79336e5b06c1 Mon Sep 17 00:00:00 2001
From: Paul Pogonyshev <[email-masked]>
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