Advice and Byte Code
Not all functions can be reliably advised. The byte compiler may choose to replace a call to a function with a sequence of instructions that doesn’t call the function you were interested in altering.
This usually happens due to one of the three following mechanisms:
-
byte-compileproperties -
If a function’s symbol has a
byte-compileproperty, that property will be used instead of the symbol’s function definition. See Byte-Compilation Functions. -
byte-optimizeproperties -
If a function’s symbol has a
byte-optimizeproperty, the byte compiler may rewrite the function arguments, or decide to use a different function altogether. -
compiler-macrodeclare forms A function can have a special
compiler-macrodeclareform in its definition (see ThedeclareForm) that defines an expander to call when compiling the function. The expander could then cause the produced byte-code not to call the original function.
Copyright © 1990-1996, 1998-2026 Free Software Foundation, Inc.
Licensed under the GNU GPL license.
https://www.gnu.org/software/emacs/manual/html_node/elisp/Advice-and-Byte-Code.html