aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
authorStefan Monnier2007-11-19 07:44:30 +0000
committerStefan Monnier2007-11-19 07:44:30 +0000
commite7c10f83b381cbc91742f2e2021d9a411bef24e2 (patch)
tree7bbcecba05cbe383396071339569e3f948f60e52 /src/buffer.c
parent136eb6ed3f689a6348e5e1c23beef2563d70d6f1 (diff)
downloademacs-e7c10f83b381cbc91742f2e2021d9a411bef24e2.tar.gz
emacs-e7c10f83b381cbc91742f2e2021d9a411bef24e2.zip
(Fbuffer_local_value): Remove redundant test.
(swap_out_buffer_local_variables): Swap out binding in `buffer' rather than in `current-buffer' to match the comment. Do the swap using swap_in_global_binding.
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c26
1 files changed, 5 insertions, 21 deletions
diff --git a/src/buffer.c b/src/buffer.c
index c53d427499a..045a22c8e31 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -895,8 +895,7 @@ is the default binding of the variable. */)
895 CHECK_BUFFER (buffer); 895 CHECK_BUFFER (buffer);
896 buf = XBUFFER (buffer); 896 buf = XBUFFER (buffer);
897 897
898 if (SYMBOLP (variable)) 898 variable = indirect_variable (variable);
899 variable = indirect_variable (variable);
900 899
901 /* Look in local_var_list */ 900 /* Look in local_var_list */
902 result = Fassoc (variable, buf->local_var_alist); 901 result = Fassoc (variable, buf->local_var_alist);
@@ -2518,26 +2517,11 @@ swap_out_buffer_local_variables (b)
2518 2517
2519 /* Need not do anything if some other buffer's binding is now encached. */ 2518 /* Need not do anything if some other buffer's binding is now encached. */
2520 tem = XBUFFER_LOCAL_VALUE (SYMBOL_VALUE (sym))->buffer; 2519 tem = XBUFFER_LOCAL_VALUE (SYMBOL_VALUE (sym))->buffer;
2521 if (BUFFERP (tem) && XBUFFER (tem) == current_buffer) 2520 if (EQ (tem, buffer))
2522 { 2521 {
2523 /* Symbol is set up for this buffer's old local value. 2522 /* Symbol is set up for this buffer's old local value:
2524 Set it up for the current buffer with the default value. */ 2523 swap it out! */
2525 2524 swap_in_global_binding (sym);
2526 tem = XBUFFER_LOCAL_VALUE (SYMBOL_VALUE (sym))->cdr;
2527 /* Store the symbol's current value into the alist entry
2528 it is currently set up for. This is so that, if the
2529 local is marked permanent, and we make it local again
2530 later in Fkill_all_local_variables, we don't lose the value. */
2531 XSETCDR (XCAR (tem),
2532 do_symval_forwarding (XBUFFER_LOCAL_VALUE (SYMBOL_VALUE (sym))->realvalue));
2533 /* Switch to the symbol's default-value alist entry. */
2534 XSETCAR (tem, tem);
2535 /* Mark it as current for buffer B. */
2536 XBUFFER_LOCAL_VALUE (SYMBOL_VALUE (sym))->buffer = buffer;
2537 /* Store the current value into any forwarding in the symbol. */
2538 store_symval_forwarding (sym,
2539 XBUFFER_LOCAL_VALUE (SYMBOL_VALUE (sym))->realvalue,
2540 XCDR (tem), NULL);
2541 } 2525 }
2542 } 2526 }
2543} 2527}