Function: internal--define-uninitialized-variable

internal--define-uninitialized-variable is a function defined in eval.c.

Signature

(internal--define-uninitialized-variable SYMBOL &optional DOC)

Documentation

Define SYMBOL as a variable, with DOC as its docstring.

This is like defvar and defconst but without affecting the variable's value.

Source Code

// Defined in /usr/src/emacs/src/eval.c
{
  if (!XSYMBOL (symbol)->u.s.declared_special
      && lexbound_p (symbol))
    /* This test tries to catch the situation where we do
       (let ((<foo-var> ...)) ...(<foo-function> ...)....)
       and where the `foo` package only gets loaded when <foo-function>
       is called, so the outer `let` incorrectly made the binding lexical
       because the <foo-var> wasn't yet declared as dynamic at that point.  */
    xsignal2 (Qerror,
	      build_string ("Defining as dynamic an already lexical var"),
	      symbol);

  XSYMBOL (symbol)->u.s.declared_special = true;
  if (!NILP (doc))
    {
      if (!NILP (Vpurify_flag))
	doc = Fpurecopy (doc);
      Fput (symbol, Qvariable_documentation, doc);
    }
  LOADHIST_ATTACH (symbol);
  return Qnil;
}