comparison src/data.c @ 85594:237166b2d28f

(Fmake_variable_buffer_local, Fmake_local_variable) (Fmake_variable_frame_local): Just check the variable's const-ness rather than checking nil or t.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Tue, 23 Oct 2007 20:56:27 +0000
parents d0d527210b0c
children 8743273c407c 4bc33ffdda1a
comparison
equal deleted inserted replaced
85593:f51a2276e8b3 85594:237166b2d28f
1519 1519
1520 CHECK_SYMBOL (variable); 1520 CHECK_SYMBOL (variable);
1521 variable = indirect_variable (variable); 1521 variable = indirect_variable (variable);
1522 1522
1523 valcontents = SYMBOL_VALUE (variable); 1523 valcontents = SYMBOL_VALUE (variable);
1524 if (EQ (variable, Qnil) || EQ (variable, Qt) || KBOARD_OBJFWDP (valcontents)) 1524 if (XSYMBOL (variable)->constant || KBOARD_OBJFWDP (valcontents))
1525 error ("Symbol %s may not be buffer-local", SDATA (SYMBOL_NAME (variable))); 1525 error ("Symbol %s may not be buffer-local", SDATA (SYMBOL_NAME (variable)));
1526 1526
1527 if (BUFFER_OBJFWDP (valcontents)) 1527 if (BUFFER_OBJFWDP (valcontents))
1528 return variable; 1528 return variable;
1529 else if (BUFFER_LOCAL_VALUEP (valcontents)) 1529 else if (BUFFER_LOCAL_VALUEP (valcontents))
1576 1576
1577 CHECK_SYMBOL (variable); 1577 CHECK_SYMBOL (variable);
1578 variable = indirect_variable (variable); 1578 variable = indirect_variable (variable);
1579 1579
1580 valcontents = SYMBOL_VALUE (variable); 1580 valcontents = SYMBOL_VALUE (variable);
1581 if (EQ (variable, Qnil) || EQ (variable, Qt) || KBOARD_OBJFWDP (valcontents)) 1581 if (XSYMBOL (variable)->constant || KBOARD_OBJFWDP (valcontents))
1582 error ("Symbol %s may not be buffer-local", SDATA (SYMBOL_NAME (variable))); 1582 error ("Symbol %s may not be buffer-local", SDATA (SYMBOL_NAME (variable)));
1583 1583
1584 if ((BUFFER_LOCAL_VALUEP (valcontents) 1584 if ((BUFFER_LOCAL_VALUEP (valcontents)
1585 && XBUFFER_LOCAL_VALUE (valcontents)->local_if_set) 1585 && XBUFFER_LOCAL_VALUE (valcontents)->local_if_set)
1586 || BUFFER_OBJFWDP (valcontents)) 1586 || BUFFER_OBJFWDP (valcontents))
1731 1731
1732 CHECK_SYMBOL (variable); 1732 CHECK_SYMBOL (variable);
1733 variable = indirect_variable (variable); 1733 variable = indirect_variable (variable);
1734 1734
1735 valcontents = SYMBOL_VALUE (variable); 1735 valcontents = SYMBOL_VALUE (variable);
1736 if (EQ (variable, Qnil) || EQ (variable, Qt) || KBOARD_OBJFWDP (valcontents) 1736 if (XSYMBOL (variable)->constant || KBOARD_OBJFWDP (valcontents)
1737 || BUFFER_OBJFWDP (valcontents)) 1737 || BUFFER_OBJFWDP (valcontents))
1738 error ("Symbol %s may not be frame-local", SDATA (SYMBOL_NAME (variable))); 1738 error ("Symbol %s may not be frame-local", SDATA (SYMBOL_NAME (variable)));
1739 1739
1740 if (BUFFER_LOCAL_VALUEP (valcontents)) 1740 if (BUFFER_LOCAL_VALUEP (valcontents))
1741 { 1741 {