diff options
| author | Chong Yidong | 2008-10-22 19:53:33 +0000 |
|---|---|---|
| committer | Chong Yidong | 2008-10-22 19:53:33 +0000 |
| commit | 794f204ba58a4adcaceca3ac392bdb741c778dd9 (patch) | |
| tree | f31de94c11113bacdb0455c3f10502f673f73421 | |
| parent | 3e5dbbd39025a8baafa8969bc814441cc9c70392 (diff) | |
| download | emacs-794f204ba58a4adcaceca3ac392bdb741c778dd9.tar.gz emacs-794f204ba58a4adcaceca3ac392bdb741c778dd9.zip | |
(Computed Advice): Explain what DEFINITION is.
| -rw-r--r-- | doc/lispref/advice.texi | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/doc/lispref/advice.texi b/doc/lispref/advice.texi index 35cb4eb338c..56f087e2ab1 100644 --- a/doc/lispref/advice.texi +++ b/doc/lispref/advice.texi | |||
| @@ -314,26 +314,36 @@ using the function @code{ad-add-advice}. | |||
| 314 | 314 | ||
| 315 | @defun ad-add-advice function advice class position | 315 | @defun ad-add-advice function advice class position |
| 316 | Calling @code{ad-add-advice} adds @var{advice} as a piece of advice to | 316 | Calling @code{ad-add-advice} adds @var{advice} as a piece of advice to |
| 317 | @var{function} in class @var{class}. The argument @var{advice} has | 317 | @var{function} in class @var{class}. The argument @var{advice} has |
| 318 | this form: | 318 | this form: |
| 319 | 319 | ||
| 320 | @example | 320 | @example |
| 321 | (@var{name} @var{protected} @var{enabled} @var{definition}) | 321 | (@var{name} @var{protected} @var{enabled} @var{definition}) |
| 322 | @end example | 322 | @end example |
| 323 | 323 | ||
| 324 | Here @var{protected} and @var{enabled} are flags, and @var{definition} | 324 | @noindent |
| 325 | is the expression that says what the advice should do. If @var{enabled} | 325 | Here, @var{protected} and @var{enabled} are flags; if @var{protected} |
| 326 | is @code{nil}, this piece of advice is initially disabled | 326 | is non-@code{nil}, the advice is protected against non-local exits |
| 327 | (@pxref{Enabling Advice}). | 327 | (@pxref{Defining Advice}), and if @var{enabled} is @code{nil} the |
| 328 | 328 | advice is initially disabled (@pxref{Enabling Advice}). | |
| 329 | If @var{function} already has one or more pieces of advice in the | 329 | @var{definition} should have the form |
| 330 | specified @var{class}, then @var{position} specifies where in the list | 330 | |
| 331 | to put the new piece of advice. The value of @var{position} can either | 331 | @example |
| 332 | be @code{first}, @code{last}, or a number (counting from 0 at the | 332 | (advice . @var{LAMBDA}) |
| 333 | beginning of the list). Numbers outside the range are mapped to the | 333 | @end example |
| 334 | beginning or the end of the range, whichever is closer. The | 334 | |
| 335 | @var{position} value is ignored when redefining an existing piece of | 335 | @noindent |
| 336 | advice. | 336 | where @var{LAMBDA} is a lambda expression that is evaluated to run the |
| 337 | advice. @xref{Lambda Expressions}. | ||
| 338 | |||
| 339 | If the @var{function} argument to @code{ad-add-advice} already has one | ||
| 340 | or more pieces of advice in the specified @var{class}, then | ||
| 341 | @var{position} specifies where in the list to put the new piece of | ||
| 342 | advice. The value of @var{position} can either be @code{first}, | ||
| 343 | @code{last}, or a number (counting from 0 at the beginning of the | ||
| 344 | list). Numbers outside the range are mapped to the beginning or the | ||
| 345 | end of the range, whichever is closer. The @var{position} value is | ||
| 346 | ignored when redefining an existing piece of advice. | ||
| 337 | 347 | ||
| 338 | If @var{function} already has a piece of @var{advice} with the same | 348 | If @var{function} already has a piece of @var{advice} with the same |
| 339 | name, then the position argument is ignored and the old advice is | 349 | name, then the position argument is ignored and the old advice is |