changeset 2606:6bf6499fe4db

(Fdefine_function): New function (same code as Fdefalias).
author Richard M. Stallman <rms@gnu.org>
date Thu, 29 Apr 1993 13:12:37 +0000
parents b3c605e9bb30
children fcf578723758
files src/data.c
diffstat 1 files changed, 18 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/data.c	Thu Apr 29 02:22:48 1993 +0000
+++ b/src/data.c	Thu Apr 29 13:12:37 1993 +0000
@@ -525,6 +525,8 @@
   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 @@
   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 @@
   defsubr (&Sfboundp);
   defsubr (&Sfset);
   defsubr (&Sdefalias);
+  defsubr (&Sdefine_function);
   defsubr (&Ssetplist);
   defsubr (&Ssymbol_value);
   defsubr (&Sset);