diff options
| author | Richard M. Stallman | 1993-04-17 01:29:48 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-04-17 01:29:48 +0000 |
| commit | fc08c36736e40754b591009c905cdc5736495e38 (patch) | |
| tree | b3b6c34f13049501d1d3e593fba6120cb918b483 /src/data.c | |
| parent | 2a49b6e5194275ff5fea3844370fea00092e41f5 (diff) | |
| download | emacs-fc08c36736e40754b591009c905cdc5736495e38.tar.gz emacs-fc08c36736e40754b591009c905cdc5736495e38.zip | |
(Fdefine_function): New function.
Diffstat (limited to 'src/data.c')
| -rw-r--r-- | src/data.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/data.c b/src/data.c index 66b4e90157b..df96a3d54f6 100644 --- a/src/data.c +++ b/src/data.c | |||
| @@ -525,6 +525,21 @@ DEFUN ("fset", Ffset, Sfset, 2, 2, 0, | |||
| 525 | return newdef; | 525 | return newdef; |
| 526 | } | 526 | } |
| 527 | 527 | ||
| 528 | DEFUN ("define-function", Fdefine_function, Sdefine_function, 2, 2, 0, | ||
| 529 | "Set SYMBOL's function definition to NEWVAL, and return NEWVAL.\n\ | ||
| 530 | Associates the function with the current load file, if any.") | ||
| 531 | (sym, newdef) | ||
| 532 | register Lisp_Object sym, newdef; | ||
| 533 | { | ||
| 534 | CHECK_SYMBOL (sym, 0); | ||
| 535 | if (!NILP (Vautoload_queue) && !EQ (XSYMBOL (sym)->function, Qunbound)) | ||
| 536 | Vautoload_queue = Fcons (Fcons (sym, XSYMBOL (sym)->function), | ||
| 537 | Vautoload_queue); | ||
| 538 | XSYMBOL (sym)->function = newdef; | ||
| 539 | LOADHIST_ATTACH (sym); | ||
| 540 | return newdef; | ||
| 541 | } | ||
| 542 | |||
| 528 | DEFUN ("setplist", Fsetplist, Ssetplist, 2, 2, 0, | 543 | DEFUN ("setplist", Fsetplist, Ssetplist, 2, 2, 0, |
| 529 | "Set SYMBOL's property list to NEWVAL, and return NEWVAL.") | 544 | "Set SYMBOL's property list to NEWVAL, and return NEWVAL.") |
| 530 | (sym, newplist) | 545 | (sym, newplist) |
| @@ -2138,6 +2153,7 @@ syms_of_data () | |||
| 2138 | defsubr (&Sboundp); | 2153 | defsubr (&Sboundp); |
| 2139 | defsubr (&Sfboundp); | 2154 | defsubr (&Sfboundp); |
| 2140 | defsubr (&Sfset); | 2155 | defsubr (&Sfset); |
| 2156 | defsubr (&Sdefine_function); | ||
| 2141 | defsubr (&Ssetplist); | 2157 | defsubr (&Ssetplist); |
| 2142 | defsubr (&Ssymbol_value); | 2158 | defsubr (&Ssymbol_value); |
| 2143 | defsubr (&Sset); | 2159 | defsubr (&Sset); |