changeset 85328:d0d527210b0c

* lisp.h (enum Lisp_Misc_Type): Del Lisp_Misc_Some_Buffer_Local_Value. (XMISCANY): New macro. (XMISCTYPE): Use it. (struct Lisp_Misc_Any): New type. (union Lisp_Misc): Use it. (struct Lisp_Buffer_Local_Value): Add `local_if_set' bit. * data.c (Fboundp, store_symval_forwarding, swap_in_global_binding) (find_symbol_value, set_internal, default_value, Fset_default) (Fmake_variable_buffer_local, Fmake_local_variable) (Fkill_local_variable, Fmake_variable_frame_local, Flocal_variable_p) (Flocal_variable_if_set_p, Fvariable_binding_locus): The SOME_BUFFER_LOCAL_VALUEP distinction is replaced by local_if_set. * alloc.c (allocate_buffer): Set the size and tag. (allocate_misc, mark_maybe_object, mark_object, survives_gc_p): Use XMISCANY. (die): Follow the GNU convention for error messages. * print.c (print_object): SOME_BUFFER_LOCAL_VALUEP -> local_if_set. * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): Don't set the tag any more. (set_buffer_internal_1): * frame.c (store_frame_param): * eval.c (specbind): * xdisp.c (select_frame_for_redisplay): Drop SOME_BUFFER_LOCAL_VALUEP.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Tue, 16 Oct 2007 15:42:58 +0000
parents 84eaa97c1d65
children ad9922c079e4
files src/ChangeLog src/alloc.c src/buffer.c src/data.c src/eval.c src/frame.c src/lisp.h src/print.c src/xdisp.c
diffstat 9 files changed, 117 insertions(+), 110 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Tue Oct 16 15:18:39 2007 +0000
+++ b/src/ChangeLog	Tue Oct 16 15:42:58 2007 +0000
@@ -1,5 +1,29 @@
 2007-10-16  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+	* lisp.h (enum Lisp_Misc_Type): Del Lisp_Misc_Some_Buffer_Local_Value.
+	(XMISCANY): New macro.
+	(XMISCTYPE): Use it.
+	(struct Lisp_Misc_Any): New type.
+	(union Lisp_Misc): Use it.
+	(struct Lisp_Buffer_Local_Value): Add `local_if_set' bit.
+	* data.c (Fboundp, store_symval_forwarding, swap_in_global_binding)
+	(find_symbol_value, set_internal, default_value, Fset_default)
+	(Fmake_variable_buffer_local, Fmake_local_variable)
+	(Fkill_local_variable, Fmake_variable_frame_local, Flocal_variable_p)
+	(Flocal_variable_if_set_p, Fvariable_binding_locus):
+	The SOME_BUFFER_LOCAL_VALUEP distinction is replaced by local_if_set.
+	* alloc.c (allocate_buffer): Set the size and tag.
+	(allocate_misc, mark_maybe_object, mark_object, survives_gc_p):
+	Use XMISCANY.
+	(die): Follow the GNU convention for error messages.
+	* print.c (print_object): SOME_BUFFER_LOCAL_VALUEP -> local_if_set.
+	* buffer.c (Fget_buffer_create, Fmake_indirect_buffer): Don't set the
+	tag any more.
+	(set_buffer_internal_1):
+	* frame.c (store_frame_param):
+	* eval.c (specbind):
+	* xdisp.c (select_frame_for_redisplay): Drop SOME_BUFFER_LOCAL_VALUEP.
+
 	* doc.c (Fsnarf_documentation): Simplify.
 
 2007-10-14  Juanma Barranquero  <lekktu@gmail.com>
--- a/src/alloc.c	Tue Oct 16 15:18:39 2007 +0000
+++ b/src/alloc.c	Tue Oct 16 15:42:58 2007 +0000
@@ -1153,6 +1153,8 @@
   struct buffer *b
     = (struct buffer *) lisp_malloc (sizeof (struct buffer),
 				     MEM_TYPE_BUFFER);
+  b->size = sizeof (struct buffer) / sizeof (EMACS_INT);
+  XSETPVECTYPE (b, PVEC_BUFFER);
   return b;
 }
 
