(Fmake_variable_buffer_local, Fmake_local_variable)
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 30 May 2008 02:37:40 +0000 (02:37 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Fri, 30 May 2008 02:37:40 +0000 (02:37 +0000)
(Fmake_variable_frame_local): Disallow mixing buffer-local and
frame-local settings for the same variable.

etc/NEWS
src/ChangeLog
src/data.c

index 3d590ad..a2bcb97 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -732,6 +732,7 @@ for the list of extra keys that are available.
 \f
 * Incompatible Lisp Changes in Emacs 23.1
 
+** Variables cannot be both buffer-local and frame-local any more.
 ** The argument DEFAULT of minibuffer input functions `read-from-minibuffer',
 `read-string', `completing-read', `read-buffer', `read-command',
 `read-variable' now can be a list of default values.  The elements of
index d79125c..c10153c 100644 (file)
@@ -1,10 +1,16 @@
+2008-05-30  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * data.c (Fmake_variable_buffer_local, Fmake_local_variable)
+       (Fmake_variable_frame_local): Disallow mixing buffer-local and
+       frame-local settings for the same variable.
+
 2008-05-29  Kenichi Handa  <handa@m17n.org>
 
        * coding.h (enum define_coding_utf8_arg_index): New enum.
        (enum coding_attr_index): Change coding_attr_utf_16_bom to
        coding_attr_utf_bom.
-       (enum utf_bom_type): Renamed from utf_16_bom_type.
-       (struct utf_16_spec): Adjusted for the above change.
+       (enum utf_bom_type): Rename from utf_16_bom_type.
+       (struct utf_16_spec): Adjust for the above change.
        (struct coding_system): Add utf_8_bom in `spec' union.
 
        * coding.c (CODING_UTF_8_BOM): New macro.
@@ -21,8 +27,7 @@
        (UTF_BOM, UTF_8_BOM_1, UTF_8_BOM_2, UTF_8_BOM_3): New macros.
        (detect_coding_utf_8): Check BOM.
        (decode_coding_utf_8, encode_coding_utf_8): Handle BOM.
-       (decode_coding_utf_16): Adjusted for the change of enum
-       utf_bom_type.
+       (decode_coding_utf_16): Adjust for the change of enum utf_bom_type.
        (encode_coding_utf_16): Likewise.
        (setup_coding_system): Likewise.  Set CODING_UTF_8_BOM (coding).
        (detect_coding, detect_coding_system): Handle utf-8-auto.
 
 2008-05-29  Jason Rumney  <jasonr@gnu.org>
 
-        * w32font.c (w32font_open_internal): Prefer truetype fonts unless
-        `raster' specified.
-        (add_font_entity_to_list): Allow non-opentype truetype fonts back
-        in the uniscribe backend, but disallow any font that has no
-        unicode subrange support.
+       * w32font.c (w32font_open_internal): Prefer truetype fonts unless
+       `raster' specified.
+       (add_font_entity_to_list): Allow non-opentype truetype fonts back
+       in the uniscribe backend, but disallow any font that has no
+       unicode subrange support.
 
 2008-05-29  Juanma Barranquero  <lekktu@gmail.com>
 
index f86d5c7..8ee41ba 100644 (file)
@@ -1493,7 +1493,11 @@ The function `default-value' gets the default value and `set-default' sets it.
   if (BUFFER_OBJFWDP (valcontents))
     return variable;
   else if (BUFFER_LOCAL_VALUEP (valcontents))
-    newval = valcontents;
+    {
+      if (XBUFFER_LOCAL_VALUE (valcontents)->check_frame)
+       error ("Symbol %s may not be buffer-local", SDATA (sym->xname));
+      newval = valcontents;
+    }
   else
     {
       if (EQ (valcontents, Qunbound))
@@ -1545,7 +1549,9 @@ Instead, use `add-hook' and specify t for the LOCAL argument.  */)
   sym = indirect_variable (XSYMBOL (variable));
 
   valcontents = sym->value;
-  if (sym->constant || KBOARD_OBJFWDP (valcontents))
+  if (sym->constant || KBOARD_OBJFWDP (valcontents)
+      || (BUFFER_LOCAL_VALUEP (valcontents)
+         && (XBUFFER_LOCAL_VALUE (valcontents)->check_frame)))
     error ("Symbol %s may not be buffer-local", SDATA (sym->xname));
 
   if ((BUFFER_LOCAL_VALUEP (valcontents)
@@ -1709,7 +1715,8 @@ Buffer-local bindings take precedence over frame-local bindings.  */)
 
   if (BUFFER_LOCAL_VALUEP (valcontents))
     {
-      XBUFFER_LOCAL_VALUE (valcontents)->check_frame = 1;
+      if (!XBUFFER_LOCAL_VALUE (valcontents)->check_frame)
+       error ("Symbol %s may not be frame-local", SDATA (sym->xname));
       return variable;
     }