summaryrefslogtreecommitdiff
path: root/src/data.c
diff options
context:
space:
mode:
authorGerd Moellmann <gerd@gnu.org>2000-06-19 12:12:35 +0000
committerGerd Moellmann <gerd@gnu.org>2000-06-19 12:12:35 +0000
commit4c47c973628be87cc4d1b926acf4879f36c62185 (patch)
treec8ea670949c757a05a18aa20c17b21583643d589 /src/data.c
parentead0e4e0dd0913aea089720c0bf5c62085eb9e5c (diff)
downloademacs-4c47c973628be87cc4d1b926acf4879f36c62185.tar.gz
(set_internal): If variable is frame-local,
store the new value immediately into the frame parameter alist.
Diffstat (limited to 'src/data.c')
-rw-r--r--src/data.c28
1 files changed, 24 insertions, 4 deletions
diff --git a/src/data.c b/src/data.c
index aabed27f20a..b06d8cdec4a 100644
--- a/src/data.c
+++ b/src/data.c
@@ -1024,7 +1024,7 @@ set_internal (symbol, newval, buf, bindflag)
{
int voide = EQ (newval, Qunbound);
- register Lisp_Object valcontents, tem1, current_alist_element;
+ register Lisp_Object valcontents, innercontents, tem1, current_alist_element;
if (buf == 0)
buf = current_buffer;
@@ -1039,7 +1039,8 @@ set_internal (symbol, newval, buf, bindflag)
&& EQ (XSYMBOL (symbol)->obarray, initial_obarray)
&& !EQ (newval, symbol)))
return Fsignal (Qsetting_constant, Fcons (symbol, Qnil));
- valcontents = XSYMBOL (symbol)->value;
+
+ innercontents = valcontents = XSYMBOL (symbol)->value;
if (BUFFER_OBJFWDP (valcontents))
{
@@ -1130,7 +1131,7 @@ set_internal (symbol, newval, buf, bindflag)
XSETBUFFER (XBUFFER_LOCAL_VALUE (valcontents)->buffer, buf);
XBUFFER_LOCAL_VALUE (valcontents)->frame = selected_frame;
}
- valcontents = XBUFFER_LOCAL_VALUE (valcontents)->realvalue;
+ innercontents = XBUFFER_LOCAL_VALUE (valcontents)->realvalue;
}
/* If storing void (making the symbol void), forward only through
@@ -1138,7 +1139,26 @@ set_internal (symbol, newval, buf, bindflag)
if (voide)
store_symval_forwarding (symbol, Qnil, newval);
else
- store_symval_forwarding (symbol, valcontents, newval);
+ store_symval_forwarding (symbol, innercontents, newval);
+
+ /* 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)
+ || SOME_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)
+ XCDR (current_alist_element) = newval;
+ }
return newval;
}