Mercurial > emacs
comparison lispref/advice.texi @ 51753:d42b31a4657f
(Activation of Advice): Note that ad-start-advice is turned on by default.
author | Markus Rost <rost@math.uni-bielefeld.de> |
---|---|
date | Sun, 06 Jul 2003 01:31:34 +0000 |
parents | a81c039e79f9 |
children | 0eb7f2196a0c |
comparison
equal
deleted
inserted
replaced
51752:f5c310fd1ff2 | 51753:d42b31a4657f |
---|---|
329 @section Activation of Advice | 329 @section Activation of Advice |
330 @cindex activating advice | 330 @cindex activating advice |
331 @cindex advice, activating | 331 @cindex advice, activating |
332 | 332 |
333 By default, advice does not take effect when you define it---only when | 333 By default, advice does not take effect when you define it---only when |
334 you @dfn{activate} advice for the function that was advised. You can | 334 you @dfn{activate} advice for the function that was advised. However |
335 request the activation of advice for a function when you define the | 335 the advice will be automatically activated when the function is |
336 advice, by specifying the @code{activate} flag in the @code{defadvice}. | 336 defined or redefined later. You can request the activation of advice |
337 But normally you activate the advice for a function by calling the | 337 for a function when you define the advice, by specifying the |
338 function @code{ad-activate} or one of the other activation commands | 338 @code{activate} flag in the @code{defadvice}. But normally you |
339 listed below. | 339 activate the advice for a function by calling the function |
340 @code{ad-activate} or one of the other activation commands listed | |
341 below. | |
340 | 342 |
341 Separating the activation of advice from the act of defining it permits | 343 Separating the activation of advice from the act of defining it permits |
342 you to add several pieces of advice to one function efficiently, without | 344 you to add several pieces of advice to one function efficiently, without |
343 redefining the function over and over as each advice is added. More | 345 redefining the function over and over as each advice is added. More |
344 importantly, it permits defining advice for a function before that | 346 importantly, it permits defining advice for a function before that |
414 last time it was activated. | 416 last time it was activated. |
415 @end deffn | 417 @end deffn |
416 | 418 |
417 @deffn Command ad-start-advice | 419 @deffn Command ad-start-advice |
418 Turn on automatic advice activation when a function is defined or | 420 Turn on automatic advice activation when a function is defined or |
419 redefined. If you turn on this mode, then advice takes effect | 421 redefined. This mode is turned on by default. |
420 immediately when defined. | |
421 @end deffn | 422 @end deffn |
422 | 423 |
423 @deffn Command ad-stop-advice | 424 @deffn Command ad-stop-advice |
424 Turn off automatic advice activation when a function is defined or | 425 Turn off automatic advice activation when a function is defined or |
425 redefined. | 426 redefined. |