GNU bug report logs - #29919
26.0.90; Incorrect Edebug spec for cl-macrolet

Previous Next

Package: emacs;

Reported by: Gemini Lasswell <gazally <at> runbox.com>

Date: Sun, 31 Dec 2017 21:37:02 UTC

Severity: normal

Tags: fixed

Merged with 30348

Found in versions 26.0.90, 26.0.91

Fixed in version 27.1

Done: Gemini Lasswell <gazally <at> runbox.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 29919 in the body.
You can then email your comments to 29919 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#29919; Package emacs. (Sun, 31 Dec 2017 21:37:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Gemini Lasswell <gazally <at> runbox.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 31 Dec 2017 21:37:02 GMT) Full text and rfc822 format available.

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

From: Gemini Lasswell <gazally <at> runbox.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.0.90; Incorrect Edebug spec for cl-macrolet
Date: Sun, 31 Dec 2017 13:36:17 -0800
Edebug gives an error when trying to instrument a function which uses
cl-macrolet to define a macro with an argument list containing &rest.

To reproduce, enter the following into *scratch*:

(defun bug (x)
  (cl-macrolet ((wrap (func &rest args)
		      `(progn
			 (message "%s" ',args)
			 (funcall #',func ,@args))))
    (wrap + 1 x)))

Then C-u C-M-x.

Result: edebug-syntax-error: Invalid read syntax: "Failed matching"

Looks to me like the problem is that the Edebug spec is using (&rest arg)
when it should be using cl-macro-list, assuming that cl-macrolet
supports full CL argument lists.




Merged 29919 30348. Request was from Noam Postavsky <npostavs <at> users.sourceforge.net> to control <at> debbugs.gnu.org. (Sun, 04 Feb 2018 16:12:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#29919; Package emacs. (Tue, 24 Jul 2018 23:22:01 GMT) Full text and rfc822 format available.

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

From: Gemini Lasswell <geminilasswell <at> runbox.com>
To: Gemini Lasswell <gazally <at> runbox.com>
Cc: 29919 <at> debbugs.gnu.org, Kaushal Modi <kaushal.modi <at> gmail.com>
Subject: Re: bug#29919: 26.0.90; Incorrect Edebug spec for cl-macrolet
Date: Tue, 24 Jul 2018 16:20:42 -0700
[Message part 1 (text/plain, inline)]
Gemini Lasswell <gazally <at> runbox.com> writes:

> Edebug gives an error when trying to instrument a function which uses
> cl-macrolet to define a macro with an argument list containing &rest.
>
> Looks to me like the problem is that the Edebug spec is using (&rest arg)
> when it should be using cl-macro-list, assuming that cl-macrolet
> supports full CL argument lists.

That was one of the problems, and the other problem was that Edebug
would wrap all the arguments to the temporary macros, even those that
are not evaluated, causing breakage. I solved that in the attached patch
by writing Edebug match functions for cl-macrolet which treat the
temporary macros like normal macros without Edebug specs, which means
none of their arguments get wrapped. This fixes the breakage but means
you can't Edebug through those of the arguments which do get evaluated.
To do that we'd have to add the ability to have (declare (debug ...))
forms in the temporary macro bodies so that they could have temporary
Edebug specs, which would mean changing cl-macrolet itself instead of
just its Edebug spec.

Kaushal, I was able to step through org-export-data with this patch in
place.  Let me know if you are able to give it a try.

[0001-Fix-Edebug-spec-for-cl-macrolet-bug-29919.patch (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#29919; Package emacs. (Wed, 25 Jul 2018 22:25:01 GMT) Full text and rfc822 format available.

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

From: Kaushal Modi <kaushal.modi <at> gmail.com>
To: Gemini Lasswell <geminilasswell <at> runbox.com>
Cc: 29919 <at> debbugs.gnu.org
Subject: Re: bug#29919: 26.0.90; Incorrect Edebug spec for cl-macrolet
Date: Wed, 25 Jul 2018 18:24:09 -0400
[Message part 1 (text/plain, inline)]
On Tue, Jul 24, 2018 at 7:21 PM Gemini Lasswell <geminilasswell <at> runbox.com>
wrote:

>
> Kaushal, I was able to step through org-export-data with this patch in
> place.  Let me know if you are able to give it a try.
>

Hello,

Thanks for pinging me to try this out.

I am currently on

Emacs version: GNU Emacs 27.0.50 (build 3, x86_64-pc-linux-gnu, GTK+
Version 2.24.23)
 of 2018-07-24, built using commit 0ed21b7b3e71303d7858192246012f4b26438ad8.

.. and looks like that sluggishness on edebug of Org exporter functions due
to info already got resolved with one of the commits on master branch since
I last responded in this thread.

Because even without your patch, the edebug of info var is quite snappy.

I can though confirm that even after applying your patch (I don't
understand exactly what it's doing as I haven't yet learnt about
cl-macrolet), the edebug of Org export functions with info var is still
snappy.
-- 

Kaushal Modi
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#29919; Package emacs. (Fri, 27 Jul 2018 19:11:01 GMT) Full text and rfc822 format available.

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

From: Gemini Lasswell <gazally <at> runbox.com>
To: Kaushal Modi <kaushal.modi <at> gmail.com>
Cc: 29919 <at> debbugs.gnu.org
Subject: Re: bug#29919: 26.0.90; Incorrect Edebug spec for cl-macrolet
Date: Fri, 27 Jul 2018 12:10:14 -0700
Kaushal Modi <kaushal.modi <at> gmail.com> writes:

> .. and looks like that sluggishness on edebug of Org exporter functions due to info already got resolved with one of the commits on master branch since I last responded in this thread.
>
> Because even without your patch, the edebug of info var is quite snappy.
>
> I can though confirm that even after applying your patch (I don't understand exactly what it's doing as I haven't yet learnt about cl-macrolet), the edebug of Org export functions with info
> var is still snappy.

Hi Kaushal,

Thanks for giving it a try. It was the fix for #31559 which made
Edebugging large data structures faster. This patch fixes the
edebug-syntax-error message that happened when you tried to debug code
containing a cl-macrolet.




Added tag(s) fixed. Request was from Gemini Lasswell <gazally <at> runbox.com> to control <at> debbugs.gnu.org. (Thu, 02 Aug 2018 16:11:03 GMT) Full text and rfc822 format available.

bug marked as fixed in version 27.1, send any further explanations to 29919 <at> debbugs.gnu.org and Gemini Lasswell <gazally <at> runbox.com> Request was from Gemini Lasswell <gazally <at> runbox.com> to control <at> debbugs.gnu.org. (Thu, 02 Aug 2018 16:11:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 31 Aug 2018 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 230 days ago.

Previous Next


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