Subject: bug#21072: Brave new mark-defun (and a testing tool)

From: Stefan Monnier <[email-masked]>
Date: Sun, 30 Apr 2017 18:03:37 -0400

>>> I guess it's related to the fact that the first argument is evaluated by
>>> the macro itself at compile time, with (debug t) or (debug form body) I
>>> get an error when trying to instrument one of tests using that macro:
>> 
>> Yes, you can either use (debug (sexp body)) to avoid instrumenting the
>> first arg, or you might use (debug (def-form body)) so as to warn that
>> the first argument is not evaluated at the "normal" time.

> I'm not sure exactly what def-form means, but using it gives a similar
> error.

> Debugger entered--Lisp error: (wrong-type-argument char-or-string-p
> (edebug-enter (quote test@mark-defun-no-arg-region-inactive) nil (function
> (lambda nil (edebug-after 0 3 mark-defun-test-buffer)))))
>   insert((edebug-enter (quote test@mark-defun-no-arg-region-inactive) nil
> (function (lambda nil (edebug-after 0 3 mark-defun-test-buffer)))))
>   [...]

This suggests that the first arg is not "evaluated by the macro itself
at compile time", but instead is passed unevaluated to `insert`, in
which case it can't be instrumented.

        Stefan