Function: funcall

funcall is a function defined in eval.c.

Signature

(funcall FUNCTION &rest ARGUMENTS)

Documentation

Call first argument as a function, passing remaining arguments to it.

Return the value that function returns. Thus, (funcall 'cons 'x 'y) returns (x . y).

View in manual

Probably introduced at or before Emacs version 15.

Aliases

smie--funcall kmacro-exec-ring-item (obsolete since 29.1)

Source Code

// Defined in /usr/src/emacs/src/eval.c
{
  specpdl_ref count;

  maybe_quit ();

  if (++lisp_eval_depth > max_lisp_eval_depth)
    {
      if (max_lisp_eval_depth < 100)
	max_lisp_eval_depth = 100;
      if (lisp_eval_depth > max_lisp_eval_depth)
	xsignal1 (Qexcessive_lisp_nesting, make_fixnum (lisp_eval_depth));
    }

  count = record_in_backtrace (args[0], &args[1], nargs - 1);

  maybe_gc ();

  if (debug_on_next_call)
    do_debug_on_call (Qlambda, count);

  Lisp_Object val = funcall_general (args[0], nargs - 1, args + 1);

  lisp_eval_depth--;
  if (backtrace_debug_on_exit (specpdl_ref_to_ptr (count)))
    val = call_debugger (list2 (Qexit, val));
  specpdl_ptr--;
  return val;
}