aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2010-01-16 16:20:43 -0500
committerChong Yidong2010-01-16 16:20:43 -0500
commitbbdc98eff1533440f7f7633acf07b7f29c037a11 (patch)
treef54e6b4669b60073c303b27514048eea7761e5a9
parentabd5cfe880473c8da925d5b83e52c8019803d87d (diff)
downloademacs-bbdc98eff1533440f7f7633acf07b7f29c037a11.tar.gz
emacs-bbdc98eff1533440f7f7633acf07b7f29c037a11.zip
* emacs-lisp/advice.el (ad-add-advice): Doc fix (Bug#5274)
-rw-r--r--lisp/ChangeLog2
-rw-r--r--lisp/emacs-lisp/advice.el32
2 files changed, 24 insertions, 10 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 5ff2d7b24c0..40dd8ff0a96 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -4,6 +4,8 @@
4 4
52010-01-16 Chong Yidong <cyd@stupidchicken.com> 52010-01-16 Chong Yidong <cyd@stupidchicken.com>
6 6
7 * emacs-lisp/advice.el (ad-add-advice): Doc fix (Bug#5274)
8
7 * emacs-lisp/cl-macs.el (defstruct): Doc fix (Bug#5267). 9 * emacs-lisp/cl-macs.el (defstruct): Doc fix (Bug#5267).
8 10
9 * startup.el (command-line): Remove unused --icon-type arg. 11 * startup.el (command-line): Remove unused --icon-type arg.
diff --git a/lisp/emacs-lisp/advice.el b/lisp/emacs-lisp/advice.el
index 46522991418..bac24b63021 100644
--- a/lisp/emacs-lisp/advice.el
+++ b/lisp/emacs-lisp/advice.el
@@ -2422,16 +2422,28 @@ in that CLASS."
2422;;;###autoload 2422;;;###autoload
2423(defun ad-add-advice (function advice class position) 2423(defun ad-add-advice (function advice class position)
2424 "Add a piece of ADVICE to FUNCTION's list of advices in CLASS. 2424 "Add a piece of ADVICE to FUNCTION's list of advices in CLASS.
2425If FUNCTION already has one or more pieces of advice of the specified 2425
2426CLASS then POSITION determines where the new piece will go. The value 2426ADVICE has the form (NAME PROTECTED ENABLED DEFINITION), where
2427of POSITION can either be `first', `last' or a number where 0 corresponds 2427NAME is the advice name; PROTECTED is a flag specifying whether
2428to `first'. Numbers outside the range will be mapped to the closest 2428to protect against non-local exits; ENABLED is a flag specifying
2429extreme position. If there was already a piece of ADVICE with the same 2429whether to initially enable the advice; and DEFINITION has the
2430name, then the position argument will be ignored and the old advice 2430form (advice . LAMBDA), where LAMBDA is a lambda expression.
2431will be overwritten with the new one. 2431
2432 If the FUNCTION was not advised already, then its advice info will be 2432If FUNCTION already has a piece of advice with the same name,
2433initialized. Redefining a piece of advice whose name is part of the cache-id 2433then POSITION is ignored, and the old advice is overwritten with
2434will clear the cache." 2434the new one.
2435
2436If FUNCTION already has one or more pieces of advice of the
2437specified CLASS, then POSITION determines where the new piece
2438goes. POSITION can either be `first', `last' or a number (where
24390 corresponds to `first', and numbers outside the valid range are
2440mapped to the closest extremal position).
2441
2442If FUNCTION was not advised already, its advice info will be
2443initialized. Redefining a piece of advice whose name is part of
2444the cache-id will clear the cache.
2445
2446See Info node `(elisp)Computed Advice' for detailed documentation."
2435 (cond ((not (ad-is-advised function)) 2447 (cond ((not (ad-is-advised function))
2436 (ad-initialize-advice-info function) 2448 (ad-initialize-advice-info function)
2437 (ad-set-advice-info-field 2449 (ad-set-advice-info-field