aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2008-10-22 19:53:33 +0000
committerChong Yidong2008-10-22 19:53:33 +0000
commit794f204ba58a4adcaceca3ac392bdb741c778dd9 (patch)
treef31de94c11113bacdb0455c3f10502f673f73421
parent3e5dbbd39025a8baafa8969bc814441cc9c70392 (diff)
downloademacs-794f204ba58a4adcaceca3ac392bdb741c778dd9.tar.gz
emacs-794f204ba58a4adcaceca3ac392bdb741c778dd9.zip
(Computed Advice): Explain what DEFINITION is.
-rw-r--r--doc/lispref/advice.texi38
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
316Calling @code{ad-add-advice} adds @var{advice} as a piece of advice to 316Calling @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
318this form: 318this 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
324Here @var{protected} and @var{enabled} are flags, and @var{definition} 324@noindent
325is the expression that says what the advice should do. If @var{enabled} 325Here, @var{protected} and @var{enabled} are flags; if @var{protected}
326is @code{nil}, this piece of advice is initially disabled 326is 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 328advice is initially disabled (@pxref{Enabling Advice}).
329If @var{function} already has one or more pieces of advice in the 329@var{definition} should have the form
330specified @var{class}, then @var{position} specifies where in the list 330
331to put the new piece of advice. The value of @var{position} can either 331@example
332be @code{first}, @code{last}, or a number (counting from 0 at the 332(advice . @var{LAMBDA})
333beginning of the list). Numbers outside the range are mapped to the 333@end example
334beginning 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
336advice. 336where @var{LAMBDA} is a lambda expression that is evaluated to run the
337advice. @xref{Lambda Expressions}.
338
339If the @var{function} argument to @code{ad-add-advice} already has one
340or more pieces of advice in the specified @var{class}, then
341@var{position} specifies where in the list to put the new piece of
342advice. The value of @var{position} can either be @code{first},
343@code{last}, or a number (counting from 0 at the beginning of the
344list). Numbers outside the range are mapped to the beginning or the
345end of the range, whichever is closer. The @var{position} value is
346ignored when redefining an existing piece of advice.
337 347
338If @var{function} already has a piece of @var{advice} with the same 348If @var{function} already has a piece of @var{advice} with the same
339name, then the position argument is ignored and the old advice is 349name, then the position argument is ignored and the old advice is