return pdl;
}
+/* Return a pointer to somewhere near the top of the C stack. */
+void *
+near_C_stack_top (void)
+{
+ return backtrace_args (backtrace_top ());
+}
void
init_eval_once (void)
specpdl = specpdl_ptr = pdlvec + 1;
/* Don't forget to update docs (lispref node "Local Variables"). */
max_specpdl_size = 1300; /* 1000 is not enough for CEDET's c-by.el. */
- max_lisp_eval_depth = 600;
+ max_lisp_eval_depth = 800;
Vrun_hooks = Qnil;
}
void
init_eval (void)
{
+ gcprolist = 0;
+ byte_stack_list = 0;
specpdl_ptr = specpdl;
{ /* Put a dummy catcher at top-level so that handlerlist is never NULL.
This is important since handlerlist->nextfree holds the freelist
if (!NILP (Vinternal_interpreter_environment)
&& CONSP (quoted)
&& EQ (XCAR (quoted), Qlambda))
- /* This is a lambda expression within a lexical environment;
- return an interpreted closure instead of a simple lambda. */
- return Fcons (Qclosure, Fcons (Vinternal_interpreter_environment,
- XCDR (quoted)));
+ { /* This is a lambda expression within a lexical environment;
+ return an interpreted closure instead of a simple lambda. */
+ Lisp_Object cdr = XCDR (quoted);
+ Lisp_Object tmp = cdr;
+ if (CONSP (tmp)
+ && (tmp = XCDR (tmp), CONSP (tmp))
+ && (tmp = XCAR (tmp), CONSP (tmp))
+ && (EQ (QCdocumentation, XCAR (tmp))))
+ { /* Handle the special (:documentation <form>) to build the docstring
+ dynamically. */
+ Lisp_Object docstring = eval_sub (Fcar (XCDR (tmp)));
+ CHECK_STRING (docstring);
+ cdr = Fcons (XCAR (cdr), Fcons (docstring, XCDR (XCDR (cdr))));
+ }
+ return Fcons (Qclosure, Fcons (Vinternal_interpreter_environment,
+ cdr));
+ }
else
/* Simply quote the argument. */
return quoted;
void
run_hook_with_args_2 (Lisp_Object hook, Lisp_Object arg1, Lisp_Object arg2)
{
- Frun_hook_with_args (3, ((Lisp_Object []) { hook, arg1, arg2 }));
+ CALLN (Frun_hook_with_args, hook, arg1, arg2);
}
/* Apply fn to arg. */
Lisp_Object
apply1 (Lisp_Object fn, Lisp_Object arg)
{
- return (NILP (arg) ? Ffuncall (1, &fn)
- : Fapply (2, ((Lisp_Object []) { fn, arg })));
+ return NILP (arg) ? Ffuncall (1, &fn) : CALLN (Fapply, fn, arg);
}
/* Call function fn on no arguments. */
Lisp_Object
call1 (Lisp_Object fn, Lisp_Object arg1)
{
- return Ffuncall (2, ((Lisp_Object []) { fn, arg1 }));
+ return CALLN (Ffuncall, fn, arg1);
}
/* Call function fn with 2 arguments arg1, arg2. */
Lisp_Object
call2 (Lisp_Object fn, Lisp_Object arg1, Lisp_Object arg2)
{
- return Ffuncall (3, ((Lisp_Object []) { fn, arg1, arg2 }));
+ return CALLN (Ffuncall, fn, arg1, arg2);
}
/* Call function fn with 3 arguments arg1, arg2, arg3. */
Lisp_Object
call3 (Lisp_Object fn, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3)
{
- return Ffuncall (4, ((Lisp_Object []) { fn, arg1, arg2, arg3 }));
+ return CALLN (Ffuncall, fn, arg1, arg2, arg3);
}
/* Call function fn with 4 arguments arg1, arg2, arg3, arg4. */
call4 (Lisp_Object fn, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3,
Lisp_Object arg4)
{
- return Ffuncall (5, ((Lisp_Object []) { fn, arg1, arg2, arg3, arg4 }));
+ return CALLN (Ffuncall, fn, arg1, arg2, arg3, arg4);
}
/* Call function fn with 5 arguments arg1, arg2, arg3, arg4, arg5. */
call5 (Lisp_Object fn, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3,
Lisp_Object arg4, Lisp_Object arg5)
{
- return Ffuncall (6, ((Lisp_Object []) { fn, arg1, arg2, arg3, arg4, arg5 }));
+ return CALLN (Ffuncall, fn, arg1, arg2, arg3, arg4, arg5);
}
/* Call function fn with 6 arguments arg1, arg2, arg3, arg4, arg5, arg6. */
call6 (Lisp_Object fn, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3,
Lisp_Object arg4, Lisp_Object arg5, Lisp_Object arg6)
{
- return Ffuncall (7, ((Lisp_Object [])
- { fn, arg1, arg2, arg3, arg4, arg5, arg6 }));
+ return CALLN (Ffuncall, fn, arg1, arg2, arg3, arg4, arg5, arg6);
}
/* Call function fn with 7 arguments arg1, arg2, arg3, arg4, arg5, arg6, arg7. */
call7 (Lisp_Object fn, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3,
Lisp_Object arg4, Lisp_Object arg5, Lisp_Object arg6, Lisp_Object arg7)
{
- return Ffuncall (8, ((Lisp_Object [])
- { fn, arg1, arg2, arg3, arg4, arg5, arg6, arg7 }));
+ return CALLN (Ffuncall, fn, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
}
/* The caller should GCPRO all the elements of ARGS. */
while (backtrace_p (pdl))
{
- write_string (backtrace_debug_on_exit (pdl) ? "* " : " ", 2);
+ write_string (backtrace_debug_on_exit (pdl) ? "* " : " ");
if (backtrace_nargs (pdl) == UNEVALLED)
{
Fprin1 (Fcons (backtrace_function (pdl), *backtrace_args (pdl)),
Qnil);
- write_string ("\n", -1);
+ write_string ("\n");
}
else
{
tem = backtrace_function (pdl);
Fprin1 (tem, Qnil); /* This can QUIT. */
- write_string ("(", -1);
+ write_string ("(");
{
ptrdiff_t i;
for (i = 0; i < backtrace_nargs (pdl); i++)
{
- if (i) write_string (" ", -1);
+ if (i) write_string (" ");
Fprin1 (backtrace_args (pdl)[i], Qnil);
}
}
- write_string (")\n", -1);
+ write_string (")\n");
}
pdl = backtrace_next (pdl);
}
DEFSYM (Qautoload, "autoload");
DEFSYM (Qinhibit_debugger, "inhibit-debugger");
DEFSYM (Qmacro, "macro");
- DEFSYM (Qdeclare, "declare");
/* Note that the process handling also uses Qexit, but we don't want
to staticpro it twice, so we just do it here. */
DEFSYM (Qand_rest, "&rest");
DEFSYM (Qand_optional, "&optional");
DEFSYM (Qclosure, "closure");
+ DEFSYM (QCdocumentation, ":documentation");
DEFSYM (Qdebug, "debug");
DEFVAR_LISP ("inhibit-debugger", Vinhibit_debugger,