changeset 10605:bc37b55fcbb9

(do_symval_forwarding): Handle display-local vars. (store_symval_forwarding, find_symbol_value): Likewise. (Fmake_variable_buffer_local): Disallow display-local vars here. (Fmake_local_variable): Likewise.
author Karl Heuer <kwzh@gnu.org>
date Tue, 31 Jan 1995 00:52:50 +0000
parents c954d143db84
children 97b210b19217
files src/data.c
diffstat 1 files changed, 29 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/src/data.c	Tue Jan 31 00:36:08 1995 +0000
+++ b/src/data.c	Tue Jan 31 00:52:50 1995 +0000
@@ -642,6 +642,11 @@
       case Lisp_Misc_Buffer_Objfwd:
 	offset = XBUFFER_OBJFWD (valcontents)->offset;
 	return *(Lisp_Object *)(offset + (char *)current_buffer);
+
+      case Lisp_Misc_Display_Objfwd:
+	offset = XDISPLAY_OBJFWD (valcontents)->offset;
+	return *(Lisp_Object *)(offset
+				+ (char *)get_perdisplay (selected_frame));
       }
   return valcontents;
 }
@@ -685,8 +690,15 @@
 	      buffer_slot_type_mismatch (offset);
 
 	    *(Lisp_Object *)(offset + (char *)current_buffer) = newval;
-	    break;
 	  }
+	  break;
+
+	case Lisp_Misc_Display_Objfwd:
+	  (*(Lisp_Object *)((char *)get_perdisplay (selected_frame)
+			    + XDISPLAY_OBJFWD (valcontents)->offset))
+	    = newval;
+	  break;
+
 	default:
 	  goto def;
 	}
@@ -711,9 +723,9 @@
 swap_in_symval_forwarding (sym, valcontents)
      Lisp_Object sym, valcontents;
 {
-  /* valcontents is a list
+  /* valcontents is a pointer to a struct resembling the cons
      (REALVALUE BUFFER CURRENT-ALIST-ELEMENT . DEFAULT-VALUE)).
-     
+
      CURRENT-ALIST-ELEMENT is a pointer to an element of BUFFER's
      local_var_alist, that being the element whose car is this
      variable.  Or it can be a pointer to the
@@ -784,6 +796,10 @@
 	case Lisp_Misc_Buffer_Objfwd:
 	  return *(Lisp_Object *)(XBUFFER_OBJFWD (valcontents)->offset
 				  + (char *)current_buffer);
+
+	case Lisp_Misc_Display_Objfwd:
+	  return *(Lisp_Object *)(XDISPLAY_OBJFWD (valcontents)->offset
+				  + (char *)get_perdisplay (selected_frame));
 	}
     }
 
@@ -1101,10 +1117,10 @@
 
   CHECK_SYMBOL (sym, 0);
 
-  if (EQ (sym, Qnil) || EQ (sym, Qt))
+  valcontents = XSYMBOL (sym)->value;
+  if (EQ (sym, Qnil) || EQ (sym, Qt) || DISPLAY_OBJFWDP (valcontents))
     error ("Symbol %s may not be buffer-local", XSYMBOL (sym)->name->data);
 
-  valcontents = XSYMBOL (sym)->value;
   if (BUFFER_LOCAL_VALUEP (valcontents) || BUFFER_OBJFWDP (valcontents))
     return sym;
   if (SOME_BUFFER_LOCAL_VALUEP (valcontents))
@@ -1144,14 +1160,14 @@
 
   CHECK_SYMBOL (sym, 0);
 
-  if (EQ (sym, Qnil) || EQ (sym, Qt))
+  valcontents = XSYMBOL (sym)->value;
+  if (EQ (sym, Qnil) || EQ (sym, Qt) || DISPLAY_OBJFWDP (valcontents))
     error ("Symbol %s may not be buffer-local", XSYMBOL (sym)->name->data);
 
-  valcontents = XSYMBOL (sym)->value;
   if (BUFFER_LOCAL_VALUEP (valcontents) || BUFFER_OBJFWDP (valcontents))
     {
       tem = Fboundp (sym);
-      
+
       /* Make sure the symbol has a local value in this particular buffer,
 	 by setting it to the same value it already has.  */
       Fset (sym, (EQ (tem, Qt) ? Fsymbol_value (sym) : Qunbound));
@@ -1576,7 +1592,7 @@
       char pigbuf[350];	/* see comments in float_to_string */
 
       float_to_string (pigbuf, XFLOAT(num)->data);
-      return build_string (pigbuf);      
+      return build_string (pigbuf);
     }
 #endif /* LISP_FLOAT_TYPE */
 
@@ -1609,7 +1625,7 @@
 
   return make_number (atoi (p));
 }
-  
+
 enum arithop
   { Aadd, Asub, Amult, Adiv, Alogand, Alogior, Alogxor, Amax, Amin };
 
@@ -1698,7 +1714,7 @@
 {
   register Lisp_Object val;
   double next;
-  
+
   for (; argnum < nargs; argnum++)
     {
       val = args[argnum];    /* using args[argnum] as argument to CHECK_NUMBER_... */
@@ -1864,7 +1880,7 @@
 
   if (i2 == 0)
     Fsignal (Qarith_error, Qnil);
-  
+
   i1 %= i2;
 
   /* If the "remainder" comes out with the wrong sign, fix it.  */
@@ -2374,7 +2390,7 @@
     return;
 #endif /* CANNOT_DUMP */
   signal (SIGFPE, arith_error);
-  
+
 #ifdef uts
   signal (SIGEMT, arith_error);
 #endif /* uts */