summaryrefslogtreecommitdiff
path: root/src/buffer.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2002-07-07 10:17:26 +0000
committerRichard M. Stallman <rms@gnu.org>2002-07-07 10:17:26 +0000
commitf0bac7deee2f56ac02ff886dc5a1b7210e1fd089 (patch)
tree06f43b7a2decbcd34de2c4b92215cc7d60564c8b /src/buffer.c
parent0654d6e3fc28a7723fb4990bee8f9ad19cf0904b (diff)
downloademacs-f0bac7deee2f56ac02ff886dc5a1b7210e1fd089.tar.gz
(Fbuffer_local_value): Store current value into its binding
so we get the up-to-date value for the binding that is loaded.
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 65300cd9827..e371b3133ae 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -854,7 +854,26 @@ is the default binding of variable. */)
result = Fdefault_value (symbol);
}
else
- result = XCDR (result);
+ {
+ Lisp_Object valcontents;
+ Lisp_Object current_alist_element;
+
+ /* What binding is loaded right now? */
+ valcontents = SYMBOL_VALUE (symbol);
+ current_alist_element
+ = XCAR (XBUFFER_LOCAL_VALUE (valcontents)->cdr);
+
+ /* The value of the currently loaded binding is not
+ stored in it, but rather in the realvalue slot.
+ Store that value into the binding it belongs to
+ in case that is the one we are about to use. */
+
+ Fsetcdr (current_alist_element,
+ do_symval_forwarding (XBUFFER_LOCAL_VALUE (valcontents)->realvalue));
+
+ /* Now get the (perhaps updated) value out of the binding. */
+ result = XCDR (result);
+ }
if (EQ (result, Qunbound))
return Fsignal (Qvoid_variable, Fcons (symbol, Qnil));