GNU bug report logs - #16184
24.3.50; edebug and eval-when-compiler don't work together

Previous Next

Package: emacs;

Reported by: Anders Lindgren <andlind <at> gmail.com>

Date: Wed, 18 Dec 2013 10:59:01 UTC

Severity: normal

Found in version 24.3.50

Done: Alan Mackenzie <acm <at> muc.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Katsumi Yamaoka <yamaoka <at> jpl.org>
To: 16184 <at> debbugs.gnu.org
Cc: Anders Lindgren <andlind <at> gmail.com>
Subject: bug#16184: 24.3.50; edebug and eval-when-compiler don't work together
Date: Fri, 20 Dec 2013 09:01:35 +0900
[Message part 1 (text/plain, inline)]
Anders Lindgren wrote:
> The construct 'eval-when-compile' seems to throw debug off. When
> pressing C-u C-M-x on the following, an error is issued. This worked
> correctly in 24.3. This makes it hard to use edebug on functions in
> cc-mode (like c-font-lock-declarations), as it makes heavy use of
> eval-when-compile.

> (defun test (limit)
>   (eval-when-compile
>     (boundp 'parse-sexp-lookup-properties)))

I'm not sure of it but the patch below seems to solve it.
This works for the bug#14646 case[1], too.  WDYT?

[1] <http://thread.gmane.org/gmane.emacs.bugs/80778>

[Message part 2 (text/x-patch, inline)]
--- lisp/emacs-lisp/byte-run.el~	2013-11-21 22:12:14 +0000
+++ lisp/emacs-lisp/byte-run.el	2013-12-19 23:45:41 +0000
@@ -391,7 +391,7 @@
   "Like `progn', but evaluates the body at compile time if you're compiling.
 Thus, the result of the body appears to the compiler as a quoted constant.
 In interpreted code, this is entirely equivalent to `progn'."
-  (declare (debug (def-body)) (indent 0))
+  (declare (debug (&rest def-form)) (indent 0))
   (list 'quote (eval (cons 'progn body) lexical-binding)))
 
 (defmacro eval-and-compile (&rest body)
--- lisp/progmodes/cc-defs.el~	2013-06-02 22:06:34 +0000
+++ lisp/progmodes/cc-defs.el	2013-12-19 23:45:40 +0000
@@ -1137,7 +1137,7 @@
 ;; Make edebug understand the macros.
 ;(eval-after-load "edebug" ; 2006-07-09: def-edebug-spec is now in subr.el.
 ;  '(progn
-(def-edebug-spec cc-eval-when-compile t)
+(def-edebug-spec cc-eval-when-compile (&rest def-form))
 (def-edebug-spec c-point t)
 (def-edebug-spec c-set-region-active t)
 (def-edebug-spec c-safe t)

This bug report was last modified 8 years and 236 days ago.

Previous Next


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