GNU bug report logs - #76778
edebug chokes on cl-macrolet in macro expansions

Previous Next

Package: emacs;

Reported by: Daniel Colascione <dancol <at> dancol.org>

Date: Thu, 6 Mar 2025 09:07:01 UTC

Severity: normal

Full log


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

From: Daniel Colascione <dancol <at> dancol.org>
To: bug-gnu-emacs <at> gnu.org
Subject: edebug chokes on cl-macrolet in macro expansions
Date: Thu, 06 Mar 2025 01:05:48 -0800
In the snippet below, edebug-instrumenting my-fn breaks, but
instrumenting the morally equivalent my-fn2 works.

;; -*- lexical-binding: t -*-

(cl-defmacro my-wrapper (&rest body)
  (declare  (debug (body)))
  `(cl-macrolet ((my-local-macro (x)
                  (declare (debug (sexp)))
                  (cl-check-type x symbol)
                  nil))
    ,@body))

;; edebug instrument this fails the check-type above my-local-macro
;; gets (edebug-after 0 2 thing) instead of thing.
(defun my-fn () (my-wrapper (my-local-macro thing)))

;; edebug instrument works fine
(defun my-fn2 ()
  (cl-macrolet ((my-local-macro (x)
                  (declare (debug (sexp)))
                  (cl-check-type x symbol)
                  nil))
    (my-local-macro thing)))





This bug report was last modified 105 days ago.

Previous Next


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