From 7357cb0467cb329a422c857c9fd07c574968788f Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 23 Oct 2007 20:56:27 +0000 Subject: [PATCH] (Fmake_variable_buffer_local, Fmake_local_variable) (Fmake_variable_frame_local): Just check the variable's const-ness rather than checking nil or t. --- src/ChangeLog | 6 ++++++ src/data.c | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 15916fae821..3da07722a7a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2007-10-23 Stefan Monnier + + * data.c (Fmake_variable_buffer_local, Fmake_local_variable) + (Fmake_variable_frame_local): Just check the variable's const-ness + rather than checking nil or t. + 2007-10-22 Jason Rumney * w32fns.c: Include math.h. diff --git a/src/data.c b/src/data.c index 2a99a728a76..9796b649f72 100644 --- a/src/data.c +++ b/src/data.c @@ -1521,7 +1521,7 @@ The function `default-value' gets the default value and `set-default' sets it. variable = indirect_variable (variable); valcontents = SYMBOL_VALUE (variable); - if (EQ (variable, Qnil) || EQ (variable, Qt) || KBOARD_OBJFWDP (valcontents)) + if (XSYMBOL (variable)->constant || KBOARD_OBJFWDP (valcontents)) error ("Symbol %s may not be buffer-local", SDATA (SYMBOL_NAME (variable))); if (BUFFER_OBJFWDP (valcontents)) @@ -1578,7 +1578,7 @@ Instead, use `add-hook' and specify t for the LOCAL argument. */) variable = indirect_variable (variable); valcontents = SYMBOL_VALUE (variable); - if (EQ (variable, Qnil) || EQ (variable, Qt) || KBOARD_OBJFWDP (valcontents)) + if (XSYMBOL (variable)->constant || KBOARD_OBJFWDP (valcontents)) error ("Symbol %s may not be buffer-local", SDATA (SYMBOL_NAME (variable))); if ((BUFFER_LOCAL_VALUEP (valcontents) @@ -1733,7 +1733,7 @@ Buffer-local bindings take precedence over frame-local bindings. */) variable = indirect_variable (variable); valcontents = SYMBOL_VALUE (variable); - if (EQ (variable, Qnil) || EQ (variable, Qt) || KBOARD_OBJFWDP (valcontents) + if (XSYMBOL (variable)->constant || KBOARD_OBJFWDP (valcontents) || BUFFER_OBJFWDP (valcontents)) error ("Symbol %s may not be frame-local", SDATA (SYMBOL_NAME (variable))); -- 2.39.2