else
{
swap_in_symval_forwarding (sym, blv);
- valcontents = BLV_VALUE (blv);
+ valcontents = blv_value (blv);
}
break;
}
(register Lisp_Object symbol)
{
CHECK_SYMBOL (symbol);
- return (EQ (SVAR (XSYMBOL (symbol), function), Qunbound) ? Qnil : Qt);
+ return EQ (XSYMBOL (symbol)->function, Qunbound) ? Qnil : Qt;
}
DEFUN ("makunbound", Fmakunbound, Smakunbound, 1, 1, 0,
CHECK_SYMBOL (symbol);
if (NILP (symbol) || EQ (symbol, Qt))
xsignal1 (Qsetting_constant, symbol);
- SVAR (XSYMBOL (symbol), function) = Qunbound;
+ set_symbol_function (symbol, Qunbound);
return symbol;
}
(register Lisp_Object symbol)
{
CHECK_SYMBOL (symbol);
- if (!EQ (SVAR (XSYMBOL (symbol), function), Qunbound))
- return SVAR (XSYMBOL (symbol), function);
+ if (!EQ (XSYMBOL (symbol)->function, Qunbound))
+ return XSYMBOL (symbol)->function;
xsignal1 (Qvoid_function, symbol);
}
(register Lisp_Object symbol)
{
CHECK_SYMBOL (symbol);
- return SVAR (XSYMBOL (symbol), plist);
+ return XSYMBOL (symbol)->plist;
}
DEFUN ("symbol-name", Fsymbol_name, Ssymbol_name, 1, 1, 0,
if (NILP (symbol) || EQ (symbol, Qt))
xsignal1 (Qsetting_constant, symbol);
- function = SVAR (XSYMBOL (symbol), function);
+ function = XSYMBOL (symbol)->function;
if (!NILP (Vautoload_queue) && !EQ (function, Qunbound))
Vautoload_queue = Fcons (Fcons (symbol, function), Vautoload_queue);
if (CONSP (function) && EQ (XCAR (function), Qautoload))
Fput (symbol, Qautoload, XCDR (function));
- SVAR (XSYMBOL (symbol), function) = definition;
+ set_symbol_function (symbol, definition);
/* Handle automatic advice activation. */
- if (CONSP (SVAR (XSYMBOL (symbol), plist))
+ if (CONSP (XSYMBOL (symbol)->plist)
&& !NILP (Fget (symbol, Qad_advice_info)))
{
call2 (Qad_activate_internal, symbol, Qnil);
- definition = SVAR (XSYMBOL (symbol), function);
+ definition = XSYMBOL (symbol)->function;
}
return definition;
}
(register Lisp_Object symbol, Lisp_Object definition, Lisp_Object docstring)
{
CHECK_SYMBOL (symbol);
- if (CONSP (SVAR (XSYMBOL (symbol), function))
- && EQ (XCAR (SVAR (XSYMBOL (symbol), function)), Qautoload))
+ if (CONSP (XSYMBOL (symbol)->function)
+ && EQ (XCAR (XSYMBOL (symbol)->function), Qautoload))
LOADHIST_ATTACH (Fcons (Qt, symbol));
if (!NILP (Vpurify_flag)
/* If `definition' is a keymap, immutable (and copying) is wrong. */
(register Lisp_Object symbol, Lisp_Object newplist)
{
CHECK_SYMBOL (symbol);
- SVAR (XSYMBOL (symbol), plist) = newplist;
+ set_symbol_plist (symbol, newplist);
return newplist;
}
DEFUN ("indirect-variable", Findirect_variable, Sindirect_variable, 1, 1, 0,
doc: /* Return the variable at the end of OBJECT's variable chain.
-If OBJECT is a symbol, follow all variable indirections and return the final
-variable. If OBJECT is not a symbol, just return it.
-Signal a cyclic-variable-indirection error if there is a loop in the
-variable chain of symbols. */)
+If OBJECT is a symbol, follow its variable indirections (if any), and
+return the variable at the end of the chain of aliases. See Info node
+`(elisp)Variable Aliases'.
+
+If OBJECT is not a symbol, just return it. If there is a loop in the
+chain of aliases, signal a `cyclic-variable-indirection' error. */)
(Lisp_Object object)
{
if (SYMBOLP (object))
/* Unload the previously loaded binding. */
if (blv->fwd)
- SET_BLV_VALUE (blv, do_symval_forwarding (blv->fwd));
+ set_blv_value (blv, do_symval_forwarding (blv->fwd));
/* Select the global binding in the symbol. */
- blv->valcell = blv->defcell;
+ set_blv_valcell (blv, blv->defcell);
if (blv->fwd)
store_symval_forwarding (blv->fwd, XCDR (blv->defcell), NULL);
/* Indicate that the global binding is set up now. */
- blv->where = Qnil;
- SET_BLV_FOUND (blv, 0);
+ set_blv_where (blv, Qnil);
+ set_blv_found (blv, 0);
}
/* Set up the buffer-local symbol SYMBOL for validity in the current buffer.
/* Unload the previously loaded binding. */
tem1 = blv->valcell;
if (blv->fwd)
- SET_BLV_VALUE (blv, do_symval_forwarding (blv->fwd));
+ set_blv_value (blv, do_symval_forwarding (blv->fwd));
/* Choose the new binding. */
{
Lisp_Object var;
XSETSYMBOL (var, symbol);
if (blv->frame_local)
{
- tem1 = assq_no_quit (var, FGET (XFRAME (selected_frame),
- param_alist));
- blv->where = selected_frame;
+ tem1 = assq_no_quit (var, XFRAME (selected_frame)->param_alist);
+ set_blv_where (blv, selected_frame);
}
else
{
tem1 = blv->defcell;
/* Load the new binding. */
- blv->valcell = tem1;
+ set_blv_valcell (blv, tem1);
if (blv->fwd)
- store_symval_forwarding (blv->fwd, BLV_VALUE (blv), NULL);
+ store_symval_forwarding (blv->fwd, blv_value (blv), NULL);
}
}
\f
{
struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (sym);
swap_in_symval_forwarding (sym, blv);
- return blv->fwd ? do_symval_forwarding (blv->fwd) : BLV_VALUE (blv);
+ return blv->fwd ? do_symval_forwarding (blv->fwd) : blv_value (blv);
}
/* FALLTHROUGH */
case SYMBOL_FORWARDED:
/* Write out `realvalue' to the old loaded binding. */
if (blv->fwd)
- SET_BLV_VALUE (blv, do_symval_forwarding (blv->fwd));
+ set_blv_value (blv, do_symval_forwarding (blv->fwd));
/* Find the new binding. */
XSETSYMBOL (symbol, sym); /* May have changed via aliasing. */
tem1 = Fassq (symbol,
(blv->frame_local
- ? FGET (XFRAME (where), param_alist)
+ ? XFRAME (where)->param_alist
: BVAR (XBUFFER (where), local_var_alist)));
- blv->where = where;
- blv->found = 1;
+ set_blv_where (blv, where);
+ set_blv_found (blv, 1);
if (NILP (tem1))
{
if (bindflag || !blv->local_if_set
|| let_shadows_buffer_binding_p (sym))
{
- blv->found = 0;
+ set_blv_found (blv, 0);
tem1 = blv->defcell;
}
/* If it's a local_if_set, being set not bound,
bindings, not for frame-local bindings. */
eassert (!blv->frame_local);
tem1 = Fcons (symbol, XCDR (blv->defcell));
- BVAR (XBUFFER (where), local_var_alist)
- = Fcons (tem1, BVAR (XBUFFER (where), local_var_alist));
+ bset_local_var_alist
+ (XBUFFER (where),
+ Fcons (tem1, BVAR (XBUFFER (where), local_var_alist)));
}
}
/* Record which binding is now loaded. */
- blv->valcell = tem1;
+ set_blv_valcell (blv, tem1);
}
/* Store the new value in the cons cell. */
- SET_BLV_VALUE (blv, newval);
+ set_blv_value (blv, newval);
if (blv->fwd)
{
eassert (!(forwarded && BUFFER_OBJFWDP (valcontents.fwd)));
eassert (!(forwarded && KBOARD_OBJFWDP (valcontents.fwd)));
blv->fwd = forwarded ? valcontents.fwd : NULL;
- blv->where = Qnil;
+ set_blv_where (blv, Qnil);
blv->frame_local = 0;
blv->local_if_set = 0;
- blv->defcell = tem;
- blv->valcell = tem;
- SET_BLV_FOUND (blv, 0);
+ set_blv_defcell (blv, tem);
+ set_blv_valcell (blv, tem);
+ set_blv_found (blv, 0);
return blv;
}
default value. */
find_symbol_value (variable);
- BVAR (current_buffer, local_var_alist)
- = Fcons (Fcons (variable, XCDR (blv->defcell)),
- BVAR (current_buffer, local_var_alist));
+ bset_local_var_alist
+ (current_buffer,
+ Fcons (Fcons (variable, XCDR (blv->defcell)),
+ BVAR (current_buffer, local_var_alist)));
/* Make sure symbol does not think it is set up for this buffer;
force it to look once again for this buffer's value. */
if (current_buffer == XBUFFER (blv->where))
- blv->where = Qnil;
- /* blv->valcell = blv->defcell;
- * SET_BLV_FOUND (blv, 0); */
- blv->found = 0;
+ set_blv_where (blv, Qnil);
+ set_blv_found (blv, 0);
}
/* If the symbol forwards into a C variable, then load the binding
XSETSYMBOL (variable, sym); /* Propagate variable indirection. */
tem = Fassq (variable, BVAR (current_buffer, local_var_alist));
if (!NILP (tem))
- BVAR (current_buffer, local_var_alist)
- = Fdelq (tem, BVAR (current_buffer, local_var_alist));
+ bset_local_var_alist
+ (current_buffer,
+ Fdelq (tem, BVAR (current_buffer, local_var_alist)));
/* If the symbol is set up with the current buffer's binding
loaded, recompute its value. We have to do it now, or else
Lisp_Object buf; XSETBUFFER (buf, current_buffer);
if (EQ (buf, blv->where))
{
- blv->where = Qnil;
- /* blv->valcell = blv->defcell;
- * SET_BLV_FOUND (blv, 0); */
- blv->found = 0;
+ set_blv_where (blv, Qnil);
+ set_blv_found (blv, 0);
find_symbol_value (variable);
}
}
if (EQ (variable, XCAR (elt)))
{
eassert (!blv->frame_local);
- eassert (BLV_FOUND (blv) || !EQ (blv->where, tmp));
+ eassert (blv_found (blv) || !EQ (blv->where, tmp));
return Qt;
}
}
- eassert (!BLV_FOUND (blv) || !EQ (blv->where, tmp));
+ eassert (!blv_found (blv) || !EQ (blv->where, tmp));
return Qnil;
}
case SYMBOL_FORWARDED:
if (!NILP (Flocal_variable_p (variable, Qnil)))
return Fcurrent_buffer ();
else if (sym->redirect == SYMBOL_LOCALIZED
- && BLV_FOUND (SYMBOL_BLV (sym)))
+ && blv_found (SYMBOL_BLV (sym)))
return SYMBOL_BLV (sym)->where;
else
return Qnil;
{
if (!SYMBOLP (hare) || EQ (hare, Qunbound))
break;
- hare = SVAR (XSYMBOL (hare), function);
+ hare = XSYMBOL (hare)->function;
if (!SYMBOLP (hare) || EQ (hare, Qunbound))
break;
- hare = SVAR (XSYMBOL (hare), function);
+ hare = XSYMBOL (hare)->function;
- tortoise = SVAR (XSYMBOL (tortoise), function);
+ tortoise = XSYMBOL (tortoise)->function;
if (EQ (hare, tortoise))
xsignal1 (Qcyclic_function_indirection, object);
/* Optimize for no indirection. */
result = object;
if (SYMBOLP (result) && !EQ (result, Qunbound)
- && (result = SVAR (XSYMBOL (result), function), SYMBOLP (result)))
+ && (result = XSYMBOL (result)->function, SYMBOLP (result)))
result = indirect_function (result);
if (!EQ (result, Qunbound))
return result;
defsubr (&Ssubr_arity);
defsubr (&Ssubr_name);
- SVAR (XSYMBOL (Qwholenump), function) = SVAR (XSYMBOL (Qnatnump), function);
+ set_symbol_function (Qwholenump, XSYMBOL (Qnatnump)->function);
DEFVAR_LISP ("most-positive-fixnum", Vmost_positive_fixnum,
doc: /* The largest value that is representable in a Lisp integer. */);