summaryrefslogtreecommitdiff
path: root/src/alloc.c
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2018-03-23 11:29:06 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2018-03-23 11:29:06 -0400
commit3ddff080341580eb6fc18d907181e9cc2301f62d (patch)
tree935d45325c27bea24ea660b83b50fa308bc6421a /src/alloc.c
parentcf3164523b32f01dbaad2c1364ecf2dcf8f22aa5 (diff)
downloademacs-3ddff080341580eb6fc18d907181e9cc2301f62d.tar.gz
Fix bug#30846, along with misc cleanups found along the way
* 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.
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 5eaf7cbc1c6..369592d70ee 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -6342,12 +6342,8 @@ mark_localized_symbol (struct Lisp_Symbol *ptr)
{
struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (ptr);
Lisp_Object where = blv->where;
- /* If the value is set up for a killed buffer or deleted
- frame, restore its global binding. If the value is
- forwarded to a C variable, either it's not a Lisp_Object
- var, or it's staticpro'd already. */
- if ((BUFFERP (where) && !BUFFER_LIVE_P (XBUFFER (where)))
- || (FRAMEP (where) && !FRAME_LIVE_P (XFRAME (where))))
+ /* If the value is set up for a killed buffer restore its global binding. */
+ if ((BUFFERP (where) && !BUFFER_LIVE_P (XBUFFER (where))))
swap_in_global_binding (ptr);
mark_object (blv->where);
mark_object (blv->valcell);