summaryrefslogtreecommitdiff
path: root/src/data.c
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2007-11-22 19:48:57 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2007-11-22 19:48:57 +0000
commit569c11e30659c45af971a5e02df008cb238fcaa5 (patch)
treeec660da0671e1b7dc8295f6126db064306dab330 /src/data.c
parent693b2fe29632bd80290ccc9843c3ea3766d3ae54 (diff)
downloademacs-569c11e30659c45af971a5e02df008cb238fcaa5.tar.gz
(set_internal): Set the value in the `cons-cell' (for
Buffer_Local_values) not only for frame-local variables.
Diffstat (limited to 'src/data.c')
-rw-r--r--src/data.c24
1 files changed, 5 insertions, 19 deletions
diff --git a/src/data.c b/src/data.c
index faf3bc8df9b..787e81c9aed 100644
--- a/src/data.c
+++ b/src/data.c
@@ -1238,6 +1238,7 @@ set_internal (symbol, newval, buf, bindflag)
|| buf != XBUFFER (XBUFFER_LOCAL_VALUE (valcontents)->buffer)
|| (XBUFFER_LOCAL_VALUE (valcontents)->check_frame
&& !EQ (selected_frame, XBUFFER_LOCAL_VALUE (valcontents)->frame))
+ /* Also unload a global binding (if the var is local_if_set). */
|| (EQ (XCAR (current_alist_element),
current_alist_element)))
{
@@ -1257,7 +1258,7 @@ set_internal (symbol, newval, buf, bindflag)
{
/* This buffer still sees the default value. */
- /* If the variable is a Lisp_Some_Buffer_Local_Value,
+ /* If the variable is not local_if_set,
or if this is `let' rather than `set',
make CURRENT-ALIST-ELEMENT point to itself,
indicating that we're seeing the default value.
@@ -1298,6 +1299,9 @@ set_internal (symbol, newval, buf, bindflag)
XBUFFER_LOCAL_VALUE (valcontents)->frame = selected_frame;
}
innercontents = XBUFFER_LOCAL_VALUE (valcontents)->realvalue;
+
+ /* Store the new value in the cons-cell. */
+ XSETCDR (XCAR (XBUFFER_LOCAL_VALUE (valcontents)->cdr), newval);
}
/* If storing void (making the symbol void), forward only through
@@ -1307,24 +1311,6 @@ set_internal (symbol, newval, buf, bindflag)
else
store_symval_forwarding (symbol, innercontents, newval, buf);
- /* If we just set a variable whose current binding is frame-local,
- store the new value in the frame parameter too. */
-
- if (BUFFER_LOCAL_VALUEP (valcontents))
- {
- /* What binding is loaded right now? */
- current_alist_element
- = XCAR (XBUFFER_LOCAL_VALUE (valcontents)->cdr);
-
- /* If the current buffer is not the buffer whose binding is
- loaded, or if there may be frame-local bindings and the frame
- isn't the right one, or if it's a Lisp_Buffer_Local_Value and
- the default binding is loaded, the loaded binding may be the
- wrong one. */
- if (XBUFFER_LOCAL_VALUE (valcontents)->found_for_frame)
- XSETCDR (current_alist_element, newval);
- }
-
return newval;
}