From fd9440c58241b6a9f6da824522d2f666d54412aa Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 30 May 2008 02:37:40 +0000 Subject: [PATCH] (Fmake_variable_buffer_local, Fmake_local_variable) (Fmake_variable_frame_local): Disallow mixing buffer-local and frame-local settings for the same variable. --- etc/NEWS | 1 + src/ChangeLog | 23 ++++++++++++++--------- src/data.c | 13 ++++++++++--- 3 files changed, 25 insertions(+), 12 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 3d590ad94b7..a2bcb9718da 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -732,6 +732,7 @@ for the list of extra keys that are available. * 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 diff --git a/src/ChangeLog b/src/ChangeLog index d79125ca7ee..c10153c047d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,10 +1,16 @@ +2008-05-30 Stefan Monnier + + * 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 * 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. @@ -38,11 +43,11 @@ 2008-05-29 Jason Rumney - * 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 diff --git a/src/data.c b/src/data.c index f86d5c7c61b..8ee41ba8524 100644 --- a/src/data.c +++ b/src/data.c @@ -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; } -- 2.39.2