|
From: | Michael Heerdegen |
Subject: | bug#38195: 27.0.50; `edebug-remove-instrumentation' doesn't work for adviced functions |
Date: | Sun, 17 Nov 2019 13:35:49 +0100 |
User-agent: | Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
Stefan Monnier <monnier@iro.umontreal.ca> 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.
[Prev in Thread] | Current Thread | [Next in Thread] |