diff options
Diffstat (limited to 'src/data.c')
| -rw-r--r-- | src/data.c | 130 |
1 files changed, 74 insertions, 56 deletions
diff --git a/src/data.c b/src/data.c index 0bca9da07d9..f86d5c7c61b 100644 --- a/src/data.c +++ b/src/data.c | |||
| @@ -813,25 +813,29 @@ Value, if non-nil, is a list \(interactive SPEC). */) | |||
| 813 | `cyclic-variable-indirection' if SYMBOL's chain of variable | 813 | `cyclic-variable-indirection' if SYMBOL's chain of variable |
| 814 | indirections contains a loop. */ | 814 | indirections contains a loop. */ |
| 815 | 815 | ||
| 816 | Lisp_Object | 816 | struct Lisp_Symbol * |
| 817 | indirect_variable (symbol) | 817 | indirect_variable (symbol) |
| 818 | Lisp_Object symbol; | 818 | struct Lisp_Symbol *symbol; |
| 819 | { | 819 | { |
| 820 | Lisp_Object tortoise, hare; | 820 | struct Lisp_Symbol *tortoise, *hare; |
| 821 | 821 | ||
| 822 | hare = tortoise = symbol; | 822 | hare = tortoise = symbol; |
| 823 | 823 | ||
| 824 | while (XSYMBOL (hare)->indirect_variable) | 824 | while (hare->indirect_variable) |
| 825 | { | 825 | { |
| 826 | hare = XSYMBOL (hare)->value; | 826 | hare = XSYMBOL (hare->value); |
| 827 | if (!XSYMBOL (hare)->indirect_variable) | 827 | if (!hare->indirect_variable) |
| 828 | break; | 828 | break; |
| 829 | 829 | ||
| 830 | hare = XSYMBOL (hare)->value; | 830 | hare = XSYMBOL (hare->value); |
| 831 | tortoise = XSYMBOL (tortoise)->value; | 831 | tortoise = XSYMBOL (tortoise->value); |
| 832 | 832 | ||
| 833 | if (EQ (hare, tortoise)) | 833 | if (hare == tortoise) |
| 834 | xsignal1 (Qcyclic_variable_indirection, symbol); | 834 | { |
| 835 | Lisp_Object tem; | ||
| 836 | XSETSYMBOL (tem, symbol); | ||
| 837 | xsignal1 (Qcyclic_variable_indirection, tem); | ||
| 838 | } | ||
| 835 | } | 839 | } |
| 836 | 840 | ||
| 837 | return hare; | 841 | return hare; |
| @@ -848,7 +852,7 @@ variable chain of symbols. */) | |||
| 848 | Lisp_Object object; | 852 | Lisp_Object object; |
| 849 | { | 853 | { |
| 850 | if (SYMBOLP (object)) | 854 | if (SYMBOLP (object)) |
| 851 | object = indirect_variable (object); | 855 | XSETSYMBOL (object, indirect_variable (XSYMBOL (object))); |
| 852 | return object; | 856 | return object; |
| 853 | } | 857 | } |
| 854 | 858 | ||
| @@ -972,7 +976,7 @@ store_symval_forwarding (symbol, valcontents, newval, buf) | |||
| 972 | 976 | ||
| 973 | if (! NILP (type) && ! NILP (newval) | 977 | if (! NILP (type) && ! NILP (newval) |
| 974 | && XTYPE (newval) != XINT (type)) | 978 | && XTYPE (newval) != XINT (type)) |
| 975 | buffer_slot_type_mismatch (symbol, XINT (type)); | 979 | buffer_slot_type_mismatch (newval, XINT (type)); |
| 976 | 980 | ||
| 977 | if (buf == NULL) | 981 | if (buf == NULL) |
| 978 | buf = current_buffer; | 982 | buf = current_buffer; |
| @@ -1049,8 +1053,12 @@ swap_in_symval_forwarding (symbol, valcontents) | |||
| 1049 | || (XBUFFER_LOCAL_VALUE (valcontents)->check_frame | 1053 | || (XBUFFER_LOCAL_VALUE (valcontents)->check_frame |
| 1050 | && ! EQ (selected_frame, XBUFFER_LOCAL_VALUE (valcontents)->frame))) | 1054 | && ! EQ (selected_frame, XBUFFER_LOCAL_VALUE (valcontents)->frame))) |
| 1051 | { | 1055 | { |
| 1052 | if (XSYMBOL (symbol)->indirect_variable) | 1056 | struct Lisp_Symbol *sym = XSYMBOL (symbol); |
| 1053 | symbol = indirect_variable (symbol); | 1057 | if (sym->indirect_variable) |
| 1058 | { | ||
| 1059 | sym = indirect_variable (sym); | ||
| 1060 | XSETSYMBOL (symbol, sym); | ||
| 1061 | } | ||
| 1054 | 1062 | ||
| 1055 | /* Unload the previously loaded binding. */ | 1063 | /* Unload the previously loaded binding. */ |
| 1056 | tem1 = XCAR (XBUFFER_LOCAL_VALUE (valcontents)->cdr); | 1064 | tem1 = XCAR (XBUFFER_LOCAL_VALUE (valcontents)->cdr); |
| @@ -1132,7 +1140,7 @@ DEFUN ("set", Fset, Sset, 2, 2, 0, | |||
| 1132 | 1140 | ||
| 1133 | static int | 1141 | static int |
| 1134 | let_shadows_buffer_binding_p (symbol) | 1142 | let_shadows_buffer_binding_p (symbol) |
| 1135 | Lisp_Object symbol; | 1143 | struct Lisp_Symbol *symbol; |
| 1136 | { | 1144 | { |
| 1137 | volatile struct specbinding *p; | 1145 | volatile struct specbinding *p; |
| 1138 | 1146 | ||
| @@ -1140,10 +1148,10 @@ let_shadows_buffer_binding_p (symbol) | |||
| 1140 | if (p->func == NULL | 1148 | if (p->func == NULL |
| 1141 | && CONSP (p->symbol)) | 1149 | && CONSP (p->symbol)) |
| 1142 | { | 1150 | { |
| 1143 | Lisp_Object let_bound_symbol = XCAR (p->symbol); | 1151 | struct Lisp_Symbol *let_bound_symbol = XSYMBOL (XCAR (p->symbol)); |
| 1144 | if ((EQ (symbol, let_bound_symbol) | 1152 | if ((symbol == let_bound_symbol |
| 1145 | || (XSYMBOL (let_bound_symbol)->indirect_variable | 1153 | || (let_bound_symbol->indirect_variable |
| 1146 | && EQ (symbol, indirect_variable (let_bound_symbol)))) | 1154 | && symbol == indirect_variable (let_bound_symbol))) |
| 1147 | && XBUFFER (XCDR (XCDR (p->symbol))) == current_buffer) | 1155 | && XBUFFER (XCDR (XCDR (p->symbol))) == current_buffer) |
| 1148 | break; | 1156 | break; |
| 1149 | } | 1157 | } |
| @@ -1197,7 +1205,7 @@ set_internal (symbol, newval, buf, bindflag) | |||
| 1197 | { | 1205 | { |
| 1198 | /* valcontents is a struct Lisp_Buffer_Local_Value. */ | 1206 | /* valcontents is a struct Lisp_Buffer_Local_Value. */ |
| 1199 | if (XSYMBOL (symbol)->indirect_variable) | 1207 | if (XSYMBOL (symbol)->indirect_variable) |
| 1200 | symbol = indirect_variable (symbol); | 1208 | XSETSYMBOL (symbol, indirect_variable (XSYMBOL (symbol))); |
| 1201 | 1209 | ||
| 1202 | /* What binding is loaded right now? */ | 1210 | /* What binding is loaded right now? */ |
| 1203 | current_alist_element | 1211 | current_alist_element |
| @@ -1239,7 +1247,7 @@ set_internal (symbol, newval, buf, bindflag) | |||
| 1239 | Likewise if the variable has been let-bound | 1247 | Likewise if the variable has been let-bound |
| 1240 | in the current buffer. */ | 1248 | in the current buffer. */ |
| 1241 | if (bindflag || !XBUFFER_LOCAL_VALUE (valcontents)->local_if_set | 1249 | if (bindflag || !XBUFFER_LOCAL_VALUE (valcontents)->local_if_set |
| 1242 | || let_shadows_buffer_binding_p (symbol)) | 1250 | || let_shadows_buffer_binding_p (XSYMBOL (symbol))) |
| 1243 | { | 1251 | { |
| 1244 | XBUFFER_LOCAL_VALUE (valcontents)->found_for_buffer = 0; | 1252 | XBUFFER_LOCAL_VALUE (valcontents)->found_for_buffer = 0; |
| 1245 | 1253 | ||
| @@ -1473,13 +1481,14 @@ The function `default-value' gets the default value and `set-default' sets it. | |||
| 1473 | register Lisp_Object variable; | 1481 | register Lisp_Object variable; |
| 1474 | { | 1482 | { |
| 1475 | register Lisp_Object tem, valcontents, newval; | 1483 | register Lisp_Object tem, valcontents, newval; |
| 1484 | struct Lisp_Symbol *sym; | ||
| 1476 | 1485 | ||
| 1477 | CHECK_SYMBOL (variable); | 1486 | CHECK_SYMBOL (variable); |
| 1478 | variable = indirect_variable (variable); | 1487 | sym = indirect_variable (XSYMBOL (variable)); |
| 1479 | 1488 | ||
| 1480 | valcontents = SYMBOL_VALUE (variable); | 1489 | valcontents = sym->value; |
| 1481 | if (XSYMBOL (variable)->constant || KBOARD_OBJFWDP (valcontents)) | 1490 | if (sym->constant || KBOARD_OBJFWDP (valcontents)) |
| 1482 | error ("Symbol %s may not be buffer-local", SDATA (SYMBOL_NAME (variable))); | 1491 | error ("Symbol %s may not be buffer-local", SDATA (sym->xname)); |
| 1483 | 1492 | ||
| 1484 | if (BUFFER_OBJFWDP (valcontents)) | 1493 | if (BUFFER_OBJFWDP (valcontents)) |
| 1485 | return variable; | 1494 | return variable; |
| @@ -1488,19 +1497,19 @@ The function `default-value' gets the default value and `set-default' sets it. | |||
| 1488 | else | 1497 | else |
| 1489 | { | 1498 | { |
| 1490 | if (EQ (valcontents, Qunbound)) | 1499 | if (EQ (valcontents, Qunbound)) |
| 1491 | SET_SYMBOL_VALUE (variable, Qnil); | 1500 | sym->value = Qnil; |
| 1492 | tem = Fcons (Qnil, Fsymbol_value (variable)); | 1501 | tem = Fcons (Qnil, Fsymbol_value (variable)); |
| 1493 | XSETCAR (tem, tem); | 1502 | XSETCAR (tem, tem); |
| 1494 | newval = allocate_misc (); | 1503 | newval = allocate_misc (); |
| 1495 | XMISCTYPE (newval) = Lisp_Misc_Buffer_Local_Value; | 1504 | XMISCTYPE (newval) = Lisp_Misc_Buffer_Local_Value; |
| 1496 | XBUFFER_LOCAL_VALUE (newval)->realvalue = SYMBOL_VALUE (variable); | 1505 | XBUFFER_LOCAL_VALUE (newval)->realvalue = sym->value; |
| 1497 | XBUFFER_LOCAL_VALUE (newval)->buffer = Fcurrent_buffer (); | 1506 | XBUFFER_LOCAL_VALUE (newval)->buffer = Fcurrent_buffer (); |
| 1498 | XBUFFER_LOCAL_VALUE (newval)->frame = Qnil; | 1507 | XBUFFER_LOCAL_VALUE (newval)->frame = Qnil; |
| 1499 | XBUFFER_LOCAL_VALUE (newval)->found_for_buffer = 0; | 1508 | XBUFFER_LOCAL_VALUE (newval)->found_for_buffer = 0; |
| 1500 | XBUFFER_LOCAL_VALUE (newval)->found_for_frame = 0; | 1509 | XBUFFER_LOCAL_VALUE (newval)->found_for_frame = 0; |
| 1501 | XBUFFER_LOCAL_VALUE (newval)->check_frame = 0; | 1510 | XBUFFER_LOCAL_VALUE (newval)->check_frame = 0; |
| 1502 | XBUFFER_LOCAL_VALUE (newval)->cdr = tem; | 1511 | XBUFFER_LOCAL_VALUE (newval)->cdr = tem; |
| 1503 | SET_SYMBOL_VALUE (variable, newval); | 1512 | sym->value = newval; |
| 1504 | } | 1513 | } |
| 1505 | XBUFFER_LOCAL_VALUE (newval)->local_if_set = 1; | 1514 | XBUFFER_LOCAL_VALUE (newval)->local_if_set = 1; |
| 1506 | return variable; | 1515 | return variable; |
| @@ -1530,13 +1539,14 @@ Instead, use `add-hook' and specify t for the LOCAL argument. */) | |||
| 1530 | register Lisp_Object variable; | 1539 | register Lisp_Object variable; |
| 1531 | { | 1540 | { |
| 1532 | register Lisp_Object tem, valcontents; | 1541 | register Lisp_Object tem, valcontents; |
| 1542 | struct Lisp_Symbol *sym; | ||
| 1533 | 1543 | ||
| 1534 | CHECK_SYMBOL (variable); | 1544 | CHECK_SYMBOL (variable); |
| 1535 | variable = indirect_variable (variable); | 1545 | sym = indirect_variable (XSYMBOL (variable)); |
| 1536 | 1546 | ||
| 1537 | valcontents = SYMBOL_VALUE (variable); | 1547 | valcontents = sym->value; |
| 1538 | if (XSYMBOL (variable)->constant || KBOARD_OBJFWDP (valcontents)) | 1548 | if (sym->constant || KBOARD_OBJFWDP (valcontents)) |
| 1539 | error ("Symbol %s may not be buffer-local", SDATA (SYMBOL_NAME (variable))); | 1549 | error ("Symbol %s may not be buffer-local", SDATA (sym->xname)); |
| 1540 | 1550 | ||
| 1541 | if ((BUFFER_LOCAL_VALUEP (valcontents) | 1551 | if ((BUFFER_LOCAL_VALUEP (valcontents) |
| 1542 | && XBUFFER_LOCAL_VALUE (valcontents)->local_if_set) | 1552 | && XBUFFER_LOCAL_VALUE (valcontents)->local_if_set) |
| @@ -1557,7 +1567,7 @@ Instead, use `add-hook' and specify t for the LOCAL argument. */) | |||
| 1557 | XSETCAR (tem, tem); | 1567 | XSETCAR (tem, tem); |
| 1558 | newval = allocate_misc (); | 1568 | newval = allocate_misc (); |
| 1559 | XMISCTYPE (newval) = Lisp_Misc_Buffer_Local_Value; | 1569 | XMISCTYPE (newval) = Lisp_Misc_Buffer_Local_Value; |
| 1560 | XBUFFER_LOCAL_VALUE (newval)->realvalue = SYMBOL_VALUE (variable); | 1570 | XBUFFER_LOCAL_VALUE (newval)->realvalue = sym->value; |
| 1561 | XBUFFER_LOCAL_VALUE (newval)->buffer = Qnil; | 1571 | XBUFFER_LOCAL_VALUE (newval)->buffer = Qnil; |
| 1562 | XBUFFER_LOCAL_VALUE (newval)->frame = Qnil; | 1572 | XBUFFER_LOCAL_VALUE (newval)->frame = Qnil; |
| 1563 | XBUFFER_LOCAL_VALUE (newval)->local_if_set = 0; | 1573 | XBUFFER_LOCAL_VALUE (newval)->local_if_set = 0; |
| @@ -1565,9 +1575,10 @@ Instead, use `add-hook' and specify t for the LOCAL argument. */) | |||
| 1565 | XBUFFER_LOCAL_VALUE (newval)->found_for_frame = 0; | 1575 | XBUFFER_LOCAL_VALUE (newval)->found_for_frame = 0; |
| 1566 | XBUFFER_LOCAL_VALUE (newval)->check_frame = 0; | 1576 | XBUFFER_LOCAL_VALUE (newval)->check_frame = 0; |
| 1567 | XBUFFER_LOCAL_VALUE (newval)->cdr = tem; | 1577 | XBUFFER_LOCAL_VALUE (newval)->cdr = tem; |
| 1568 | SET_SYMBOL_VALUE (variable, newval); | 1578 | sym->value = newval; |
| 1569 | } | 1579 | } |
| 1570 | /* Make sure this buffer has its own value of symbol. */ | 1580 | /* Make sure this buffer has its own value of symbol. */ |
| 1581 | XSETSYMBOL (variable, sym); /* Propagate variable indirections. */ | ||
| 1571 | tem = Fassq (variable, current_buffer->local_var_alist); | 1582 | tem = Fassq (variable, current_buffer->local_var_alist); |
| 1572 | if (NILP (tem)) | 1583 | if (NILP (tem)) |
| 1573 | { | 1584 | { |
| @@ -1577,7 +1588,7 @@ Instead, use `add-hook' and specify t for the LOCAL argument. */) | |||
| 1577 | find_symbol_value (variable); | 1588 | find_symbol_value (variable); |
| 1578 | 1589 | ||
| 1579 | current_buffer->local_var_alist | 1590 | current_buffer->local_var_alist |
| 1580 | = Fcons (Fcons (variable, XCDR (XBUFFER_LOCAL_VALUE (SYMBOL_VALUE (variable))->cdr)), | 1591 | = Fcons (Fcons (variable, XCDR (XBUFFER_LOCAL_VALUE (sym->value)->cdr)), |
| 1581 | current_buffer->local_var_alist); | 1592 | current_buffer->local_var_alist); |
| 1582 | 1593 | ||
| 1583 | /* Make sure symbol does not think it is set up for this buffer; | 1594 | /* Make sure symbol does not think it is set up for this buffer; |
| @@ -1585,7 +1596,7 @@ Instead, use `add-hook' and specify t for the LOCAL argument. */) | |||
| 1585 | { | 1596 | { |
| 1586 | Lisp_Object *pvalbuf; | 1597 | Lisp_Object *pvalbuf; |
| 1587 | 1598 | ||
| 1588 | valcontents = SYMBOL_VALUE (variable); | 1599 | valcontents = sym->value; |
| 1589 | 1600 | ||
| 1590 | pvalbuf = &XBUFFER_LOCAL_VALUE (valcontents)->buffer; | 1601 | pvalbuf = &XBUFFER_LOCAL_VALUE (valcontents)->buffer; |
| 1591 | if (current_buffer == XBUFFER (*pvalbuf)) | 1602 | if (current_buffer == XBUFFER (*pvalbuf)) |
| @@ -1598,9 +1609,9 @@ Instead, use `add-hook' and specify t for the LOCAL argument. */) | |||
| 1598 | for this buffer now. If C code modifies the variable before we | 1609 | for this buffer now. If C code modifies the variable before we |
| 1599 | load the binding in, then that new value will clobber the default | 1610 | load the binding in, then that new value will clobber the default |
| 1600 | binding the next time we unload it. */ | 1611 | binding the next time we unload it. */ |
| 1601 | valcontents = XBUFFER_LOCAL_VALUE (SYMBOL_VALUE (variable))->realvalue; | 1612 | valcontents = XBUFFER_LOCAL_VALUE (sym->value)->realvalue; |
| 1602 | if (INTFWDP (valcontents) || BOOLFWDP (valcontents) || OBJFWDP (valcontents)) | 1613 | if (INTFWDP (valcontents) || BOOLFWDP (valcontents) || OBJFWDP (valcontents)) |
| 1603 | swap_in_symval_forwarding (variable, SYMBOL_VALUE (variable)); | 1614 | swap_in_symval_forwarding (variable, sym->value); |
| 1604 | 1615 | ||
| 1605 | return variable; | 1616 | return variable; |
| 1606 | } | 1617 | } |
| @@ -1613,11 +1624,12 @@ From now on the default value will apply in this buffer. Return VARIABLE. */) | |||
| 1613 | register Lisp_Object variable; | 1624 | register Lisp_Object variable; |
| 1614 | { | 1625 | { |
| 1615 | register Lisp_Object tem, valcontents; | 1626 | register Lisp_Object tem, valcontents; |
| 1627 | struct Lisp_Symbol *sym; | ||
| 1616 | 1628 | ||
| 1617 | CHECK_SYMBOL (variable); | 1629 | CHECK_SYMBOL (variable); |
| 1618 | variable = indirect_variable (variable); | 1630 | sym = indirect_variable (XSYMBOL (variable)); |
| 1619 | 1631 | ||
| 1620 | valcontents = SYMBOL_VALUE (variable); | 1632 | valcontents = sym->value; |
| 1621 | 1633 | ||
| 1622 | if (BUFFER_OBJFWDP (valcontents)) | 1634 | if (BUFFER_OBJFWDP (valcontents)) |
| 1623 | { | 1635 | { |
| @@ -1637,7 +1649,7 @@ From now on the default value will apply in this buffer. Return VARIABLE. */) | |||
| 1637 | return variable; | 1649 | return variable; |
| 1638 | 1650 | ||
| 1639 | /* Get rid of this buffer's alist element, if any. */ | 1651 | /* Get rid of this buffer's alist element, if any. */ |
| 1640 | 1652 | XSETSYMBOL (variable, sym); /* Propagate variable indirection. */ | |
| 1641 | tem = Fassq (variable, current_buffer->local_var_alist); | 1653 | tem = Fassq (variable, current_buffer->local_var_alist); |
| 1642 | if (!NILP (tem)) | 1654 | if (!NILP (tem)) |
| 1643 | current_buffer->local_var_alist | 1655 | current_buffer->local_var_alist |
| @@ -1648,7 +1660,7 @@ From now on the default value will apply in this buffer. Return VARIABLE. */) | |||
| 1648 | forwarded objects won't work right. */ | 1660 | forwarded objects won't work right. */ |
| 1649 | { | 1661 | { |
| 1650 | Lisp_Object *pvalbuf, buf; | 1662 | Lisp_Object *pvalbuf, buf; |
| 1651 | valcontents = SYMBOL_VALUE (variable); | 1663 | valcontents = sym->value; |
| 1652 | pvalbuf = &XBUFFER_LOCAL_VALUE (valcontents)->buffer; | 1664 | pvalbuf = &XBUFFER_LOCAL_VALUE (valcontents)->buffer; |
| 1653 | XSETBUFFER (buf, current_buffer); | 1665 | XSETBUFFER (buf, current_buffer); |
| 1654 | if (EQ (buf, *pvalbuf)) | 1666 | if (EQ (buf, *pvalbuf)) |
| @@ -1685,14 +1697,15 @@ Buffer-local bindings take precedence over frame-local bindings. */) | |||
| 1685 | register Lisp_Object variable; | 1697 | register Lisp_Object variable; |
| 1686 | { | 1698 | { |
| 1687 | register Lisp_Object tem, valcontents, newval; | 1699 | register Lisp_Object tem, valcontents, newval; |
| 1700 | struct Lisp_Symbol *sym; | ||
| 1688 | 1701 | ||
| 1689 | CHECK_SYMBOL (variable); | 1702 | CHECK_SYMBOL (variable); |
| 1690 | variable = indirect_variable (variable); | 1703 | sym = indirect_variable (XSYMBOL (variable)); |
| 1691 | 1704 | ||
| 1692 | valcontents = SYMBOL_VALUE (variable); | 1705 | valcontents = sym->value; |
| 1693 | if (XSYMBOL (variable)->constant || KBOARD_OBJFWDP (valcontents) | 1706 | if (sym->constant || KBOARD_OBJFWDP (valcontents) |
| 1694 | || BUFFER_OBJFWDP (valcontents)) | 1707 | || BUFFER_OBJFWDP (valcontents)) |
| 1695 | error ("Symbol %s may not be frame-local", SDATA (SYMBOL_NAME (variable))); | 1708 | error ("Symbol %s may not be frame-local", SDATA (sym->xname)); |
| 1696 | 1709 | ||
| 1697 | if (BUFFER_LOCAL_VALUEP (valcontents)) | 1710 | if (BUFFER_LOCAL_VALUEP (valcontents)) |
| 1698 | { | 1711 | { |
| @@ -1701,12 +1714,12 @@ Buffer-local bindings take precedence over frame-local bindings. */) | |||
| 1701 | } | 1714 | } |
| 1702 | 1715 | ||
| 1703 | if (EQ (valcontents, Qunbound)) | 1716 | if (EQ (valcontents, Qunbound)) |
| 1704 | SET_SYMBOL_VALUE (variable, Qnil); | 1717 | sym->value = Qnil; |
| 1705 | tem = Fcons (Qnil, Fsymbol_value (variable)); | 1718 | tem = Fcons (Qnil, Fsymbol_value (variable)); |
| 1706 | XSETCAR (tem, tem); | 1719 | XSETCAR (tem, tem); |
| 1707 | newval = allocate_misc (); | 1720 | newval = allocate_misc (); |
| 1708 | XMISCTYPE (newval) = Lisp_Misc_Buffer_Local_Value; | 1721 | XMISCTYPE (newval) = Lisp_Misc_Buffer_Local_Value; |
| 1709 | XBUFFER_LOCAL_VALUE (newval)->realvalue = SYMBOL_VALUE (variable); | 1722 | XBUFFER_LOCAL_VALUE (newval)->realvalue = sym->value; |
| 1710 | XBUFFER_LOCAL_VALUE (newval)->buffer = Qnil; | 1723 | XBUFFER_LOCAL_VALUE (newval)->buffer = Qnil; |
| 1711 | XBUFFER_LOCAL_VALUE (newval)->frame = Qnil; | 1724 | XBUFFER_LOCAL_VALUE (newval)->frame = Qnil; |
| 1712 | XBUFFER_LOCAL_VALUE (newval)->local_if_set = 0; | 1725 | XBUFFER_LOCAL_VALUE (newval)->local_if_set = 0; |
| @@ -1714,7 +1727,7 @@ Buffer-local bindings take precedence over frame-local bindings. */) | |||
| 1714 | XBUFFER_LOCAL_VALUE (newval)->found_for_frame = 0; | 1727 | XBUFFER_LOCAL_VALUE (newval)->found_for_frame = 0; |
| 1715 | XBUFFER_LOCAL_VALUE (newval)->check_frame = 1; | 1728 | XBUFFER_LOCAL_VALUE (newval)->check_frame = 1; |
| 1716 | XBUFFER_LOCAL_VALUE (newval)->cdr = tem; | 1729 | XBUFFER_LOCAL_VALUE (newval)->cdr = tem; |
| 1717 | SET_SYMBOL_VALUE (variable, newval); | 1730 | sym->value = newval; |
| 1718 | return variable; | 1731 | return variable; |
| 1719 | } | 1732 | } |
| 1720 | 1733 | ||
| @@ -1727,6 +1740,7 @@ BUFFER defaults to the current buffer. */) | |||
| 1727 | { | 1740 | { |
| 1728 | Lisp_Object valcontents; | 1741 | Lisp_Object valcontents; |
| 1729 | register struct buffer *buf; | 1742 | register struct buffer *buf; |
| 1743 | struct Lisp_Symbol *sym; | ||
| 1730 | 1744 | ||
| 1731 | if (NILP (buffer)) | 1745 | if (NILP (buffer)) |
| 1732 | buf = current_buffer; | 1746 | buf = current_buffer; |
| @@ -1737,9 +1751,10 @@ BUFFER defaults to the current buffer. */) | |||
| 1737 | } | 1751 | } |
| 1738 | 1752 | ||
| 1739 | CHECK_SYMBOL (variable); | 1753 | CHECK_SYMBOL (variable); |
| 1740 | variable = indirect_variable (variable); | 1754 | sym = indirect_variable (XSYMBOL (variable)); |
| 1741 | 1755 | XSETSYMBOL (variable, sym); | |
| 1742 | valcontents = SYMBOL_VALUE (variable); | 1756 | |
| 1757 | valcontents = sym->value; | ||
| 1743 | if (BUFFER_LOCAL_VALUEP (valcontents)) | 1758 | if (BUFFER_LOCAL_VALUEP (valcontents)) |
| 1744 | { | 1759 | { |
| 1745 | Lisp_Object tail, elt; | 1760 | Lisp_Object tail, elt; |
| @@ -1774,6 +1789,7 @@ BUFFER defaults to the current buffer. */) | |||
| 1774 | { | 1789 | { |
| 1775 | Lisp_Object valcontents; | 1790 | Lisp_Object valcontents; |
| 1776 | register struct buffer *buf; | 1791 | register struct buffer *buf; |
| 1792 | struct Lisp_Symbol *sym; | ||
| 1777 | 1793 | ||
| 1778 | if (NILP (buffer)) | 1794 | if (NILP (buffer)) |
| 1779 | buf = current_buffer; | 1795 | buf = current_buffer; |
| @@ -1784,9 +1800,10 @@ BUFFER defaults to the current buffer. */) | |||
| 1784 | } | 1800 | } |
| 1785 | 1801 | ||
| 1786 | CHECK_SYMBOL (variable); | 1802 | CHECK_SYMBOL (variable); |
| 1787 | variable = indirect_variable (variable); | 1803 | sym = indirect_variable (XSYMBOL (variable)); |
| 1804 | XSETSYMBOL (variable, sym); | ||
| 1788 | 1805 | ||
| 1789 | valcontents = SYMBOL_VALUE (variable); | 1806 | valcontents = sym->value; |
| 1790 | 1807 | ||
| 1791 | if (BUFFER_OBJFWDP (valcontents)) | 1808 | if (BUFFER_OBJFWDP (valcontents)) |
| 1792 | /* All these slots become local if they are set. */ | 1809 | /* All these slots become local if they are set. */ |
| @@ -1816,14 +1833,15 @@ If the current binding is global (the default), the value is nil. */) | |||
| 1816 | register Lisp_Object variable; | 1833 | register Lisp_Object variable; |
| 1817 | { | 1834 | { |
| 1818 | Lisp_Object valcontents; | 1835 | Lisp_Object valcontents; |
| 1836 | struct Lisp_Symbol *sym; | ||
| 1819 | 1837 | ||
| 1820 | CHECK_SYMBOL (variable); | 1838 | CHECK_SYMBOL (variable); |
| 1821 | variable = indirect_variable (variable); | 1839 | sym = indirect_variable (XSYMBOL (variable)); |
| 1822 | 1840 | ||
| 1823 | /* Make sure the current binding is actually swapped in. */ | 1841 | /* Make sure the current binding is actually swapped in. */ |
| 1824 | find_symbol_value (variable); | 1842 | find_symbol_value (variable); |
| 1825 | 1843 | ||
| 1826 | valcontents = XSYMBOL (variable)->value; | 1844 | valcontents = sym->value; |
| 1827 | 1845 | ||
| 1828 | if (BUFFER_LOCAL_VALUEP (valcontents) | 1846 | if (BUFFER_LOCAL_VALUEP (valcontents) |
| 1829 | || BUFFER_OBJFWDP (valcontents)) | 1847 | || BUFFER_OBJFWDP (valcontents)) |