aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMiles Bader2001-10-21 15:22:49 +0000
committerMiles Bader2001-10-21 15:22:49 +0000
commitf717af878f9013e0019f0bcf9b8ddc8354728f14 (patch)
treeb57a89cbaae128e8380e4de486b1fba26d09d4bf /src
parent33c2d29f6c841a2b712c9ff05e1ceef2ca2d33f6 (diff)
downloademacs-f717af878f9013e0019f0bcf9b8ddc8354728f14.tar.gz
emacs-f717af878f9013e0019f0bcf9b8ddc8354728f14.zip
(Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_failure)
(Frun_hook_with_args_until_success, Ffuncall, For, Fand, Fif, Fcond) (Fprogn, Fprog1, Fprog2, Fsetq, Fquote, Ffunction, Fdefun, Fdefmacro) (Fdefvar, Fdefconst, FletX, Flet, Fwhile, Fcatch, Funwind_protect) (Fcondition_case): Add usage: string to doc string.
Diffstat (limited to 'src')
-rw-r--r--src/eval.c78
1 files changed, 52 insertions, 26 deletions
diff --git a/src/eval.c b/src/eval.c
index 5c54ae3961d..2f87d5fc22c 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -288,7 +288,8 @@ do_debug_on_call (code)
288DEFUN ("or", For, Sor, 0, UNEVALLED, 0, 288DEFUN ("or", For, Sor, 0, UNEVALLED, 0,
289 "Eval args until one of them yields non-nil, then return that value.\n\ 289 "Eval args until one of them yields non-nil, then return that value.\n\
290The remaining args are not evalled at all.\n\ 290The remaining args are not evalled at all.\n\
291If all args return nil, return nil.") 291If all args return nil, return nil.\n\
292usage: (or CONDITIONS ...)")
292 (args) 293 (args)
293 Lisp_Object args; 294 Lisp_Object args;
294{ 295{
@@ -318,7 +319,8 @@ If all args return nil, return nil.")
318DEFUN ("and", Fand, Sand, 0, UNEVALLED, 0, 319DEFUN ("and", Fand, Sand, 0, UNEVALLED, 0,
319 "Eval args until one of them yields nil, then return nil.\n\ 320 "Eval args until one of them yields nil, then return nil.\n\
320The remaining args are not evalled at all.\n\ 321The remaining args are not evalled at all.\n\
321If no arg yields nil, return the last arg's value.") 322If no arg yields nil, return the last arg's value.\n\
323usage: (and CONDITIONS ...)")
322 (args) 324 (args)
323 Lisp_Object args; 325 Lisp_Object args;
324{ 326{
@@ -349,7 +351,8 @@ DEFUN ("if", Fif, Sif, 2, UNEVALLED, 0,
349 "If COND yields non-nil, do THEN, else do ELSE...\n\ 351 "If COND yields non-nil, do THEN, else do ELSE...\n\
350Returns the value of THEN or the value of the last of the ELSE's.\n\ 352Returns the value of THEN or the value of the last of the ELSE's.\n\
351THEN must be one expression, but ELSE... can be zero or more expressions.\n\ 353THEN must be one expression, but ELSE... can be zero or more expressions.\n\
352If COND yields nil, and there are no ELSE's, the value is nil.") 354If COND yields nil, and there are no ELSE's, the value is nil.\n\
355usage: (if COND THEN ELSE...)")
353 (args) 356 (args)
354 Lisp_Object args; 357 Lisp_Object args;
355{ 358{
@@ -373,7 +376,8 @@ then the expressions in BODY are evaluated and the last one's\n\
373value is the value of the cond-form.\n\ 376value is the value of the cond-form.\n\
374If no clause succeeds, cond returns nil.\n\ 377If no clause succeeds, cond returns nil.\n\
375If a clause has one element, as in (CONDITION),\n\ 378If a clause has one element, as in (CONDITION),\n\
376CONDITION's value if non-nil is returned from the cond-form.") 379CONDITION's value if non-nil is returned from the cond-form.\n\
380usage: (cond CLAUSES...)")
377 (args) 381 (args)
378 Lisp_Object args; 382 Lisp_Object args;
379{ 383{
@@ -400,7 +404,8 @@ CONDITION's value if non-nil is returned from the cond-form.")
400} 404}
401 405
402DEFUN ("progn", Fprogn, Sprogn, 0, UNEVALLED, 0, 406DEFUN ("progn", Fprogn, Sprogn, 0, UNEVALLED, 0,
403 "Eval BODY forms sequentially and return value of last one.") 407 "Eval BODY forms sequentially and return value of last one.\n\
408usage: (progn BODY ...)")
404 (args) 409 (args)
405 Lisp_Object args; 410 Lisp_Object args;
406{ 411{
@@ -440,7 +445,8 @@ DEFUN ("progn", Fprogn, Sprogn, 0, UNEVALLED, 0,
440DEFUN ("prog1", Fprog1, Sprog1, 1, UNEVALLED, 0, 445DEFUN ("prog1", Fprog1, Sprog1, 1, UNEVALLED, 0,
441 "Eval FIRST and BODY sequentially; value from FIRST.\n\ 446 "Eval FIRST and BODY sequentially; value from FIRST.\n\
442The value of FIRST is saved during the evaluation of the remaining args,\n\ 447The value of FIRST is saved during the evaluation of the remaining args,\n\
443whose values are discarded.") 448whose values are discarded.\n\
449usage: (prog1 FIRST BODY...)")
444 (args) 450 (args)
445 Lisp_Object args; 451 Lisp_Object args;
446{ 452{
@@ -473,7 +479,8 @@ whose values are discarded.")
473DEFUN ("prog2", Fprog2, Sprog2, 2, UNEVALLED, 0, 479DEFUN ("prog2", Fprog2, Sprog2, 2, UNEVALLED, 0,
474 "Eval X, Y and BODY sequentially; value from Y.\n\ 480 "Eval X, Y and BODY sequentially; value from Y.\n\
475The value of Y is saved during the evaluation of the remaining args,\n\ 481The value of Y is saved during the evaluation of the remaining args,\n\
476whose values are discarded.") 482whose values are discarded.\n\
483usage: (prog2 X Y BODY...)")
477 (args) 484 (args)
478 Lisp_Object args; 485 Lisp_Object args;
479{ 486{
@@ -512,7 +519,8 @@ The values VAL are expressions; they are evaluated.\n\
512Thus, (setq x (1+ y)) sets `x' to the value of `(1+ y)'.\n\ 519Thus, (setq x (1+ y)) sets `x' to the value of `(1+ y)'.\n\
513The second VAL is not computed until after the first SYM is set, and so on;\n\ 520The second VAL is not computed until after the first SYM is set, and so on;\n\
514each VAL can use the new value of variables set earlier in the `setq'.\n\ 521each VAL can use the new value of variables set earlier in the `setq'.\n\
515The return value of the `setq' form is the value of the last VAL.") 522The return value of the `setq' form is the value of the last VAL.\n\
523usage: (setq SYM VAL SYM VAL ...)")
516 (args) 524 (args)
517 Lisp_Object args; 525 Lisp_Object args;
518{ 526{
@@ -540,7 +548,8 @@ The return value of the `setq' form is the value of the last VAL.")
540} 548}
541 549
542DEFUN ("quote", Fquote, Squote, 1, UNEVALLED, 0, 550DEFUN ("quote", Fquote, Squote, 1, UNEVALLED, 0,
543 "Return the argument, without evaluating it. `(quote x)' yields `x'.") 551 "Return the argument, without evaluating it. `(quote x)' yields `x'.\n\
552usage: (quote ARG)")
544 (args) 553 (args)
545 Lisp_Object args; 554 Lisp_Object args;
546{ 555{
@@ -550,7 +559,8 @@ DEFUN ("quote", Fquote, Squote, 1, UNEVALLED, 0,
550DEFUN ("function", Ffunction, Sfunction, 1, UNEVALLED, 0, 559DEFUN ("function", Ffunction, Sfunction, 1, UNEVALLED, 0,
551 "Like `quote', but preferred for objects which are functions.\n\ 560 "Like `quote', but preferred for objects which are functions.\n\
552In byte compilation, `function' causes its argument to be compiled.\n\ 561In byte compilation, `function' causes its argument to be compiled.\n\
553`quote' cannot do that.") 562`quote' cannot do that.\n\
563usage: (function ARG)")
554 (args) 564 (args)
555 Lisp_Object args; 565 Lisp_Object args;
556{ 566{
@@ -629,7 +639,8 @@ interactive_p (exclude_subrs_p)
629DEFUN ("defun", Fdefun, Sdefun, 2, UNEVALLED, 0, 639DEFUN ("defun", Fdefun, Sdefun, 2, UNEVALLED, 0,
630 "Define NAME as a function.\n\ 640 "Define NAME as a function.\n\
631The definition is (lambda ARGLIST [DOCSTRING] BODY...).\n\ 641The definition is (lambda ARGLIST [DOCSTRING] BODY...).\n\
632See also the function `interactive'.") 642See also the function `interactive'.\n\
643usage: (defun NAME ARGLIST [DOCSTRING] BODY...)")
633 (args) 644 (args)
634 Lisp_Object args; 645 Lisp_Object args;
635{ 646{
@@ -651,7 +662,8 @@ The definition is (macro lambda ARGLIST [DOCSTRING] BODY...).\n\
651When the macro is called, as in (NAME ARGS...),\n\ 662When the macro is called, as in (NAME ARGS...),\n\
652the function (lambda ARGLIST BODY...) is applied to\n\ 663the function (lambda ARGLIST BODY...) is applied to\n\
653the list ARGS... as it appears in the expression,\n\ 664the list ARGS... as it appears in the expression,\n\
654and the result should be a form to be evaluated instead of the original.") 665and the result should be a form to be evaluated instead of the original.\n\
666usage: (defmacro NAME ARGLIST [DOCSTRING] BODY...)")
655 (args) 667 (args)
656 Lisp_Object args; 668 Lisp_Object args;
657{ 669{
@@ -706,7 +718,8 @@ INITVALUE and DOCSTRING are optional.\n\
706If DOCSTRING starts with *, this variable is identified as a user option.\n\ 718If DOCSTRING starts with *, this variable is identified as a user option.\n\
707 This means that M-x set-variable recognizes it.\n\ 719 This means that M-x set-variable recognizes it.\n\
708 See also `user-variable-p'.\n\ 720 See also `user-variable-p'.\n\
709If INITVALUE is missing, SYMBOL's value is not set.") 721If INITVALUE is missing, SYMBOL's value is not set.\n\
722usage: (defvar SYMBOL [INITVALUE DOCSTRING])")
710 (args) 723 (args)
711 Lisp_Object args; 724 Lisp_Object args;
712{ 725{
@@ -748,7 +761,8 @@ The intent is that neither programs nor users should ever change this value.\n\
748Always sets the value of SYMBOL to the result of evalling INITVALUE.\n\ 761Always sets the value of SYMBOL to the result of evalling INITVALUE.\n\
749If SYMBOL is buffer-local, its default value is what is set;\n\ 762If SYMBOL is buffer-local, its default value is what is set;\n\
750 buffer-local values are not affected.\n\ 763 buffer-local values are not affected.\n\
751DOCSTRING is optional.") 764DOCSTRING is optional.\n\
765usage: (defconst SYMBOL INITVALUE [DOCSTRING])")
752 (args) 766 (args)
753 Lisp_Object args; 767 Lisp_Object args;
754{ 768{
@@ -813,7 +827,8 @@ DEFUN ("let*", FletX, SletX, 1, UNEVALLED, 0,
813The value of the last form in BODY is returned.\n\ 827The value of the last form in BODY is returned.\n\
814Each element of VARLIST is a symbol (which is bound to nil)\n\ 828Each element of VARLIST is a symbol (which is bound to nil)\n\
815or a list (SYMBOL VALUEFORM) (which binds SYMBOL to the value of VALUEFORM).\n\ 829or a list (SYMBOL VALUEFORM) (which binds SYMBOL to the value of VALUEFORM).\n\
816Each VALUEFORM can refer to the symbols already bound by this VARLIST.") 830Each VALUEFORM can refer to the symbols already bound by this VARLIST.\n\
831usage: (let* VARLIST BODY...)")
817 (args) 832 (args)
818 Lisp_Object args; 833 Lisp_Object args;
819{ 834{
@@ -851,7 +866,8 @@ DEFUN ("let", Flet, Slet, 1, UNEVALLED, 0,
851The value of the last form in BODY is returned.\n\ 866The value of the last form in BODY is returned.\n\
852Each element of VARLIST is a symbol (which is bound to nil)\n\ 867Each element of VARLIST is a symbol (which is bound to nil)\n\
853or a list (SYMBOL VALUEFORM) (which binds SYMBOL to the value of VALUEFORM).\n\ 868or a list (SYMBOL VALUEFORM) (which binds SYMBOL to the value of VALUEFORM).\n\
854All the VALUEFORMs are evalled before any symbols are bound.") 869All the VALUEFORMs are evalled before any symbols are bound.\n\
870usage: (let VARLIST BODY...)")
855 (args) 871 (args)
856 Lisp_Object args; 872 Lisp_Object args;
857{ 873{
@@ -906,7 +922,8 @@ All the VALUEFORMs are evalled before any symbols are bound.")
906DEFUN ("while", Fwhile, Swhile, 1, UNEVALLED, 0, 922DEFUN ("while", Fwhile, Swhile, 1, UNEVALLED, 0,
907 "If TEST yields non-nil, eval BODY... and repeat.\n\ 923 "If TEST yields non-nil, eval BODY... and repeat.\n\
908The order of execution is thus TEST, BODY, TEST, BODY and so on\n\ 924The order of execution is thus TEST, BODY, TEST, BODY and so on\n\
909until TEST returns nil.") 925until TEST returns nil.\n\
926usage: (while TEST BODY...)")
910 (args) 927 (args)
911 Lisp_Object args; 928 Lisp_Object args;
912{ 929{
@@ -1013,7 +1030,8 @@ TAG is evalled to get the tag to use; it must not be nil.\n\
1013Then the BODY is executed.\n\ 1030Then the BODY is executed.\n\
1014Within BODY, (throw TAG) with same tag exits BODY and exits this `catch'.\n\ 1031Within BODY, (throw TAG) with same tag exits BODY and exits this `catch'.\n\
1015If no throw happens, `catch' returns the value of the last BODY form.\n\ 1032If no throw happens, `catch' returns the value of the last BODY form.\n\
1016If a throw happens, it specifies the value to return from `catch'.") 1033If a throw happens, it specifies the value to return from `catch'.\n\
1034usage: (catch TAG BODY...)")
1017 (args) 1035 (args)
1018 Lisp_Object args; 1036 Lisp_Object args;
1019{ 1037{
@@ -1141,7 +1159,8 @@ DEFUN ("unwind-protect", Funwind_protect, Sunwind_protect, 1, UNEVALLED, 0,
1141 "Do BODYFORM, protecting with UNWINDFORMS.\n\ 1159 "Do BODYFORM, protecting with UNWINDFORMS.\n\
1142If BODYFORM completes normally, its value is returned\n\ 1160If BODYFORM completes normally, its value is returned\n\
1143after executing the UNWINDFORMS.\n\ 1161after executing the UNWINDFORMS.\n\
1144If BODYFORM exits nonlocally, the UNWINDFORMS are executed anyway.") 1162If BODYFORM exits nonlocally, the UNWINDFORMS are executed anyway.\n\
1163usage: (unwind-protect BODYFORM UNWINDFORMS...)")
1145 (args) 1164 (args)
1146 Lisp_Object args; 1165 Lisp_Object args;
1147{ 1166{
@@ -1179,7 +1198,8 @@ with VAR bound to (SIGNALED-CONDITIONS . SIGNAL-DATA).\n\
1179VAR may be nil; then you do not get access to the signal information.\n\ 1198VAR may be nil; then you do not get access to the signal information.\n\
1180\n\ 1199\n\
1181The value of the last BODY form is returned from the condition-case.\n\ 1200The value of the last BODY form is returned from the condition-case.\n\
1182See also the function `signal' for more info.") 1201See also the function `signal' for more info.\n\
1202usage: (condition-case VAR BODYFORM HANDLERS...)")
1183 (args) 1203 (args)
1184 Lisp_Object args; 1204 Lisp_Object args;
1185{ 1205{
@@ -2119,7 +2139,8 @@ DEFUN ("eval", Feval, Seval, 1, 1, 0,
2119DEFUN ("apply", Fapply, Sapply, 2, MANY, 0, 2139DEFUN ("apply", Fapply, Sapply, 2, MANY, 0,
2120 "Call FUNCTION with our remaining args, using our last arg as list of args.\n\ 2140 "Call FUNCTION with our remaining args, using our last arg as list of args.\n\
2121Then return the value FUNCTION returns.\n\ 2141Then return the value FUNCTION returns.\n\
2122Thus, (apply '+ 1 2 '(3 4)) returns 10.") 2142Thus, (apply '+ 1 2 '(3 4)) returns 10.\n\
2143usage: (apply FUNCTION &rest ARGUMENTS)")
2123 (nargs, args) 2144 (nargs, args)
2124 int nargs; 2145 int nargs;
2125 Lisp_Object *args; 2146 Lisp_Object *args;
@@ -2210,7 +2231,8 @@ If the value is a function, it is called with no arguments.\n\
2210If it is a list, the elements are called, in order, with no arguments.\n\ 2231If it is a list, the elements are called, in order, with no arguments.\n\
2211\n\ 2232\n\
2212To make a hook variable buffer-local, use `make-local-hook',\n\ 2233To make a hook variable buffer-local, use `make-local-hook',\n\
2213not `make-local-variable'.") 2234not `make-local-variable'.\n\
2235usage: (run-hooks &rest HOOKS)")
2214 (nargs, args) 2236 (nargs, args)
2215 int nargs; 2237 int nargs;
2216 Lisp_Object *args; 2238 Lisp_Object *args;
@@ -2240,7 +2262,8 @@ It is best not to depend on the value return by `run-hook-with-args',\n\
2240as that may change.\n\ 2262as that may change.\n\
2241\n\ 2263\n\
2242To make a hook variable buffer-local, use `make-local-hook',\n\ 2264To make a hook variable buffer-local, use `make-local-hook',\n\
2243not `make-local-variable'.") 2265not `make-local-variable'.\n\
2266usage: (run-hook-with-args HOOK &rest ARGS)")
2244 (nargs, args) 2267 (nargs, args)
2245 int nargs; 2268 int nargs;
2246 Lisp_Object *args; 2269 Lisp_Object *args;
@@ -2258,7 +2281,8 @@ returns a non-nil value. Then we return that value.\n\
2258If all the functions return nil, we return nil.\n\ 2281If all the functions return nil, we return nil.\n\
2259\n\ 2282\n\
2260To make a hook variable buffer-local, use `make-local-hook',\n\ 2283To make a hook variable buffer-local, use `make-local-hook',\n\
2261not `make-local-variable'.") 2284not `make-local-variable'.\n\
2285usage: (run-hook-with-args-until-success HOOK &rest ARGS)")
2262 (nargs, args) 2286 (nargs, args)
2263 int nargs; 2287 int nargs;
2264 Lisp_Object *args; 2288 Lisp_Object *args;
@@ -2276,7 +2300,8 @@ returns nil. Then we return nil.\n\
2276If all the functions return non-nil, we return non-nil.\n\ 2300If all the functions return non-nil, we return non-nil.\n\
2277\n\ 2301\n\
2278To make a hook variable buffer-local, use `make-local-hook',\n\ 2302To make a hook variable buffer-local, use `make-local-hook',\n\
2279not `make-local-variable'.") 2303not `make-local-variable'.\n\
2304usage: (run-hook-with-args-until-failure HOOK &rest ARGS)")
2280 (nargs, args) 2305 (nargs, args)
2281 int nargs; 2306 int nargs;
2282 Lisp_Object *args; 2307 Lisp_Object *args;
@@ -2603,7 +2628,8 @@ call6 (fn, arg1, arg2, arg3, arg4, arg5, arg6)
2603DEFUN ("funcall", Ffuncall, Sfuncall, 1, MANY, 0, 2628DEFUN ("funcall", Ffuncall, Sfuncall, 1, MANY, 0,
2604 "Call first argument as a function, passing remaining arguments to it.\n\ 2629 "Call first argument as a function, passing remaining arguments to it.\n\
2605Return the value that function returns.\n\ 2630Return the value that function returns.\n\
2606Thus, (funcall 'cons 'x 'y) returns (x . y).") 2631Thus, (funcall 'cons 'x 'y) returns (x . y).\n\
2632usage: (funcall FUNCTION &rest ARGUMENTS)")
2607 (nargs, args) 2633 (nargs, args)
2608 int nargs; 2634 int nargs;
2609 Lisp_Object *args; 2635 Lisp_Object *args;