From a5d004a13d6392884b901eddb29b354f89279c13 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 19 Nov 1995 03:39:22 +0000 Subject: [PATCH] (Fmake_local_variable): Call find_symbol_value before making a new local binding. --- src/data.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/data.c b/src/data.c index 3394cdb147c..1a2c68a4e44 100644 --- a/src/data.c +++ b/src/data.c @@ -1284,6 +1284,11 @@ Use `make-local-hook' instead.") tem = Fassq (sym, current_buffer->local_var_alist); if (NILP (tem)) { + /* Swap out any local binding for some other buffer, and make + sure the current value is permanently recorded, if it's the + default value. */ + find_symbol_value (sym); + current_buffer->local_var_alist = Fcons (Fcons (sym, XCONS (XCONS (XBUFFER_LOCAL_VALUE (XSYMBOL (sym)->value)->cdr)->cdr)->cdr), current_buffer->local_var_alist); @@ -1292,7 +1297,9 @@ Use `make-local-hook' instead.") force it to look once again for this buffer's value */ { Lisp_Object *pvalbuf; + valcontents = XSYMBOL (sym)->value; + pvalbuf = &XCONS (XBUFFER_LOCAL_VALUE (valcontents)->cdr)->car; if (current_buffer == XBUFFER (*pvalbuf)) *pvalbuf = Qnil; -- 2.39.2