diff options
| author | Jim Blandy | 1992-11-07 07:00:37 +0000 |
|---|---|---|
| committer | Jim Blandy | 1992-11-07 07:00:37 +0000 |
| commit | ee9ee63cfadc62d9f31c119922deef92eca01164 (patch) | |
| tree | dfff8d0ace4528851872df7a488c8d5592950f20 /src/eval.c | |
| parent | 2381d133384a57886ae6509b4f2712cc706999d2 (diff) | |
| download | emacs-ee9ee63cfadc62d9f31c119922deef92eca01164.tar.gz emacs-ee9ee63cfadc62d9f31c119922deef92eca01164.zip | |
* 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.
Diffstat (limited to 'src/eval.c')
| -rw-r--r-- | src/eval.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/src/eval.c b/src/eval.c index 3974568329f..7726aadcb31 100644 --- a/src/eval.c +++ b/src/eval.c | |||
| @@ -805,12 +805,16 @@ definitions to shadow the loaded ones for use in file byte-compilation.") | |||
| 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; |
| @@ -1311,13 +1315,16 @@ DEFUN ("autoload", Fautoload, Sautoload, 2, 5, 0, | |||
| 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]; |
| @@ -1336,7 +1343,7 @@ this does nothing and returns nil.") | |||
| 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 */ |