Go to the first, previous, next, last section, table of contents.


Around-Advice

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.

Variable: ad-do-it
This is not really a variable, but it is somewhat used like one in around-advice. It specifies the place to run the function's original definition and other "earlier" around-advice.

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.