See also `make-variable-buffer-local'.\n\n\
If the variable is already arranged to become local when set,\n\
this function causes a local value to exist for this buffer,\n\
-just as if the variable were set.")
+just as setting the variable would do.\n\
+\n\
+Do not use `make-local-variable' to make a hook variable buffer-local.\n\
+Use `make-local-hook' instead.")
(sym)
register Lisp_Object sym;
{
return sym;
}
+
+DEFUN ("local-variable-p", Flocal_variable_p, Slocal_variable_p,
+ 1, 1, 0,
+ "Non-nil if VARIABLE has a local binding in the current buffer.")
+ (sym)
+ register Lisp_Object sym;
+{
+ Lisp_Object valcontents;
+
+ CHECK_SYMBOL (sym, 0);
+
+ valcontents = XSYMBOL (sym)->value;
+ return ((BUFFER_LOCAL_VALUEP (valcontents)
+ || SOME_BUFFER_LOCAL_VALUEP (valcontents)
+ || BUFFER_OBJFWDP (valcontents))
+ ? Qt : Qnil);
+}
\f
/* Find the function at the end of a chain of symbol function indirections. */
error if the chain ends up unbound. */
Lisp_Object
indirect_function (object)
- register Lisp_Object object;
+ register Lisp_Object object;
{
Lisp_Object tortoise, hare;
defsubr (&Smake_variable_buffer_local);
defsubr (&Smake_local_variable);
defsubr (&Skill_local_variable);
+ defsubr (&Slocal_variable_p);
defsubr (&Saref);
defsubr (&Saset);
defsubr (&Snumber_to_string);