diff options
| author | Stefan Monnier | 2008-05-30 02:37:40 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2008-05-30 02:37:40 +0000 |
| commit | fd9440c58241b6a9f6da824522d2f666d54412aa (patch) | |
| tree | dd871520a01a2503d8e9261a34fdb02687f5a8db /src/data.c | |
| parent | 7736dabea784c9fb44b3d1a9a1882a5ff3e16271 (diff) | |
| download | emacs-fd9440c58241b6a9f6da824522d2f666d54412aa.tar.gz emacs-fd9440c58241b6a9f6da824522d2f666d54412aa.zip | |
(Fmake_variable_buffer_local, Fmake_local_variable)
(Fmake_variable_frame_local): Disallow mixing buffer-local and
frame-local settings for the same variable.
Diffstat (limited to 'src/data.c')
| -rw-r--r-- | src/data.c | 13 |
1 files changed, 10 insertions, 3 deletions
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. | |||
| 1493 | if (BUFFER_OBJFWDP (valcontents)) | 1493 | if (BUFFER_OBJFWDP (valcontents)) |
| 1494 | return variable; | 1494 | return variable; |
| 1495 | else if (BUFFER_LOCAL_VALUEP (valcontents)) | 1495 | else if (BUFFER_LOCAL_VALUEP (valcontents)) |
| 1496 | newval = valcontents; | 1496 | { |
| 1497 | if (XBUFFER_LOCAL_VALUE (valcontents)->check_frame) | ||
| 1498 | error ("Symbol %s may not be buffer-local", SDATA (sym->xname)); | ||
| 1499 | newval = valcontents; | ||
| 1500 | } | ||
| 1497 | else | 1501 | else |
| 1498 | { | 1502 | { |
| 1499 | if (EQ (valcontents, Qunbound)) | 1503 | if (EQ (valcontents, Qunbound)) |
| @@ -1545,7 +1549,9 @@ Instead, use `add-hook' and specify t for the LOCAL argument. */) | |||
| 1545 | sym = indirect_variable (XSYMBOL (variable)); | 1549 | sym = indirect_variable (XSYMBOL (variable)); |
| 1546 | 1550 | ||
| 1547 | valcontents = sym->value; | 1551 | valcontents = sym->value; |
| 1548 | if (sym->constant || KBOARD_OBJFWDP (valcontents)) | 1552 | if (sym->constant || KBOARD_OBJFWDP (valcontents) |
| 1553 | || (BUFFER_LOCAL_VALUEP (valcontents) | ||
| 1554 | && (XBUFFER_LOCAL_VALUE (valcontents)->check_frame))) | ||
| 1549 | error ("Symbol %s may not be buffer-local", SDATA (sym->xname)); | 1555 | error ("Symbol %s may not be buffer-local", SDATA (sym->xname)); |
| 1550 | 1556 | ||
| 1551 | if ((BUFFER_LOCAL_VALUEP (valcontents) | 1557 | if ((BUFFER_LOCAL_VALUEP (valcontents) |
| @@ -1709,7 +1715,8 @@ Buffer-local bindings take precedence over frame-local bindings. */) | |||
| 1709 | 1715 | ||
| 1710 | if (BUFFER_LOCAL_VALUEP (valcontents)) | 1716 | if (BUFFER_LOCAL_VALUEP (valcontents)) |
| 1711 | { | 1717 | { |
| 1712 | XBUFFER_LOCAL_VALUE (valcontents)->check_frame = 1; | 1718 | if (!XBUFFER_LOCAL_VALUE (valcontents)->check_frame) |
| 1719 | error ("Symbol %s may not be frame-local", SDATA (sym->xname)); | ||
| 1713 | return variable; | 1720 | return variable; |
| 1714 | } | 1721 | } |
| 1715 | 1722 | ||