/[emacs]/emacs/lispref/advice.texi
ViewVC logotype

Diff of /emacs/lispref/advice.texi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.17.2.1 by miles, Mon Apr 19 07:01:40 2004 UTC revision 1.17.2.2 by miles, Thu Nov 4 08:55:38 2004 UTC
# Line 51  is @code{nil}.) Line 51  is @code{nil}.)
51    
52    Suppose you wanted to add a similar feature to @code{previous-line},    Suppose you wanted to add a similar feature to @code{previous-line},
53  which would insert a new line at the beginning of the buffer for the  which would insert a new line at the beginning of the buffer for the
54  command to move to.  How could you do this?  command to move to (when @code{next-line-add-newlines} is
55    non-@code{nil}).  How could you do this?
56    
57    You could do it by redefining the whole function, but that is not    You could do it by redefining the whole function, but that is not
58  modular.  The advice feature provides a cleaner alternative: you can  modular.  The advice feature provides a cleaner alternative: you can
# Line 273  Its effect is to make sure that case is Line 274  Its effect is to make sure that case is
274  searches when the original definition of @code{foo} is run.  searches when the original definition of @code{foo} is run.
275    
276  @defvar ad-do-it  @defvar ad-do-it
277  This is not really a variable, but it is somewhat used like one  This is not really a variable, rather a place-holder that looks like a
278  in around-advice.  It specifies the place to run the function's  variable.  You use it in around-advice to specify the place to run the
279  original definition and other ``earlier'' around-advice.  function's original definition and other ``earlier'' around-advice.
280  @end defvar  @end defvar
281    
282  If the around-advice does not use @code{ad-do-it}, then it does not run  If the around-advice does not use @code{ad-do-it}, then it does not run
# Line 360  advice. Line 361  advice.
361  This command activates all the advice defined for @var{function}.  This command activates all the advice defined for @var{function}.
362  @end deffn  @end deffn
363    
364  To activate advice for a function whose advice is already active is not    Activating advice does nothing if @var{function}'s advice is already
365  a no-op.  It is a useful operation which puts into effect any changes in  active.  But if there is new advice, added since the previous time you
366  that function's advice since the previous activation of advice for that  activated advice for @var{function}, it activates the new advice.
 function.  
367    
368  @deffn Command ad-deactivate function  @deffn Command ad-deactivate function
369  This command deactivates the advice for @var{function}.  This command deactivates the advice for @var{function}.
# Line 430  This variable controls whether to compil Line 430  This variable controls whether to compil
430  that results from activating advice for a function.  that results from activating advice for a function.
431    
432  A value of @code{always} specifies to compile unconditionally.  A value of @code{always} specifies to compile unconditionally.
433  A value of @code{nil} specifies never compile the advice.  A value of @code{never} specifies never compile the advice.
434    
435  A value of @code{maybe} specifies to compile if the byte-compiler is  A value of @code{maybe} specifies to compile if the byte-compiler is
436  already loaded.  A value of @code{like-original} specifies to compile  already loaded.  A value of @code{like-original} specifies to compile

Legend:
Removed from v.1.17.2.1  
changed lines
  Added in v.1.17.2.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26