diff options
| author | Richard M. Stallman | 1993-04-29 13:12:37 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-04-29 13:12:37 +0000 |
| commit | d9bcdb34a0c0194e12aa6a41a5c331626b378796 (patch) | |
| tree | f425d3c45fa2dfc4254091eb85d54a43c9bd95da /src/data.c | |
| parent | c5e3de70d8b00803e8d97de223108bc2a17ea9dd (diff) | |
| download | emacs-d9bcdb34a0c0194e12aa6a41a5c331626b378796.tar.gz emacs-d9bcdb34a0c0194e12aa6a41a5c331626b378796.zip | |
(Fdefine_function): New function (same code as Fdefalias).
Diffstat (limited to 'src/data.c')
| -rw-r--r-- | src/data.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/data.c b/src/data.c index c9cc6bad384..613d9db6a64 100644 --- a/src/data.c +++ b/src/data.c | |||
| @@ -525,6 +525,8 @@ DEFUN ("fset", Ffset, Sfset, 2, 2, 0, | |||
| 525 | return newdef; | 525 | return newdef; |
| 526 | } | 526 | } |
| 527 | 527 | ||
| 528 | /* This name should be removed once it is eliminated from elsewhere. */ | ||
| 529 | |||
| 528 | DEFUN ("defalias", Fdefalias, Sdefalias, 2, 2, 0, | 530 | DEFUN ("defalias", Fdefalias, Sdefalias, 2, 2, 0, |
| 529 | "Set SYMBOL's function definition to NEWVAL, and return NEWVAL.\n\ | 531 | "Set SYMBOL's function definition to NEWVAL, and return NEWVAL.\n\ |
| 530 | Associates the function with the current load file, if any.") | 532 | Associates the function with the current load file, if any.") |
| @@ -540,6 +542,21 @@ Associates the function with the current load file, if any.") | |||
| 540 | return newdef; | 542 | return newdef; |
| 541 | } | 543 | } |
| 542 | 544 | ||
| 545 | DEFUN ("define-function", Fdefine_function, Sdefine_function, 2, 2, 0, | ||
| 546 | "Set SYMBOL's function definition to NEWVAL, and return NEWVAL.\n\ | ||
| 547 | Associates the function with the current load file, if any.") | ||
| 548 | (sym, newdef) | ||
| 549 | register Lisp_Object sym, newdef; | ||
| 550 | { | ||
| 551 | CHECK_SYMBOL (sym, 0); | ||
| 552 | if (!NILP (Vautoload_queue) && !EQ (XSYMBOL (sym)->function, Qunbound)) | ||
| 553 | Vautoload_queue = Fcons (Fcons (sym, XSYMBOL (sym)->function), | ||
| 554 | Vautoload_queue); | ||
| 555 | XSYMBOL (sym)->function = newdef; | ||
| 556 | LOADHIST_ATTACH (sym); | ||
| 557 | return newdef; | ||
| 558 | } | ||
| 559 | |||
| 543 | DEFUN ("setplist", Fsetplist, Ssetplist, 2, 2, 0, | 560 | DEFUN ("setplist", Fsetplist, Ssetplist, 2, 2, 0, |
| 544 | "Set SYMBOL's property list to NEWVAL, and return NEWVAL.") | 561 | "Set SYMBOL's property list to NEWVAL, and return NEWVAL.") |
| 545 | (sym, newplist) | 562 | (sym, newplist) |
| @@ -2154,6 +2171,7 @@ syms_of_data () | |||
| 2154 | defsubr (&Sfboundp); | 2171 | defsubr (&Sfboundp); |
| 2155 | defsubr (&Sfset); | 2172 | defsubr (&Sfset); |
| 2156 | defsubr (&Sdefalias); | 2173 | defsubr (&Sdefalias); |
| 2174 | defsubr (&Sdefine_function); | ||
| 2157 | defsubr (&Ssetplist); | 2175 | defsubr (&Ssetplist); |
| 2158 | defsubr (&Ssymbol_value); | 2176 | defsubr (&Ssymbol_value); |
| 2159 | defsubr (&Sset); | 2177 | defsubr (&Sset); |