]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix gnus startup in a separate thread.
authorGiuseppe Scrivano <gscrivano@gnu.org>
Wed, 13 Jan 2010 21:38:06 +0000 (22:38 +0100)
committerGiuseppe Scrivano <gscrivano@gnu.org>
Wed, 13 Jan 2010 21:38:06 +0000 (22:38 +0100)
src/buffer.c
src/data.c

index e1bf4f7933d50647be7e9f0d9fb9289ba1416b32..6f6c0c29ab31f5e44f356b6b12a70c8b0835f741 100644 (file)
@@ -2686,6 +2686,8 @@ swap_out_buffer_local_variables (b)
     {
       if (CONSP (XCAR (alist))
          && (sym = XCAR (XCAR (alist)), SYMBOLP (sym))
+          && (blocal_get_thread_data (XBUFFER_LOCAL_VALUE (SYMBOL_VALUE (sym)),
+                                      sym), 1)
          /* Need not do anything if some other buffer's binding is
             now encached.  */
          && EQ (BLOCAL_BUFFER (XBUFFER_LOCAL_VALUE (SYMBOL_VALUE (sym))),
index abb277e8d931bdad0cc35deecfce2941d7f128e5..5cbdf7e125f677ed607ddec6dfe87ae880a40268 100644 (file)
@@ -813,6 +813,10 @@ blocal_getrealvalue (struct Lisp_Buffer_Local_Value *blv)
   return &XCDR_AS_LVALUE (ensure_thread_local (&(blv->realvalue)));
 }
 
+/* Retrieve the buffer local data for the caller thread.  SYMBOL is used only
+   when the specified buffer local value does not have a binding for the thread
+   and a new one must be created.  */
+
 Lisp_Object *
 blocal_get_thread_data (struct Lisp_Buffer_Local_Value *l, Lisp_Object symbol)
 {
@@ -821,7 +825,7 @@ blocal_get_thread_data (struct Lisp_Buffer_Local_Value *l, Lisp_Object symbol)
     {
       Lisp_Object tem, val, len;
 
-      if (NILP (symbol))
+      if (NILP (symbol) || !initialized)
         abort ();
 
       XSETFASTINT (len, 4);
@@ -1393,6 +1397,8 @@ set_internal (symbol, newval, buf, bindflag)
       if (XSYMBOL (symbol)->indirect_variable)
        XSETSYMBOL (symbol, indirect_variable (XSYMBOL (symbol)));
 
+      blocal_get_thread_data (XBUFFER_LOCAL_VALUE (valcontents), symbol);
+
       /* What binding is loaded right now?  */
       current_alist_element
        = XCAR (BLOCAL_CDR (XBUFFER_LOCAL_VALUE (valcontents)));
@@ -1512,6 +1518,9 @@ default_value (symbol)
         But the `realvalue' slot may be more up to date, since
         ordinary setq stores just that slot.  So use that.  */
       Lisp_Object current_alist_element, alist_element_car;
+
+      blocal_get_thread_data (XBUFFER_LOCAL_VALUE (valcontents), symbol);
+
       current_alist_element
        = XCAR (BLOCAL_CDR (XBUFFER_LOCAL_VALUE (valcontents)));
       alist_element_car = XCAR (current_alist_element);