comparison src/eval.c @ 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 ed79bb8047e8
children b6c62e4abf59
comparison
equal deleted inserted replaced
1563:e721339972b0 1564:b327816041d1
803 /* Not defined or definition not suitable */ 803 /* Not defined or definition not suitable */
804 break; 804 break;
805 if (EQ (XCONS (def)->car, Qautoload)) 805 if (EQ (XCONS (def)->car, Qautoload))
806 { 806 {
807 /* Autoloading function: will it be a macro when loaded? */ 807 /* Autoloading function: will it be a macro when loaded? */
808 tem = Fcar (Fnthcdr (make_number (4), def)); 808 tem = Fnth (make_number (4), def);
809 if (NILP (tem)) 809 if (EQ (XCONS (tem)->car, Qt)
810 || EQ (XCONS (tem)->car, Qmacro))
811 /* Yes, load it and try again. */
812 {
813 do_autoload (def, sym);
814 continue;
815 }
816 else
810 break; 817 break;
811 /* Yes, load it and try again. */
812 do_autoload (def, sym);
813 continue;
814 } 818 }
815 else if (!EQ (XCONS (def)->car, Qmacro)) 819 else if (!EQ (XCONS (def)->car, Qmacro))
816 break; 820 break;
817 else expander = XCONS (def)->cdr; 821 else expander = XCONS (def)->cdr;
818 } 822 }
1309 DEFUN ("autoload", Fautoload, Sautoload, 2, 5, 0, 1313 DEFUN ("autoload", Fautoload, Sautoload, 2, 5, 0,
1310 "Define FUNCTION to autoload from FILE.\n\ 1314 "Define FUNCTION to autoload from FILE.\n\
1311 FUNCTION is a symbol; FILE is a file name string to pass to `load'.\n\ 1315 FUNCTION is a symbol; FILE is a file name string to pass to `load'.\n\
1312 Third arg DOCSTRING is documentation for the function.\n\ 1316 Third arg DOCSTRING is documentation for the function.\n\
1313 Fourth arg INTERACTIVE if non-nil says function can be called interactively.\n\ 1317 Fourth arg INTERACTIVE if non-nil says function can be called interactively.\n\
1314 Fifth arg MACRO if non-nil says the function is really a macro.\n\ 1318 Fifth arg TYPE indicates the type of the object:\n\
1319 nil or omitted says FUNCTION is a function,\n\
1320 `keymap' says FUNCTION is really a keymap, and\n\
1321 `macro' or t says FUNCTION is really a macro.\n\
1315 Third through fifth args give info about the real definition.\n\ 1322 Third through fifth args give info about the real definition.\n\
1316 They default to nil.\n\ 1323 They default to nil.\n\
1317 If FUNCTION is already defined other than as an autoload,\n\ 1324 If FUNCTION is already defined other than as an autoload,\n\
1318 this does nothing and returns nil.") 1325 this does nothing and returns nil.")
1319 (function, file, docstring, interactive, macro) 1326 (function, file, docstring, interactive, type)
1320 Lisp_Object function, file, docstring, interactive, macro; 1327 Lisp_Object function, file, docstring, interactive, type;
1321 { 1328 {
1322 #ifdef NO_ARG_ARRAY 1329 #ifdef NO_ARG_ARRAY
1323 Lisp_Object args[4]; 1330 Lisp_Object args[4];
1324 #endif 1331 #endif
1325 1332
1334 1341
1335 #ifdef NO_ARG_ARRAY 1342 #ifdef NO_ARG_ARRAY
1336 args[0] = file; 1343 args[0] = file;
1337 args[1] = docstring; 1344 args[1] = docstring;
1338 args[2] = interactive; 1345 args[2] = interactive;
1339 args[3] = macro; 1346 args[3] = type;
1340 1347
1341 return Ffset (function, Fcons (Qautoload, Flist (4, &args[0]))); 1348 return Ffset (function, Fcons (Qautoload, Flist (4, &args[0])));
1342 #else /* NO_ARG_ARRAY */ 1349 #else /* NO_ARG_ARRAY */
1343 return Ffset (function, Fcons (Qautoload, Flist (4, &file))); 1350 return Ffset (function, Fcons (Qautoload, Flist (4, &file)));
1344 #endif /* not NO_ARG_ARRAY */ 1351 #endif /* not NO_ARG_ARRAY */