diff options
| author | Chong Yidong | 2010-01-16 16:20:43 -0500 |
|---|---|---|
| committer | Chong Yidong | 2010-01-16 16:20:43 -0500 |
| commit | bbdc98eff1533440f7f7633acf07b7f29c037a11 (patch) | |
| tree | f54e6b4669b60073c303b27514048eea7761e5a9 | |
| parent | abd5cfe880473c8da925d5b83e52c8019803d87d (diff) | |
| download | emacs-bbdc98eff1533440f7f7633acf07b7f29c037a11.tar.gz emacs-bbdc98eff1533440f7f7633acf07b7f29c037a11.zip | |
* emacs-lisp/advice.el (ad-add-advice): Doc fix (Bug#5274)
| -rw-r--r-- | lisp/ChangeLog | 2 | ||||
| -rw-r--r-- | lisp/emacs-lisp/advice.el | 32 |
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 | ||
| 5 | 2010-01-16 Chong Yidong <cyd@stupidchicken.com> | 5 | 2010-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. |
| 2425 | If FUNCTION already has one or more pieces of advice of the specified | 2425 | |
| 2426 | CLASS then POSITION determines where the new piece will go. The value | 2426 | ADVICE has the form (NAME PROTECTED ENABLED DEFINITION), where |
| 2427 | of POSITION can either be `first', `last' or a number where 0 corresponds | 2427 | NAME is the advice name; PROTECTED is a flag specifying whether |
| 2428 | to `first'. Numbers outside the range will be mapped to the closest | 2428 | to protect against non-local exits; ENABLED is a flag specifying |
| 2429 | extreme position. If there was already a piece of ADVICE with the same | 2429 | whether to initially enable the advice; and DEFINITION has the |
| 2430 | name, then the position argument will be ignored and the old advice | 2430 | form (advice . LAMBDA), where LAMBDA is a lambda expression. |
| 2431 | will be overwritten with the new one. | 2431 | |
| 2432 | If the FUNCTION was not advised already, then its advice info will be | 2432 | If FUNCTION already has a piece of advice with the same name, |
| 2433 | initialized. Redefining a piece of advice whose name is part of the cache-id | 2433 | then POSITION is ignored, and the old advice is overwritten with |
| 2434 | will clear the cache." | 2434 | the new one. |
| 2435 | |||
| 2436 | If FUNCTION already has one or more pieces of advice of the | ||
| 2437 | specified CLASS, then POSITION determines where the new piece | ||
| 2438 | goes. POSITION can either be `first', `last' or a number (where | ||
| 2439 | 0 corresponds to `first', and numbers outside the valid range are | ||
| 2440 | mapped to the closest extremal position). | ||
| 2441 | |||
| 2442 | If FUNCTION was not advised already, its advice info will be | ||
| 2443 | initialized. Redefining a piece of advice whose name is part of | ||
| 2444 | the cache-id will clear the cache. | ||
| 2445 | |||
| 2446 | See 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 |