aboutsummaryrefslogtreecommitdiffstats
path: root/src/data.c
diff options
context:
space:
mode:
authorRichard M. Stallman1994-09-30 20:32:45 +0000
committerRichard M. Stallman1994-09-30 20:32:45 +0000
commit62476adc5590f2441e4f3b35834da7022f0363c7 (patch)
treecb2895e43c36c038ef021dc32fa5f827a964af52 /src/data.c
parentee70dba58986cc93c0e188ac28c88a1a979857cf (diff)
downloademacs-62476adc5590f2441e4f3b35834da7022f0363c7.tar.gz
emacs-62476adc5590f2441e4f3b35834da7022f0363c7.zip
(Fmake_local_variable): Doc fix.
(Flocal_variable_p): New function. (syms_of_data): defsubr it.
Diffstat (limited to 'src/data.c')
-rw-r--r--src/data.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/data.c b/src/data.c
index c44bd6f0d46..8623281463f 100644
--- a/src/data.c
+++ b/src/data.c
@@ -1133,7 +1133,10 @@ VARIABLE previously had. If VARIABLE was void, it remains void.\)\n\
1133See also `make-variable-buffer-local'.\n\n\ 1133See also `make-variable-buffer-local'.\n\n\
1134If the variable is already arranged to become local when set,\n\ 1134If the variable is already arranged to become local when set,\n\
1135this function causes a local value to exist for this buffer,\n\ 1135this function causes a local value to exist for this buffer,\n\
1136just as if the variable were set.") 1136just as setting the variable would do.\n\
1137\n\
1138Do not use `make-local-variable' to make a hook variable buffer-local.\n\
1139Use `make-local-hook' instead.")
1137 (sym) 1140 (sym)
1138 register Lisp_Object sym; 1141 register Lisp_Object sym;
1139{ 1142{
@@ -1241,6 +1244,23 @@ From now on the default value will apply in this buffer.")
1241 1244
1242 return sym; 1245 return sym;
1243} 1246}
1247
1248DEFUN ("local-variable-p", Flocal_variable_p, Slocal_variable_p,
1249 1, 1, 0,
1250 "Non-nil if VARIABLE has a local binding in the current buffer.")
1251 (sym)
1252 register Lisp_Object sym;
1253{
1254 Lisp_Object valcontents;
1255
1256 CHECK_SYMBOL (sym, 0);
1257
1258 valcontents = XSYMBOL (sym)->value;
1259 return ((BUFFER_LOCAL_VALUEP (valcontents)
1260 || SOME_BUFFER_LOCAL_VALUEP (valcontents)
1261 || BUFFER_OBJFWDP (valcontents))
1262 ? Qt : Qnil);
1263}
1244 1264
1245/* Find the function at the end of a chain of symbol function indirections. */ 1265/* Find the function at the end of a chain of symbol function indirections. */
1246 1266
@@ -1253,7 +1273,7 @@ From now on the default value will apply in this buffer.")
1253 error if the chain ends up unbound. */ 1273 error if the chain ends up unbound. */
1254Lisp_Object 1274Lisp_Object
1255indirect_function (object) 1275indirect_function (object)
1256 register Lisp_Object object; 1276 register Lisp_Object object;
1257{ 1277{
1258 Lisp_Object tortoise, hare; 1278 Lisp_Object tortoise, hare;
1259 1279
@@ -2292,6 +2312,7 @@ syms_of_data ()
2292 defsubr (&Smake_variable_buffer_local); 2312 defsubr (&Smake_variable_buffer_local);
2293 defsubr (&Smake_local_variable); 2313 defsubr (&Smake_local_variable);
2294 defsubr (&Skill_local_variable); 2314 defsubr (&Skill_local_variable);
2315 defsubr (&Slocal_variable_p);
2295 defsubr (&Saref); 2316 defsubr (&Saref);
2296 defsubr (&Saset); 2317 defsubr (&Saset);
2297 defsubr (&Snumber_to_string); 2318 defsubr (&Snumber_to_string);