diff options
| author | Glenn Morris | 2012-09-28 09:02:31 -0700 |
|---|---|---|
| committer | Glenn Morris | 2012-09-28 09:02:31 -0700 |
| commit | e61d39cddfd015032a6419ce75c36ecdf1e9fe9f (patch) | |
| tree | f1f941a206a079e9a7b2813dc2f7479c2ba05495 /src/eval.c | |
| parent | 3df749b0f8a97c8b8f18a34bce494fd9d4fe987f (diff) | |
| parent | 147c0425024ce9c1dbb7301300867d8563a6730a (diff) | |
| download | emacs-e61d39cddfd015032a6419ce75c36ecdf1e9fe9f.tar.gz emacs-e61d39cddfd015032a6419ce75c36ecdf1e9fe9f.zip | |
Merge from emacs-24; up to 2012-05-07T21:26:08Z!rgm@gnu.org
Diffstat (limited to 'src/eval.c')
| -rw-r--r-- | src/eval.c | 45 |
1 files changed, 19 insertions, 26 deletions
diff --git a/src/eval.c b/src/eval.c index d984331ec41..851b2bb1129 100644 --- a/src/eval.c +++ b/src/eval.c | |||
| @@ -2351,14 +2351,10 @@ usage: (run-hooks &rest HOOKS) */) | |||
| 2351 | DEFUN ("run-hook-with-args", Frun_hook_with_args, | 2351 | DEFUN ("run-hook-with-args", Frun_hook_with_args, |
| 2352 | Srun_hook_with_args, 1, MANY, 0, | 2352 | Srun_hook_with_args, 1, MANY, 0, |
| 2353 | doc: /* Run HOOK with the specified arguments ARGS. | 2353 | doc: /* Run HOOK with the specified arguments ARGS. |
| 2354 | HOOK should be a symbol, a hook variable. If HOOK has a non-nil | 2354 | HOOK should be a symbol, a hook variable. The value of HOOK |
| 2355 | value, that value may be a function or a list of functions to be | 2355 | may be nil, a function, or a list of functions. Call each |
| 2356 | called to run the hook. If the value is a function, it is called with | 2356 | function in order with arguments ARGS. The final return value |
| 2357 | the given arguments and its return value is returned. If it is a list | 2357 | is unspecified. |
| 2358 | of functions, those functions are called, in order, | ||
| 2359 | with the given arguments ARGS. | ||
| 2360 | It is best not to depend on the value returned by `run-hook-with-args', | ||
| 2361 | as that may change. | ||
| 2362 | 2358 | ||
| 2363 | Do not use `make-local-variable' to make a hook variable buffer-local. | 2359 | Do not use `make-local-variable' to make a hook variable buffer-local. |
| 2364 | Instead, use `add-hook' and specify t for the LOCAL argument. | 2360 | Instead, use `add-hook' and specify t for the LOCAL argument. |
| @@ -2368,18 +2364,18 @@ usage: (run-hook-with-args HOOK &rest ARGS) */) | |||
| 2368 | return run_hook_with_args (nargs, args, funcall_nil); | 2364 | return run_hook_with_args (nargs, args, funcall_nil); |
| 2369 | } | 2365 | } |
| 2370 | 2366 | ||
| 2367 | /* NB this one still documents a specific non-nil return value. | ||
| 2368 | (As did run-hook-with-args and run-hook-with-args-until-failure | ||
| 2369 | until they were changed in 24.1.) */ | ||
| 2371 | DEFUN ("run-hook-with-args-until-success", Frun_hook_with_args_until_success, | 2370 | DEFUN ("run-hook-with-args-until-success", Frun_hook_with_args_until_success, |
| 2372 | Srun_hook_with_args_until_success, 1, MANY, 0, | 2371 | Srun_hook_with_args_until_success, 1, MANY, 0, |
| 2373 | doc: /* Run HOOK with the specified arguments ARGS. | 2372 | doc: /* Run HOOK with the specified arguments ARGS. |
| 2374 | HOOK should be a symbol, a hook variable. If HOOK has a non-nil | 2373 | HOOK should be a symbol, a hook variable. The value of HOOK |
| 2375 | value, that value may be a function or a list of functions to be | 2374 | may be nil, a function, or a list of functions. Call each |
| 2376 | called to run the hook. If the value is a function, it is called with | 2375 | function in order with arguments ARGS, stopping at the first |
| 2377 | the given arguments and its return value is returned. | 2376 | one that returns non-nil, and return that value. Otherwise (if |
| 2378 | If it is a list of functions, those functions are called, in order, | 2377 | all functions return nil, or if there are no functions to call), |
| 2379 | with the given arguments ARGS, until one of them | 2378 | return nil. |
| 2380 | returns a non-nil value. Then we return that value. | ||
| 2381 | However, if they all return nil, we return nil. | ||
| 2382 | If the value of HOOK is nil, this function returns nil. | ||
| 2383 | 2379 | ||
| 2384 | Do not use `make-local-variable' to make a hook variable buffer-local. | 2380 | Do not use `make-local-variable' to make a hook variable buffer-local. |
| 2385 | Instead, use `add-hook' and specify t for the LOCAL argument. | 2381 | Instead, use `add-hook' and specify t for the LOCAL argument. |
| @@ -2398,15 +2394,12 @@ funcall_not (ptrdiff_t nargs, Lisp_Object *args) | |||
| 2398 | DEFUN ("run-hook-with-args-until-failure", Frun_hook_with_args_until_failure, | 2394 | DEFUN ("run-hook-with-args-until-failure", Frun_hook_with_args_until_failure, |
| 2399 | Srun_hook_with_args_until_failure, 1, MANY, 0, | 2395 | Srun_hook_with_args_until_failure, 1, MANY, 0, |
| 2400 | doc: /* Run HOOK with the specified arguments ARGS. | 2396 | doc: /* Run HOOK with the specified arguments ARGS. |
| 2401 | HOOK should be a symbol, a hook variable. If HOOK has a non-nil | 2397 | HOOK should be a symbol, a hook variable. The value of HOOK |
| 2402 | value, that value may be a function or a list of functions to be | 2398 | may be nil, a function, or a list of functions. Call each |
| 2403 | called to run the hook. If the value is a function, it is called with | 2399 | function in order with arguments ARGS, stopping at the first |
| 2404 | the given arguments. Then we return nil if the function returns nil, | 2400 | one that returns nil, and return nil. Otherwise (if all functions |
| 2405 | and t if it returns non-nil. | 2401 | return non-nil, or if there are no functions to call), return non-nil |
| 2406 | If it is a list of functions, those functions are called, in order, | 2402 | \(do not rely on the precise return value in this case). |
| 2407 | with the given arguments ARGS, until one of them returns nil. | ||
| 2408 | Then we return nil. However, if they all return non-nil, we return t. | ||
| 2409 | If the value of HOOK is nil, this function returns t. | ||
| 2410 | 2403 | ||
| 2411 | Do not use `make-local-variable' to make a hook variable buffer-local. | 2404 | Do not use `make-local-variable' to make a hook variable buffer-local. |
| 2412 | Instead, use `add-hook' and specify t for the LOCAL argument. | 2405 | Instead, use `add-hook' and specify t for the LOCAL argument. |