aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2004-10-27 14:54:18 +0000
committerRichard M. Stallman2004-10-27 14:54:18 +0000
commitf91f2dcc78bde3379c6f8152369a7d6858353b5e (patch)
tree5db585ba187e8e006deebbf8c82c553f86c91b89
parentec9f1dd3ece76f5967b6ae3904b32ad2aced2125 (diff)
downloademacs-f91f2dcc78bde3379c6f8152369a7d6858353b5e.tar.gz
emacs-f91f2dcc78bde3379c6f8152369a7d6858353b5e.zip
(Simple Advice): Clarify what job the example does.
(Around-Advice): Clarify ad-do-it. (Activation of Advice): An option of ad-default-compilation-action is `never', not `nil'.
-rw-r--r--lispref/advice.texi18
1 files changed, 9 insertions, 9 deletions
diff --git a/lispref/advice.texi b/lispref/advice.texi
index 46d4f96a35b..ae22fecc1fb 100644
--- a/lispref/advice.texi
+++ b/lispref/advice.texi
@@ -51,7 +51,8 @@ is @code{nil}.)
51 51
52 Suppose you wanted to add a similar feature to @code{previous-line}, 52 Suppose you wanted to add a similar feature to @code{previous-line},
53which would insert a new line at the beginning of the buffer for the 53which would insert a new line at the beginning of the buffer for the
54command to move to. How could you do this? 54command to move to (when @code{next-line-add-newlines} is
55non-@code{nil}). How could you do this?
55 56
56 You could do it by redefining the whole function, but that is not 57 You could do it by redefining the whole function, but that is not
57modular. The advice feature provides a cleaner alternative: you can 58modular. The advice feature provides a cleaner alternative: you can
@@ -273,9 +274,9 @@ Its effect is to make sure that case is ignored in
273searches when the original definition of @code{foo} is run. 274searches when the original definition of @code{foo} is run.
274 275
275@defvar ad-do-it 276@defvar ad-do-it
276This is not really a variable, but it is somewhat used like one 277This is not really a variable, rather a place-holder that looks like a
277in around-advice. It specifies the place to run the function's 278variable. You use it in around-advice to specify the place to run the
278original definition and other ``earlier'' around-advice. 279function's original definition and other ``earlier'' around-advice.
279@end defvar 280@end defvar
280 281
281If the around-advice does not use @code{ad-do-it}, then it does not run 282If the around-advice does not use @code{ad-do-it}, then it does not run
@@ -360,10 +361,9 @@ advice.
360This command activates all the advice defined for @var{function}. 361This command activates all the advice defined for @var{function}.
361@end deffn 362@end deffn
362 363
363To activate advice for a function whose advice is already active is not 364 Activating advice does nothing if @var{function}'s advice is already
364a no-op. It is a useful operation which puts into effect any changes in 365active. But if there is new advice, added since the previous time you
365that function's advice since the previous activation of advice for that 366activated advice for @var{function}, it activates the new advice.
366function.
367 367
368@deffn Command ad-deactivate function 368@deffn Command ad-deactivate function
369This command deactivates the advice for @var{function}. 369This command deactivates the advice for @var{function}.
@@ -430,7 +430,7 @@ This variable controls whether to compile the combined definition
430that results from activating advice for a function. 430that results from activating advice for a function.
431 431
432A value of @code{always} specifies to compile unconditionally. 432A value of @code{always} specifies to compile unconditionally.
433A value of @code{nil} specifies never compile the advice. 433A value of @code{never} specifies never compile the advice.
434 434
435A value of @code{maybe} specifies to compile if the byte-compiler is 435A value of @code{maybe} specifies to compile if the byte-compiler is
436already loaded. A value of @code{like-original} specifies to compile 436already loaded. A value of @code{like-original} specifies to compile