Next: , Previous: , Up: Api   [Contents][Index]


5.13 Advice

Wise men don’t need advice. Fools won’t take it.

Benjamin Franklin

No enemy is worse than bad advice.

Sophocles

Emacs has a facility to define “advice” these are pieces of code that run before, after, or around an already defined function. This article provides a good example.

Record: <record-of-advice>

How will this work? Before we try to make the macro, let’s focus on building up the functions. We want to have a function that we can substitute for the original function which will have a number of before, after, and around pieces of advice that can be attached to it.

Record: <piece-of-advice>