Function: makunbound

makunbound is a function defined in data.c.

Signature

(makunbound SYMBOL)

Documentation

Empty out the value cell of SYMBOL, making it void as a variable.

Return SYMBOL. When applied to a variable alias, it undoes the defvaralias.

If a variable is void, trying to evaluate the variable signals a void-variable error, instead of returning a value. For more details, see Info node (elisp) Void Variables.

See also fmakunbound.

View in manual

Probably introduced at or before Emacs version 31.1.

Source Code

// Defined in /usr/src/emacs/src/data.c
{
  CHECK_SYMBOL (symbol);
  if (SYMBOL_CONSTANT_P (symbol))
    xsignal1 (Qsetting_constant, symbol);
  if (XSYMBOL (symbol)->u.s.redirect == SYMBOL_VARALIAS)
    {
      XSYMBOL (symbol)->u.s.redirect = SYMBOL_PLAINVAL;
      SET_SYMBOL_VAL (XSYMBOL (symbol), Qunbound);
    }
  else
    Fset (symbol, Qunbound);
  return symbol;
}