From: Richard M. Stallman Date: Sun, 19 Nov 1995 03:39:22 +0000 (+0000) Subject: (Fmake_local_variable): Call find_symbol_value X-Git-Tag: emacs-19.34~2267 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a5d004a13d6392884b901eddb29b354f89279c13;p=emacs.git (Fmake_local_variable): Call find_symbol_value before making a new local binding. --- 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;