Around-advice lets you "wrap" a Lisp expression "around" the
original function definition. You specify where the original function
definition should go by means of the special symbol ad-do-it.
Where this symbol occurs inside the around-advice body, it is replaced
with a progn containing the forms of the surrounded code. Here
is an example:
(defadvice foo (around foo-around)
"Ignore case in `foo'."
(let ((case-fold-search t))
ad-do-it))
Its effect is to make sure that case is ignored in
searches when the original definition of foo is run.
If the around-advice does not use ad-do-it, then it does not run
the original function definition. This provides a way to override the
original definition completely. (It also overrides lower-positioned
pieces of around-advice).
Go to the first, previous, next, last section, table of contents.