changeset 1564:b327816041d1

* eval.c (Fautoload): Renamed fifth argument TYPE. Document the fact that (eq TYPE 'keymap) means FUNCTION will become a keymap when loaded. (Fmacroexpand): Instead of assuming that every autoload form with a fifth element is a macro, actually check the fifth element against t and `macro', which are the only values which denote macroness.
author Jim Blandy <jimb@redhat.com>
date Sat, 07 Nov 1992 07:00:37 +0000
parents e721339972b0
children a681f63f93fa
files src/eval.c
diffstat 1 files changed, 16 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/eval.c	Sat Nov 07 07:00:04 1992 +0000
+++ b/src/eval.c	Sat Nov 07 07:00:37 1992 +0000
@@ -805,12 +805,16 @@
 	  if (EQ (XCONS (def)->car, Qautoload))
 	    {
 	      /* Autoloading function: will it be a macro when loaded?  */
-	      tem = Fcar (Fnthcdr (make_number (4), def));
-	      if (NILP (tem))
+	      tem = Fnth (make_number (4), def);
+	      if (EQ (XCONS (tem)->car, Qt)
+		  || EQ (XCONS (tem)->car, Qmacro))
+		/* Yes, load it and try again.  */
+		{
+		  do_autoload (def, sym);
+		  continue;
+		}
+	      else
 		break;
-	      /* Yes, load it and try again.  */
-	      do_autoload (def, sym);
-	      continue;
 	    }
 	  else if (!EQ (XCONS (def)->car, Qmacro))
 	    break;
@@ -1311,13 +1315,16 @@
 FUNCTION is a symbol; FILE is a file name string to pass to `load'.\n\
 Third arg DOCSTRING is documentation for the function.\n\
 Fourth arg INTERACTIVE if non-nil says function can be called interactively.\n\
-Fifth arg MACRO if non-nil says the function is really a macro.\n\
+Fifth arg TYPE indicates the type of the object:\n\
+   nil or omitted says FUNCTION is a function,\n\
+   `keymap' says FUNCTION is really a keymap, and\n\
+   `macro' or t says FUNCTION is really a macro.\n\
 Third through fifth args give info about the real definition.\n\
 They default to nil.\n\
 If FUNCTION is already defined other than as an autoload,\n\
 this does nothing and returns nil.")
-  (function, file, docstring, interactive, macro)
-     Lisp_Object function, file, docstring, interactive, macro;
+  (function, file, docstring, interactive, type)
+     Lisp_Object function, file, docstring, interactive, type;
 {
 #ifdef NO_ARG_ARRAY
   Lisp_Object args[4];
@@ -1336,7 +1343,7 @@
   args[0] = file;
   args[1] = docstring;
   args[2] = interactive;
-  args[3] = macro;
+  args[3] = type;
 
   return Ffset (function, Fcons (Qautoload, Flist (4, &args[0])));
 #else /* NO_ARG_ARRAY */