]> git.eshelyaron.com Git - emacs.git/commitdiff
(Fbuffer_local_value): Store current value into its binding
authorRichard M. Stallman <rms@gnu.org>
Sun, 7 Jul 2002 10:17:26 +0000 (10:17 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sun, 7 Jul 2002 10:17:26 +0000 (10:17 +0000)
so we get the up-to-date value for the binding that is loaded.

src/buffer.c

index 65300cd9827c5dd86f1b9eb50d5d6bf361169ee6..e371b3133ae9602efaf0e2740b99c5e2f70d476a 100644 (file)
@@ -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));