summaryrefslogtreecommitdiff
path: root/src/data.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1993-04-29 13:12:37 +0000
committerRichard M. Stallman <rms@gnu.org>1993-04-29 13:12:37 +0000
commitd9bcdb34a0c0194e12aa6a41a5c331626b378796 (patch)
treef425d3c45fa2dfc4254091eb85d54a43c9bd95da /src/data.c
parentc5e3de70d8b00803e8d97de223108bc2a17ea9dd (diff)
downloademacs-d9bcdb34a0c0194e12aa6a41a5c331626b378796.tar.gz
(Fdefine_function): New function (same code as Fdefalias).
Diffstat (limited to 'src/data.c')
-rw-r--r--src/data.c18
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,
return newdef;
}
+/* This name should be removed once it is eliminated from elsewhere. */
+
DEFUN ("defalias", Fdefalias, Sdefalias, 2, 2, 0,
"Set SYMBOL's function definition to NEWVAL, and return NEWVAL.\n\
Associates the function with the current load file, if any.")
@@ -540,6 +542,21 @@ Associates the function with the current load file, if any.")
return newdef;
}
+DEFUN ("define-function", Fdefine_function, Sdefine_function, 2, 2, 0,
+ "Set SYMBOL's function definition to NEWVAL, and return NEWVAL.\n\
+Associates the function with the current load file, if any.")
+ (sym, newdef)
+ register Lisp_Object sym, newdef;
+{
+ CHECK_SYMBOL (sym, 0);
+ if (!NILP (Vautoload_queue) && !EQ (XSYMBOL (sym)->function, Qunbound))
+ Vautoload_queue = Fcons (Fcons (sym, XSYMBOL (sym)->function),
+ Vautoload_queue);
+ XSYMBOL (sym)->function = newdef;
+ LOADHIST_ATTACH (sym);
+ return newdef;
+}
+
DEFUN ("setplist", Fsetplist, Ssetplist, 2, 2, 0,
"Set SYMBOL's property list to NEWVAL, and return NEWVAL.")
(sym, newplist)
@@ -2154,6 +2171,7 @@ syms_of_data ()
defsubr (&Sfboundp);
defsubr (&Sfset);
defsubr (&Sdefalias);
+ defsubr (&Sdefine_function);
defsubr (&Ssetplist);
defsubr (&Ssymbol_value);
defsubr (&Sset);