comparison src/eval.c @ 367:a4f53d9b3154 r21-1-13

Import from CVS: tag r21-1-13
author cvs
date Mon, 13 Aug 2007 11:01:07 +0200
parents 972bbb6d6ca2
children cc15677e0335
comparison
equal deleted inserted replaced
366:83d76f480a59 367:a4f53d9b3154
1191 Return result of expanding macros at top level of FORM. 1191 Return result of expanding macros at top level of FORM.
1192 If FORM is not a macro call, it is returned unchanged. 1192 If FORM is not a macro call, it is returned unchanged.
1193 Otherwise, the macro is expanded and the expansion is considered 1193 Otherwise, the macro is expanded and the expansion is considered
1194 in place of FORM. When a non-macro-call results, it is returned. 1194 in place of FORM. When a non-macro-call results, it is returned.
1195 1195
1196 The second optional arg ENVIRONMENT species an environment of macro 1196 The second optional arg ENVIRONMENT specifies an environment of macro
1197 definitions to shadow the loaded ones for use in file byte-compilation. 1197 definitions to shadow the loaded ones for use in file byte-compilation.
1198 */ 1198 */
1199 (form, env)) 1199 (form, environment))
1200 { 1200 {
1201 /* This function can GC */ 1201 /* This function can GC */
1202 /* With cleanups from Hallvard Furuseth. */ 1202 /* With cleanups from Hallvard Furuseth. */
1203 REGISTER Lisp_Object expander, sym, def, tem; 1203 REGISTER Lisp_Object expander, sym, def, tem;
1204 1204
1215 until we get a symbol that is not an alias. */ 1215 until we get a symbol that is not an alias. */
1216 while (SYMBOLP (def)) 1216 while (SYMBOLP (def))
1217 { 1217 {
1218 QUIT; 1218 QUIT;
1219 sym = def; 1219 sym = def;
1220 tem = Fassq (sym, env); 1220 tem = Fassq (sym, environment);
1221 if (NILP (tem)) 1221 if (NILP (tem))
1222 { 1222 {
1223 def = XSYMBOL (sym)->function; 1223 def = XSYMBOL (sym)->function;
1224 if (!UNBOUNDP (def)) 1224 if (!UNBOUNDP (def))
1225 continue; 1225 continue;
1226 } 1226 }
1227 break; 1227 break;
1228 } 1228 }
1229 /* Right now TEM is the result from SYM in ENV, 1229 /* Right now TEM is the result from SYM in ENVIRONMENT,
1230 and if TEM is nil then DEF is SYM's function definition. */ 1230 and if TEM is nil then DEF is SYM's function definition. */
1231 if (NILP (tem)) 1231 if (NILP (tem))
1232 { 1232 {
1233 /* SYM is not mentioned in ENV. 1233 /* SYM is not mentioned in ENVIRONMENT.
1234 Look at its function definition. */ 1234 Look at its function definition. */
1235 if (UNBOUNDP (def) 1235 if (UNBOUNDP (def)
1236 || !CONSP (def)) 1236 || !CONSP (def))
1237 /* Not defined or definition not suitable */ 1237 /* Not defined or definition not suitable */
1238 break; 1238 break;
3273 function = XCDR (function); 3273 function = XCDR (function);
3274 goto retry; 3274 goto retry;
3275 } 3275 }
3276 if (EQ (funcar, Qautoload)) 3276 if (EQ (funcar, Qautoload))
3277 { 3277 {
3278 struct gcpro gcpro1;
3279
3280 GCPRO1 (function);
3278 do_autoload (function, orig_function); 3281 do_autoload (function, orig_function);
3282 UNGCPRO;
3283 function = orig_function;
3279 goto retry; 3284 goto retry;
3280 } 3285 }
3281 if (EQ (funcar, Qlambda)) 3286 if (EQ (funcar, Qlambda))
3282 arglist = Fcar (XCDR (function)); 3287 arglist = Fcar (XCDR (function));
3283 else 3288 else
3336 function = XCDR (function); 3341 function = XCDR (function);
3337 goto retry; 3342 goto retry;
3338 } 3343 }
3339 if (EQ (funcar, Qautoload)) 3344 if (EQ (funcar, Qautoload))
3340 { 3345 {
3346 struct gcpro gcpro1;
3347
3348 GCPRO1 (function);
3341 do_autoload (function, orig_function); 3349 do_autoload (function, orig_function);
3350 UNGCPRO;
3351 function = orig_function;
3342 goto retry; 3352 goto retry;
3343 } 3353 }
3344 if (EQ (funcar, Qlambda)) 3354 if (EQ (funcar, Qlambda))
3345 arglist = Fcar (XCDR (function)); 3355 arglist = Fcar (XCDR (function));
3346 else 3356 else
3633 value, that value may be a function or a list of functions to be 3643 value, that value may be a function or a list of functions to be
3634 called to run the hook. If the value is a function, it is called with 3644 called to run the hook. If the value is a function, it is called with
3635 the given arguments and its return value is returned. If it is a list 3645 the given arguments and its return value is returned. If it is a list
3636 of functions, those functions are called, in order, 3646 of functions, those functions are called, in order,
3637 with the given arguments ARGS. 3647 with the given arguments ARGS.
3638 It is best not to depend on the value return by `run-hook-with-args', 3648 It is best not to depend on the value returned by `run-hook-with-args',
3639 as that may change. 3649 as that may change.
3640 3650
3641 To make a hook variable buffer-local, use `make-local-hook', 3651 To make a hook variable buffer-local, use `make-local-hook',
3642 not `make-local-variable'. 3652 not `make-local-variable'.
3643 */ 3653 */
5247 specpdl_size = 50; 5257 specpdl_size = 50;
5248 specpdl_depth_counter = 0; 5258 specpdl_depth_counter = 0;
5249 specpdl = xnew_array (struct specbinding, specpdl_size); 5259 specpdl = xnew_array (struct specbinding, specpdl_size);
5250 /* XEmacs change: increase these values. */ 5260 /* XEmacs change: increase these values. */
5251 max_specpdl_size = 3000; 5261 max_specpdl_size = 3000;
5252 max_lisp_eval_depth = 500; 5262 max_lisp_eval_depth = 1000;
5253 throw_level = 0; 5263 throw_level = 0;
5254 5264
5255 reinit_eval (); 5265 reinit_eval ();
5256 } 5266 }