# HG changeset patch # User Richard M. Stallman # Date 1026037046 0 # Node ID ca604a52d2676d8afcf9e83f3ef7cc04434a7ab8 # Parent 9b8d032820a25baf43d9493007ec11110d0d0c4b (Fbuffer_local_value): Store current value into its binding so we get the up-to-date value for the binding that is loaded. diff -r 9b8d032820a2 -r ca604a52d267 src/buffer.c --- a/src/buffer.c Sun Jul 07 10:07:32 2002 +0000 +++ b/src/buffer.c Sun Jul 07 10:17:26 2002 +0000 @@ -854,7 +854,26 @@ 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));