Subject: bug#38195: 27.0.50; `edebug-remove-instrumentation' doesn't work for adviced functions

From: Michael Heerdegen <[email-masked]>
Date: Sun, 17 Nov 2019 13:35:49 +0100

Stefan Monnier <[email-masked]> writes:

> I'm not sure how to write the doc to make it more clear, tho (largely
> because it's just too obvious to me that it's the only way it can
> work), so if you have a suggestion, fell free to send it.

I think - although it would add some more lines - an example would be
best to illustrate that fact.  How about something like this?

  Advising macros operates on the defining expander functions.
  Example: to prepend a `debug' call to any expansion of `my-macro'
  you could do

  (advice-add 'my-macro
              :around
              (lambda (original-expander &rest macro-args)
                `(progn
                   (debug)
                   ,(apply original-expander macro-args)))
              '((name . debug-expanded-code)))

Michael.