2323 |
the given arguments and its return value is returned. If it is a list |
the given arguments and its return value is returned. If it is a list |
2324 |
of functions, those functions are called, in order, |
of functions, those functions are called, in order, |
2325 |
with the given arguments ARGS. |
with the given arguments ARGS. |
2326 |
It is best not to depend on the value return by `run-hook-with-args', |
It is best not to depend on the value returned by `run-hook-with-args', |
2327 |
as that may change. |
as that may change. |
2328 |
|
|
2329 |
Do not use `make-local-variable' to make a hook variable buffer-local. |
Do not use `make-local-variable' to make a hook variable buffer-local. |
2339 |
DEFUN ("run-hook-with-args-until-success", Frun_hook_with_args_until_success, |
DEFUN ("run-hook-with-args-until-success", Frun_hook_with_args_until_success, |
2340 |
Srun_hook_with_args_until_success, 1, MANY, 0, |
Srun_hook_with_args_until_success, 1, MANY, 0, |
2341 |
doc: /* Run HOOK with the specified arguments ARGS. |
doc: /* Run HOOK with the specified arguments ARGS. |
2342 |
HOOK should be a symbol, a hook variable. Its value should |
HOOK should be a symbol, a hook variable. If HOOK has a non-nil |
2343 |
be a list of functions. We call those functions, one by one, |
value, that value may be a function or a list of functions to be |
2344 |
passing arguments ARGS to each of them, until one of them |
called to run the hook. If the value is a function, it is called with |
2345 |
|
the given arguments and its return value is returned. |
2346 |
|
If it is a list of functions, those functions are called, in order, |
2347 |
|
with the given arguments ARGS, until one of them |
2348 |
returns a non-nil value. Then we return that value. |
returns a non-nil value. Then we return that value. |
2349 |
If all the functions return nil, we return nil. |
However, if they all return nil, we return nil. |
2350 |
|
|
2351 |
Do not use `make-local-variable' to make a hook variable buffer-local. |
Do not use `make-local-variable' to make a hook variable buffer-local. |
2352 |
Instead, use `add-hook' and specify t for the LOCAL argument. |
Instead, use `add-hook' and specify t for the LOCAL argument. |
2361 |
DEFUN ("run-hook-with-args-until-failure", Frun_hook_with_args_until_failure, |
DEFUN ("run-hook-with-args-until-failure", Frun_hook_with_args_until_failure, |
2362 |
Srun_hook_with_args_until_failure, 1, MANY, 0, |
Srun_hook_with_args_until_failure, 1, MANY, 0, |
2363 |
doc: /* Run HOOK with the specified arguments ARGS. |
doc: /* Run HOOK with the specified arguments ARGS. |
2364 |
HOOK should be a symbol, a hook variable. Its value should |
HOOK should be a symbol, a hook variable. If HOOK has a non-nil |
2365 |
be a list of functions. We call those functions, one by one, |
value, that value may be a function or a list of functions to be |
2366 |
passing arguments ARGS to each of them, until one of them |
called to run the hook. If the value is a function, it is called with |
2367 |
returns nil. Then we return nil. |
the given arguments and its return value is returned. |
2368 |
If all the functions return non-nil, we return non-nil. |
If it is a list of functions, those functions are called, in order, |
2369 |
|
with the given arguments ARGS, until one of them returns nil. |
2370 |
|
Then we return nil. However, if they all return non-nil, we return non-nil. |
2371 |
|
|
2372 |
Do not use `make-local-variable' to make a hook variable buffer-local. |
Do not use `make-local-variable' to make a hook variable buffer-local. |
2373 |
Instead, use `add-hook' and specify t for the LOCAL argument. |
Instead, use `add-hook' and specify t for the LOCAL argument. |