changeset 46279:5f4ed17e4396

(Fdefalias): Add an optional `docstring' argument. (set_internal, Fsetq_default): Use XCAR/XCDR.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Tue, 09 Jul 2002 23:12:30 +0000
parents ae7e64529fa0
children dc1e715d2b03
files src/data.c
diffstat 1 files changed, 10 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/data.c	Tue Jul 09 23:02:26 2002 +0000
+++ b/src/data.c	Tue Jul 09 23:12:30 2002 +0000
@@ -704,14 +704,18 @@
   return definition;
 }
 
-DEFUN ("defalias", Fdefalias, Sdefalias, 2, 2, 0,
+extern Lisp_Object Qfunction_documentation;
+
+DEFUN ("defalias", Fdefalias, Sdefalias, 2, 3, 0,
        doc: /* Set SYMBOL's function definition to DEFINITION, and return DEFINITION.
 Associates the function with the current load file, if any.  */)
-     (symbol, definition)
-     register Lisp_Object symbol, definition;
+     (symbol, definition, docstring)
+     register Lisp_Object symbol, definition, docstring;
 {
   definition = Ffset (symbol, definition);
   LOADHIST_ATTACH (symbol);
+  if (!NILP (docstring))
+    Fput (symbol, Qfunction_documentation, docstring);
   return definition;
 }
 
@@ -1209,7 +1213,7 @@
 		 and load that binding.  */
 	      else
 		{
-		  tem1 = Fcons (symbol, Fcdr (current_alist_element));
+		  tem1 = Fcons (symbol, XCDR (current_alist_element));
 		  buf->local_var_alist
 		    = Fcons (tem1, buf->local_var_alist);
 		}
@@ -1411,9 +1415,9 @@
   do
     {
       val = Feval (Fcar (Fcdr (args_left)));
-      symbol = Fcar (args_left);
+      symbol = XCAR (args_left);
       Fset_default (symbol, val);
-      args_left = Fcdr (Fcdr (args_left));
+      args_left = Fcdr (XCDR (args_left));
     }
   while (!NILP (args_left));