diff options
| author | Andrea Corallo | 2020-05-08 20:23:38 +0100 |
|---|---|---|
| committer | Andrea Corallo | 2020-05-08 20:33:00 +0100 |
| commit | e2f183cf1742b30d4cbd25aa54f7485006b63bfe (patch) | |
| tree | 7fdd938c5a1b2bb9f4abb77372c1b2f2915fad17 | |
| parent | 0b0098a697c2ab5069877758fcdaf57d5e438cb1 (diff) | |
| download | emacs-scratch/lexspaces.tar.gz emacs-scratch/lexspaces.zip | |
Shallow setters by default are not a good ideascratch/lexspaces
| -rw-r--r-- | src/lisp.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/lisp.h b/src/lisp.h index 93e7094b420..682de4981f9 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -2294,9 +2294,12 @@ SET_SYMBOL_VAL (struct Lisp_Symbol *sym, Lisp_Object v) | |||
| 2294 | eassert (sym->u.s.redirect == SYMBOL_PLAINVAL); | 2294 | eassert (sym->u.s.redirect == SYMBOL_PLAINVAL); |
| 2295 | if (EQ (sym->u.s.val.value, Qunbound)) | 2295 | if (EQ (sym->u.s.val.value, Qunbound)) |
| 2296 | sym->u.s.val.value = make_binding (Qunbound); | 2296 | sym->u.s.val.value = make_binding (Qunbound); |
| 2297 | EMACS_INT lexspace = CURRENT_LEXSPACE; | ||
| 2297 | struct Lisp_Binding *binding = XBINDING (sym->u.s.val.value); | 2298 | struct Lisp_Binding *binding = XBINDING (sym->u.s.val.value); |
| 2298 | binding->r[CURRENT_LEXSPACE] = false; | 2299 | while (binding->r[lexspace]) |
| 2299 | binding->b[CURRENT_LEXSPACE] = v; | 2300 | lexspace = XFIXNUM (binding->b[lexspace]); |
| 2301 | binding->r[lexspace] = false; | ||
| 2302 | binding->b[lexspace] = v; | ||
| 2300 | } | 2303 | } |
| 2301 | 2304 | ||
| 2302 | INLINE void | 2305 | INLINE void |
| @@ -3482,7 +3485,12 @@ set_symbol_function (Lisp_Object sym, Lisp_Object function) | |||
| 3482 | /* Functions must execute in the original lexspace so lets store it. */ | 3485 | /* Functions must execute in the original lexspace so lets store it. */ |
| 3483 | if (CONSP (function) && EQ (XCAR (function), Qclosure)) | 3486 | if (CONSP (function) && EQ (XCAR (function), Qclosure)) |
| 3484 | function = Fcons (Vcurrent_lexspace_idx, function); | 3487 | function = Fcons (Vcurrent_lexspace_idx, function); |
| 3485 | XBINDING (s->u.s._function)->b[CURRENT_LEXSPACE] = function; | 3488 | EMACS_INT lexspace = CURRENT_LEXSPACE; |
| 3489 | struct Lisp_Binding *binding = XBINDING (s->u.s._function); | ||
| 3490 | /* Follow redirections. */ | ||
| 3491 | while (binding->r[lexspace]) | ||
| 3492 | lexspace = XFIXNUM (binding->b[lexspace]); | ||
| 3493 | binding->b[lexspace] = function; | ||
| 3486 | } | 3494 | } |
| 3487 | 3495 | ||
| 3488 | INLINE void | 3496 | INLINE void |