Function: indirect-function

indirect-function is a function defined in data.c.

Signature

(indirect-function OBJECT)

Documentation

Return the function at the end of OBJECT's function chain.

If OBJECT is not a symbol, just return it. Otherwise, follow all function indirections to find the final function binding and return it. Signal a cyclic-function-indirection error if there is a loop in the function chain of symbols.

Probably introduced at or before Emacs version 25.1.

Source Code

// Defined in /usr/src/emacs/src/data.c
{
  Lisp_Object result;

  /* Optimize for no indirection.  */
  result = object;
  if (SYMBOLP (result) && !NILP (result)
      && (result = XSYMBOL (result)->u.s.function, SYMBOLP (result)))
    result = indirect_function (result);
  if (!NILP (result))
    return result;

  return Qnil;
}