@@ -3352,7 +3354,7 @@
   --total_free_markers;
   consing_since_gc += sizeof (union Lisp_Misc);
   misc_objects_consed++;
-  XMARKER (val)->gcmarkbit = 0;
+  XMISCANY (val)->gcmarkbit = 0;
   return val;
 }
 
@@ -4209,7 +4211,7 @@
 	  break;
 
 	case Lisp_Misc:
-	  mark_p = (live_misc_p (m, po) && !XMARKER (obj)->gcmarkbit);
+	  mark_p = (live_misc_p (m, po) && !XMISCANY (obj)->gcmarkbit);
 	  break;
 
 	case Lisp_Int:
@@ -5654,14 +5656,13 @@
 
     case Lisp_Misc:
       CHECK_ALLOCATED_AND_LIVE (live_misc_p);
-      if (XMARKER (obj)->gcmarkbit)
+      if (XMISCANY (obj)->gcmarkbit)
 	break;
-      XMARKER (obj)->gcmarkbit = 1;
+      XMISCANY (obj)->gcmarkbit = 1;
 
       switch (XMISCTYPE (obj))
 	{
 	case Lisp_Misc_Buffer_Local_Value:
-	case Lisp_Misc_Some_Buffer_Local_Value:
 	  {
 	    register struct Lisp_Buffer_Local_Value *ptr
 	      = XBUFFER_LOCAL_VALUE (obj);
@@ -5847,7 +5848,7 @@
       break;
 
     case Lisp_Misc:
-      survives_p = XMARKER (obj)->gcmarkbit;
+      survives_p = XMISCANY (obj)->gcmarkbit;
       break;
 
     case Lisp_String:
@@ -6297,7 +6298,7 @@
      const char *file;
      int line;
 {
-  fprintf (stderr, "\r\nEmacs fatal error: %s:%d: %s\r\n",
+  fprintf (stderr, "\r\n%s:%d: Emacs fatal error: %s\r\n",
 	   file, line, msg);
   abort ();
 }
--- a/src/buffer.c	Tue Oct 16 15:18:39 2007 +0000
+++ b/src/buffer.c	Tue Oct 16 15:42:58 2007 +0000
@@ -361,8 +361,6 @@
 
   b = (struct buffer *) allocate_buffer ();
 
-  b->size = sizeof (struct buffer) / sizeof (EMACS_INT);
-
   /* An ordinary buffer uses its own struct buffer_text.  */
   b->text = &b->own_text;
   b->base_buffer = 0;
@@ -416,10 +414,7 @@
   STRING_SET_INTERVALS (name, NULL_INTERVAL);
   b->name = name;
 
-  if (SREF (name, 0) != ' ')
-    b->undo_list = Qnil;
-  else
-    b->undo_list = Qt;
+  b->undo_list = (SREF (name, 0) != ' ') ? Qnil : Qt;
 
   reset_buffer (b);
   reset_buffer_local_variables (b, 1);
@@ -429,7 +424,6 @@
   b->name = name;
 
   /* Put this in the alist of all live buffers.  */
-  XSETPVECTYPE (b, PVEC_BUFFER);
   XSETBUFFER (buf, b);
   Vbuffer_alist = nconc2 (Vbuffer_alist, Fcons (Fcons (name, buf), Qnil));
 
@@ -567,13 +561,10 @@
     error ("Empty string for buffer name is not allowed");
 
   b = (struct buffer *) allocate_buffer ();
-  b->size = sizeof (struct buffer) / sizeof (EMACS_INT);
-  XSETPVECTYPE (b, PVEC_BUFFER);
-
-  if (XBUFFER (base_buffer)->base_buffer)
-    b->base_buffer = XBUFFER (base_buffer)->base_buffer;
-  else
-    b->base_buffer = XBUFFER (base_buffer);
+
+  b->base_buffer = (XBUFFER (base_buffer)->base_buffer
+		    ? XBUFFER (base_buffer)->base_buffer
+		    : XBUFFER (base_buffer));
 
   /* Use the base buffer's text object.  */
   b->text = b->base_buffer->text;
@@ -1918,8 +1909,7 @@
   for (tail = b->local_var_alist; CONSP (tail); tail = XCDR (tail))
     {
       valcontents = SYMBOL_VALUE (XCAR (XCAR (tail)));
-      if ((BUFFER_LOCAL_VALUEP (valcontents)
-	   || SOME_BUFFER_LOCAL_VALUEP (valcontents))
+      if ((BUFFER_LOCAL_VALUEP (valcontents))
 	  && (tem = XBUFFER_LOCAL_VALUE (valcontents)->realvalue,
 	      (BOOLFWDP (tem) || INTFWDP (tem) || OBJFWDP (tem))))
 	/* Just reference the variable
@@ -1933,8 +1923,7 @@
     for (tail = old_buf->local_var_alist; CONSP (tail); tail = XCDR (tail))
       {
 	valcontents = SYMBOL_VALUE (XCAR (XCAR (tail)));
-	if ((BUFFER_LOCAL_VALUEP (valcontents)
-	     || SOME_BUFFER_LOCAL_VALUEP (valcontents))
+	if ((BUFFER_LOCAL_VALUEP (valcontents))
 	    && (tem = XBUFFER_LOCAL_VALUE (valcontents)->realvalue,
 		(BOOLFWDP (tem) || INTFWDP (tem) || OBJFWDP (tem))))
 	  /* Just reference the variable
@@ -2493,7 +2482,7 @@
   /* Any which are supposed to be permanent,
      make local again, with the same values they had.  */
 
-  for (alist = oalist; !NILP (alist); alist = XCDR (alist))
+  for (alist = oalist; CONSP (alist); alist = XCDR (alist))
     {
       sym = XCAR (XCAR (alist));
       tem = Fget (sym, Qpermanent_local);
@@ -2523,7 +2512,7 @@
   XSETBUFFER (buffer, b);
   oalist = b->local_var_alist;
 
-  for (alist = oalist; !NILP (alist); alist = XCDR (alist))
+  for (alist = oalist; CONSP (alist); alist = XCDR (alist))
     {
       sym = XCAR (XCAR (alist));
 
--- a/src/data.c	Tue Oct 16 15:18:39 2007 +0000
+++ b/src/data.c	Tue Oct 16 15:42:58 2007 +0000
@@ -584,8 +584,7 @@
 
   valcontents = SYMBOL_VALUE (symbol);
 
-  if (BUFFER_LOCAL_VALUEP (valcontents)
-      || SOME_BUFFER_LOCAL_VALUEP (valcontents))
+  if (BUFFER_LOCAL_VALUEP (valcontents))
     valcontents = swap_in_symval_forwarding (symbol, valcontents);
 
   return (EQ (valcontents, Qunbound) ? Qnil : Qt);
@@ -998,8 +997,7 @@
     default:
     def:
       valcontents = SYMBOL_VALUE (symbol);
-      if (BUFFER_LOCAL_VALUEP (valcontents)
-	  || SOME_BUFFER_LOCAL_VALUEP (valcontents))
+      if (BUFFER_LOCAL_VALUEP (valcontents))
 	XBUFFER_LOCAL_VALUE (valcontents)->realvalue = newval;
       else
 	SET_SYMBOL_VALUE (symbol, newval);
@@ -1016,8 +1014,7 @@
   Lisp_Object valcontents, cdr;
 
   valcontents = SYMBOL_VALUE (symbol);
-  if (!BUFFER_LOCAL_VALUEP (valcontents)
-      && !SOME_BUFFER_LOCAL_VALUEP (valcontents))
+  if (!BUFFER_LOCAL_VALUEP (valcontents))
     abort ();
   cdr = XBUFFER_LOCAL_VALUE (valcontents)->cdr;
 
@@ -1106,8 +1103,7 @@
   CHECK_SYMBOL (symbol);
   valcontents = SYMBOL_VALUE (symbol);
 
-  if (BUFFER_LOCAL_VALUEP (valcontents)
-      || SOME_BUFFER_LOCAL_VALUEP (valcontents))
+  if (BUFFER_LOCAL_VALUEP (valcontents))
     valcontents = swap_in_symval_forwarding (symbol, valcontents);
 
   if (MISCP (valcontents))
@@ -1225,8 +1221,7 @@
 	  && !let_shadows_buffer_binding_p (symbol))
 	SET_PER_BUFFER_VALUE_P (buf, idx, 1);
     }
-  else if (BUFFER_LOCAL_VALUEP (valcontents)
-	   || SOME_BUFFER_LOCAL_VALUEP (valcontents))
+  else if (BUFFER_LOCAL_VALUEP (valcontents))
     {
       /* valcontents is a struct Lisp_Buffer_Local_Value.   */
       if (XSYMBOL (symbol)->indirect_variable)
@@ -1271,7 +1266,7 @@
 		 indicating that we're seeing the default value.
 		 Likewise if the variable has been let-bound
 		 in the current buffer.  */
-	      if (bindflag || SOME_BUFFER_LOCAL_VALUEP (valcontents)
+	      if (bindflag || !XBUFFER_LOCAL_VALUE (valcontents)->local_if_set
 		  || let_shadows_buffer_binding_p (symbol))
 		{
 		  XBUFFER_LOCAL_VALUE (valcontents)->found_for_buffer = 0;
@@ -1299,8 +1294,7 @@
 	    }
 
 	  /* Record which binding is now loaded.  */
-	  XSETCAR (XBUFFER_LOCAL_VALUE (valcontents)->cdr,
-		   tem1);
+	  XSETCAR (XBUFFER_LOCAL_VALUE (valcontents)->cdr, tem1);
 
 	  /* Set `buffer' and `frame' slots for the binding now loaded.  */
 	  XSETBUFFER (XBUFFER_LOCAL_VALUE (valcontents)->buffer, buf);
@@ -1319,8 +1313,7 @@
   /* If we just set a variable whose current binding is frame-local,
      store the new value in the frame parameter too.  */
 
-  if (BUFFER_LOCAL_VALUEP (valcontents)
-      || SOME_BUFFER_LOCAL_VALUEP (valcontents))
+  if (BUFFER_LOCAL_VALUEP (valcontents))
     {
       /* What binding is loaded right now?  */
       current_alist_element
@@ -1362,8 +1355,7 @@
     }
 
   /* Handle user-created local variables.  */
-  if (BUFFER_LOCAL_VALUEP (valcontents)
-      || SOME_BUFFER_LOCAL_VALUEP (valcontents))
+  if (BUFFER_LOCAL_VALUEP (valcontents))
     {
       /* If var is set up for a buffer that lacks a local value for it,
 	 the current value is nominally the default value.
@@ -1447,8 +1439,7 @@
       return value;
     }
 
-  if (!BUFFER_LOCAL_VALUEP (valcontents)
-      && !SOME_BUFFER_LOCAL_VALUEP (valcontents))
+  if (!BUFFER_LOCAL_VALUEP (valcontents))
     return Fset (symbol, value);
 
   /* Store new value into the DEFAULT-VALUE slot.  */
@@ -1533,27 +1524,28 @@
   if (EQ (variable, Qnil) || EQ (variable, Qt) || KBOARD_OBJFWDP (valcontents))
     error ("Symbol %s may not be buffer-local", SDATA (SYMBOL_NAME (variable)));
 
-  if (BUFFER_LOCAL_VALUEP (valcontents) || BUFFER_OBJFWDP (valcontents))
+  if (BUFFER_OBJFWDP (valcontents))
     return variable;
-  if (SOME_BUFFER_LOCAL_VALUEP (valcontents))
+  else if (BUFFER_LOCAL_VALUEP (valcontents))
+    newval = valcontents;
+  else
     {
-      XMISCTYPE (SYMBOL_VALUE (variable)) = Lisp_Misc_Buffer_Local_Value;
-      return variable;
+      if (EQ (valcontents, Qunbound))
+	SET_SYMBOL_VALUE (variable, Qnil);
+      tem = Fcons (Qnil, Fsymbol_value (variable));
+      XSETCAR (tem, tem);
+      newval = allocate_misc ();
+      XMISCTYPE (newval) = Lisp_Misc_Buffer_Local_Value;
+      XBUFFER_LOCAL_VALUE (newval)->realvalue = SYMBOL_VALUE (variable);
+      XBUFFER_LOCAL_VALUE (newval)->buffer = Fcurrent_buffer ();
+      XBUFFER_LOCAL_VALUE (newval)->frame = Qnil;
+      XBUFFER_LOCAL_VALUE (newval)->found_for_buffer = 0;
+      XBUFFER_LOCAL_VALUE (newval)->found_for_frame = 0;
+      XBUFFER_LOCAL_VALUE (newval)->check_frame = 0;
+      XBUFFER_LOCAL_VALUE (newval)->cdr = tem;
+      SET_SYMBOL_VALUE (variable, newval);
     }
-  if (EQ (valcontents, Qunbound))
-    SET_SYMBOL_VALUE (variable, Qnil);
-  tem = Fcons (Qnil, Fsymbol_value (variable));
-  XSETCAR (tem, tem);
-  newval = allocate_misc ();
-  XMISCTYPE (newval) = Lisp_Misc_Buffer_Local_Value;
-  XBUFFER_LOCAL_VALUE (newval)->realvalue = SYMBOL_VALUE (variable);
-  XBUFFER_LOCAL_VALUE (newval)->buffer = Fcurrent_buffer ();
-  XBUFFER_LOCAL_VALUE (newval)->frame = Qnil;
-  XBUFFER_LOCAL_VALUE (newval)->found_for_buffer = 0;
-  XBUFFER_LOCAL_VALUE (newval)->found_for_frame = 0;
-  XBUFFER_LOCAL_VALUE (newval)->check_frame = 0;
-  XBUFFER_LOCAL_VALUE (newval)->cdr = tem;
-  SET_SYMBOL_VALUE (variable, newval);
+  XBUFFER_LOCAL_VALUE (newval)->local_if_set = 1;
   return variable;
 }
 
@@ -1589,7 +1581,9 @@
   if (EQ (variable, Qnil) || EQ (variable, Qt) || KBOARD_OBJFWDP (valcontents))
     error ("Symbol %s may not be buffer-local", SDATA (SYMBOL_NAME (variable)));
 
-  if (BUFFER_LOCAL_VALUEP (valcontents) || BUFFER_OBJFWDP (valcontents))
+  if ((BUFFER_LOCAL_VALUEP (valcontents)
+       && XBUFFER_LOCAL_VALUE (valcontents)->local_if_set)
+      || BUFFER_OBJFWDP (valcontents))
     {
       tem = Fboundp (variable);
 
@@ -1599,16 +1593,17 @@
       return variable;
     }
   /* Make sure symbol is set up to hold per-buffer values.  */
-  if (!SOME_BUFFER_LOCAL_VALUEP (valcontents))
+  if (!BUFFER_LOCAL_VALUEP (valcontents))
     {
       Lisp_Object newval;
       tem = Fcons (Qnil, do_symval_forwarding (valcontents));
       XSETCAR (tem, tem);
       newval = allocate_misc ();
-      XMISCTYPE (newval) = Lisp_Misc_Some_Buffer_Local_Value;
+      XMISCTYPE (newval) = Lisp_Misc_Buffer_Local_Value;
       XBUFFER_LOCAL_VALUE (newval)->realvalue = SYMBOL_VALUE (variable);
       XBUFFER_LOCAL_VALUE (newval)->buffer = Qnil;
       XBUFFER_LOCAL_VALUE (newval)->frame = Qnil;
+      XBUFFER_LOCAL_VALUE (newval)->local_if_set = 0;
       XBUFFER_LOCAL_VALUE (newval)->found_for_buffer = 0;
       XBUFFER_LOCAL_VALUE (newval)->found_for_frame = 0;
       XBUFFER_LOCAL_VALUE (newval)->check_frame = 0;
@@ -1681,8 +1676,7 @@
       return variable;
     }
 
-  if (!BUFFER_LOCAL_VALUEP (valcontents)
-      && !SOME_BUFFER_LOCAL_VALUEP (valcontents))
+  if (!BUFFER_LOCAL_VALUEP (valcontents))
     return variable;
 
   /* Get rid of this buffer's alist element, if any.  */
@@ -1743,8 +1737,7 @@
       || BUFFER_OBJFWDP (valcontents))
     error ("Symbol %s may not be frame-local", SDATA (SYMBOL_NAME (variable)));
 
-  if (BUFFER_LOCAL_VALUEP (valcontents)
-      || SOME_BUFFER_LOCAL_VALUEP (valcontents))
+  if (BUFFER_LOCAL_VALUEP (valcontents))
     {
       XBUFFER_LOCAL_VALUE (valcontents)->check_frame = 1;
       return variable;
@@ -1755,10 +1748,11 @@
   tem = Fcons (Qnil, Fsymbol_value (variable));
   XSETCAR (tem, tem);
   newval = allocate_misc ();
-  XMISCTYPE (newval) = Lisp_Misc_Some_Buffer_Local_Value;
+  XMISCTYPE (newval) = Lisp_Misc_Buffer_Local_Value;
   XBUFFER_LOCAL_VALUE (newval)->realvalue = SYMBOL_VALUE (variable);
   XBUFFER_LOCAL_VALUE (newval)->buffer = Qnil;
   XBUFFER_LOCAL_VALUE (newval)->frame = Qnil;
+  XBUFFER_LOCAL_VALUE (newval)->local_if_set = 0;
   XBUFFER_LOCAL_VALUE (newval)->found_for_buffer = 0;
   XBUFFER_LOCAL_VALUE (newval)->found_for_frame = 0;
   XBUFFER_LOCAL_VALUE (newval)->check_frame = 1;
@@ -1789,8 +1783,7 @@
   variable = indirect_variable (variable);
 
   valcontents = SYMBOL_VALUE (variable);
-  if (BUFFER_LOCAL_VALUEP (valcontents)
-      || SOME_BUFFER_LOCAL_VALUEP (valcontents))
+  if (BUFFER_LOCAL_VALUEP (valcontents))
     {
       Lisp_Object tail, elt;
 
@@ -1838,15 +1831,14 @@
 
   valcontents = SYMBOL_VALUE (variable);
 
-  /* This means that make-variable-buffer-local was done.  */
-  if (BUFFER_LOCAL_VALUEP (valcontents))
+  if (BUFFER_OBJFWDP (valcontents))
+    /* All these slots become local if they are set.  */
     return Qt;
-  /* All these slots become local if they are set.  */
-  if (BUFFER_OBJFWDP (valcontents))
-    return Qt;
-  if (SOME_BUFFER_LOCAL_VALUEP (valcontents))
+  else if (BUFFER_LOCAL_VALUEP (valcontents))
     {
       Lisp_Object tail, elt;
+      if (XBUFFER_LOCAL_VALUE (valcontents)->local_if_set)
+	return Qt;
       for (tail = buf->local_var_alist; CONSP (tail); tail = XCDR (tail))
 	{
 	  elt = XCAR (tail);
@@ -1877,14 +1869,13 @@
   valcontents = XSYMBOL (variable)->value;
 
   if (BUFFER_LOCAL_VALUEP (valcontents)
-      || SOME_BUFFER_LOCAL_VALUEP (valcontents)
       || BUFFER_OBJFWDP (valcontents))
     {
       /* For a local variable, record both the symbol and which
 	 buffer's or frame's value we are saving.  */
       if (!NILP (Flocal_variable_p (variable, Qnil)))
 	return Fcurrent_buffer ();
-      else if (!BUFFER_OBJFWDP (valcontents)
+      else if (BUFFER_LOCAL_VALUEP (valcontents)
 	       && XBUFFER_LOCAL_VALUE (valcontents)->found_for_frame)
 	return XBUFFER_LOCAL_VALUE (valcontents)->frame;
     }
--- a/src/eval.c	Tue Oct 16 15:18:39 2007 +0000
+++ b/src/eval.c	Tue Oct 16 15:42:58 2007 +0000
@@ -1043,10 +1043,10 @@
   GCPRO2 (args, *temps);
   gcpro2.nvars = 0;
 
-  for (argnum = 0; !NILP (varlist); varlist = Fcdr (varlist))
+  for (argnum = 0; CONSP (varlist); varlist = XCDR (varlist))
     {
       QUIT;
-      elt = Fcar (varlist);
+      elt = XCAR (varlist);
       if (SYMBOLP (elt))
 	temps [argnum++] = Qnil;
       else if (! NILP (Fcdr (Fcdr (elt))))
@@ -1058,9 +1058,9 @@
   UNGCPRO;
 
   varlist = Fcar (args);
-  for (argnum = 0; !NILP (varlist); varlist = Fcdr (varlist))
+  for (argnum = 0; CONSP (varlist); varlist = XCDR (varlist))
     {
-      elt = Fcar (varlist);
+      elt = XCAR (varlist);
       tem = temps[argnum++];
       if (SYMBOLP (elt))
 	specbind (elt, tem);
@@ -3285,7 +3285,6 @@
       valcontents = XSYMBOL (symbol)->value;
 
       if (BUFFER_LOCAL_VALUEP (valcontents)
-	  || SOME_BUFFER_LOCAL_VALUEP (valcontents)
 	  || BUFFER_OBJFWDP (valcontents))
 	{
 	  Lisp_Object where, current_buffer;
@@ -3296,7 +3295,7 @@
 	     buffer's or frame's value we are saving.  */
 	  if (!NILP (Flocal_variable_p (symbol, Qnil)))
 	    where = current_buffer;
-	  else if (!BUFFER_OBJFWDP (valcontents)
+	  else if (BUFFER_LOCAL_VALUEP (valcontents)
 		   && XBUFFER_LOCAL_VALUE (valcontents)->found_for_frame)
 	    where = XBUFFER_LOCAL_VALUE (valcontents)->frame;
 	  else
--- a/src/frame.c	Tue Oct 16 15:18:39 2007 +0000
+++ b/src/frame.c	Tue Oct 16 15:42:58 2007 +0000
@@ -2289,8 +2289,7 @@
     {
       Lisp_Object valcontents;
       valcontents = SYMBOL_VALUE (prop);
-      if ((BUFFER_LOCAL_VALUEP (valcontents)
-  	   || SOME_BUFFER_LOCAL_VALUEP (valcontents))
+      if ((BUFFER_LOCAL_VALUEP (valcontents))
 	  && XBUFFER_LOCAL_VALUE (valcontents)->check_frame
 	  && XBUFFER_LOCAL_VALUE (valcontents)->found_for_frame
  	  && XFRAME (XBUFFER_LOCAL_VALUE (valcontents)->frame) == f)
--- a/src/lisp.h	Tue Oct 16 15:18:39 2007 +0000
+++ b/src/lisp.h	Tue Oct 16 15:42:58 2007 +0000
@@ -214,7 +214,6 @@
     Lisp_Misc_Objfwd,
     Lisp_Misc_Buffer_Objfwd,
     Lisp_Misc_Buffer_Local_Value,
-    Lisp_Misc_Some_Buffer_Local_Value,
     Lisp_Misc_Overlay,
     Lisp_Misc_Kboard_Objfwd,
     Lisp_Misc_Save_Value,
@@ -522,7 +521,8 @@
 /* Misc types.  */
 
 #define XMISC(a)   ((union Lisp_Misc *) XPNTR(a))
-#define XMISCTYPE(a)   (XMARKER (a)->type)
+#define XMISCANY(a) (&(XMISC(a)->u_any))
+#define XMISCTYPE(a)   (XMISCANY (a)->type)
 #define XMARKER(a) (&(XMISC(a)->u_marker))
 #define XINTFWD(a) (&(XMISC(a)->u_intfwd))
 #define XBOOLFWD(a) (&(XMISC(a)->u_boolfwd))
@@ -1124,6 +1124,13 @@
 
 /* These structures are used for various misc types.  */
 
+struct Lisp_Misc_Any		/* Supertype of all Misc types.  */
+{
+  int type : 16;		/* = Lisp_Misc_Marker */
+  unsigned gcmarkbit : 1;
+  int spacer : 15;
+};
+
 struct Lisp_Marker
 {
   int type : 16;		/* = Lisp_Misc_Marker */
@@ -1224,19 +1231,19 @@
    binding into `realvalue' (or through it).  Also update
    LOADED-BINDING to point to the newly loaded binding.
 
-   Lisp_Misc_Buffer_Local_Value and Lisp_Misc_Some_Buffer_Local_Value
-   both use this kind of structure.  With the former, merely setting
-   the variable creates a local binding for the current buffer.  With
-   the latter, setting the variable does not do that; only
-   make-local-variable does that.  */
+   `local_if_set' indicates that merely setting the variable creates a local
+   binding for the current buffer.  Otherwise the latter, setting the
+   variable does not do that; only make-local-variable does that.  */
 
 struct Lisp_Buffer_Local_Value
   {
-    int type : 16;      /* = Lisp_Misc_Buffer_Local_Value
-			   or Lisp_Misc_Some_Buffer_Local_Value */
+    int type : 16;      /* = Lisp_Misc_Buffer_Local_Value  */
     unsigned gcmarkbit : 1;
-    int spacer : 12;
-
+    int spacer : 11;
+
+    /* 1 means that merely setting the variable creates a local
+       binding for the current buffer */
+    unsigned int local_if_set : 1;
     /* 1 means this variable is allowed to have frame-local bindings,
        so check for them when looking for the proper binding.  */
     unsigned int check_frame : 1;
@@ -1326,7 +1333,8 @@
 
 union Lisp_Misc
   {
-    struct Lisp_Free u_free;
+    struct Lisp_Misc_Any u_any;	   /* Supertype of all Misc types.  */
+    struct Lisp_Free u_free;	   /* Includes padding to force alignment.  */
     struct Lisp_Marker u_marker;
     struct Lisp_Intfwd u_intfwd;
     struct Lisp_Boolfwd u_boolfwd;
--- a/src/print.c	Tue Oct 16 15:18:39 2007 +0000
+++ b/src/print.c	Tue Oct 16 15:42:58 2007 +0000
@@ -2145,10 +2145,8 @@
 
 	case Lisp_Misc_Buffer_Local_Value:
 	  strout ("#<buffer_local_value ", -1, -1, printcharfun, 0);
-	  goto do_buffer_local;
-	case Lisp_Misc_Some_Buffer_Local_Value:
-	  strout ("#<some_buffer_local_value ", -1, -1, printcharfun, 0);
-	do_buffer_local:
+	  if (XBUFFER_LOCAL_VALUE (obj)->local_if_set)
+	    strout ("[local-if-set] ", -1, -1, printcharfun, 0);
 	  strout ("[realvalue] ", -1, -1, printcharfun, 0);
 	  print_object (XBUFFER_LOCAL_VALUE (obj)->realvalue,
 			printcharfun, escapeflag);
--- a/src/xdisp.c	Tue Oct 16 15:18:39 2007 +0000
+++ b/src/xdisp.c	Tue Oct 16 15:42:58 2007 +0000
@@ -10804,8 +10804,7 @@
 	    SYMBOLP (sym))
 	&& (sym = indirect_variable (sym),
 	    val = SYMBOL_VALUE (sym),
-	    (BUFFER_LOCAL_VALUEP (val)
-	     || SOME_BUFFER_LOCAL_VALUEP (val)))
+	    (BUFFER_LOCAL_VALUEP (val)))
 	&& XBUFFER_LOCAL_VALUE (val)->check_frame)
       /* Use find_symbol_value rather than Fsymbol_value
 	 to avoid an error if it is void.  */
@@ -10817,8 +10816,7 @@
 	    SYMBOLP (sym))
 	&& (sym = indirect_variable (sym),
 	    val = SYMBOL_VALUE (sym),
-	    (BUFFER_LOCAL_VALUEP (val)
-	     || SOME_BUFFER_LOCAL_VALUEP (val)))
+	    (BUFFER_LOCAL_VALUEP (val)))
 	&& XBUFFER_LOCAL_VALUE (val)->check_frame)
       find_symbol_value (sym);
 }