diff options
| author | Stefan Monnier | 2018-03-23 11:29:06 -0400 |
|---|---|---|
| committer | Noam Postavsky | 2018-06-02 21:48:33 -0400 |
| commit | 2305ee79080ca45856c6ac5de536f537a21384a6 (patch) | |
| tree | 67dfb007d0baaed6e4eaca1de18c9f359b78f5e3 /src/alloc.c | |
| parent | 47ab98ebea7e33b4dc95157300dadf124a087292 (diff) | |
| download | emacs-scratch/np/backports-26.2.tar.gz emacs-scratch/np/backports-26.2.zip | |
Fix bug#30846, along with misc cleanups found along the wayscratch/np/backports-26.2
* test/src/data-tests.el (data-tests-kill-all-local-variables): New test.
* src/buffer.c (swap_out_buffer_local_variables): Remove.
Fuse the body of its loop into that of reset_buffer_local_variables.
(Fkill_buffer, Fkill_all_local_variables): Don't call it any more.
(reset_buffer_local_variables): Make sure the buffer's local binding
is swapped out before removing it from the alist (bug#30846).
Call watchers before actually killing the var.
* src/data.c (Fmake_local_variable): Simplify.
Use swap_in_global_binding to swap out any local binding, instead of
a mix of find_symbol_value followed by messing with where&found.
Don't call swap_in_symval_forwarding since the currently swapped
binding is never one we've modified.
(Fkill_local_variable): Use swap_in_global_binding rather than messing
with where&found to try and trick find_symbol_value into doing the same.
* src/alloc.c (mark_localized_symbol): 'where' can't be a frame any more.
(cherry picked from commit 3ddff080341580eb6fc18d907181e9cc2301f62d)
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/alloc.c b/src/alloc.c index 09d61b7e5f3..7baaa512c20 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -6334,12 +6334,8 @@ mark_localized_symbol (struct Lisp_Symbol *ptr) | |||
| 6334 | { | 6334 | { |
| 6335 | struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (ptr); | 6335 | struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (ptr); |
| 6336 | Lisp_Object where = blv->where; | 6336 | Lisp_Object where = blv->where; |
| 6337 | /* If the value is set up for a killed buffer or deleted | 6337 | /* If the value is set up for a killed buffer restore its global binding. */ |
| 6338 | frame, restore its global binding. If the value is | 6338 | if ((BUFFERP (where) && !BUFFER_LIVE_P (XBUFFER (where)))) |
| 6339 | forwarded to a C variable, either it's not a Lisp_Object | ||
| 6340 | var, or it's staticpro'd already. */ | ||
| 6341 | if ((BUFFERP (where) && !BUFFER_LIVE_P (XBUFFER (where))) | ||
| 6342 | || (FRAMEP (where) && !FRAME_LIVE_P (XFRAME (where)))) | ||
| 6343 | swap_in_global_binding (ptr); | 6339 | swap_in_global_binding (ptr); |
| 6344 | mark_object (blv->where); | 6340 | mark_object (blv->where); |
| 6345 | mark_object (blv->valcell); | 6341 | mark_object (blv->valcell); |