From: Stefan Monnier Date: Mon, 11 Feb 2008 17:56:13 +0000 (+0000) Subject: (clone_per_buffer_values, reset_buffer_local_variables) X-Git-Tag: emacs-pretest-23.0.90~7996 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3ee24aecf63898e562772ed1e13b2b740937d057;p=emacs.git (clone_per_buffer_values, reset_buffer_local_variables) (Fbuffer_local_value, Fbuffer_local_variables): Don't forget undo_list. --- diff --git a/src/ChangeLog b/src/ChangeLog index 9b488a5c1d0..ee321261a10 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2008-02-11 Stefan Monnier + + * buffer.c (clone_per_buffer_values, reset_buffer_local_variables) + (Fbuffer_local_value, Fbuffer_local_variables): Don't forget undo_list. + 2008-02-11 Juanma Barranquero * w32menu.c (push_submenu_start, push_submenu_end) diff --git a/src/buffer.c b/src/buffer.c index d056ce7dc48..c0162841c62 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -496,7 +496,9 @@ clone_per_buffer_values (from, to) XSETBUFFER (to_buffer, to); - for (offset = PER_BUFFER_VAR_OFFSET (name) + sizeof (Lisp_Object); + /* buffer-local Lisp variables start at `undo_list', + tho only the ones from `name' on are GC'd normally. */ + for (offset = PER_BUFFER_VAR_OFFSET (undo_list) + sizeof (Lisp_Object); offset < sizeof *to; offset += sizeof (Lisp_Object)) { @@ -808,7 +810,9 @@ reset_buffer_local_variables (b, permanent_too) /* For each slot that has a default value, copy that into the slot. */ - for (offset = PER_BUFFER_VAR_OFFSET (name); + /* buffer-local Lisp variables start at `undo_list', + tho only the ones from `name' on are GC'd normally. */ + for (offset = PER_BUFFER_VAR_OFFSET (undo_list); offset < sizeof *b; offset += sizeof (Lisp_Object)) { @@ -940,7 +944,9 @@ is the default binding of the variable. */) int found = 0; /* Look in special slots */ - for (offset = PER_BUFFER_VAR_OFFSET (name); + /* buffer-local Lisp variables start at `undo_list', + tho only the ones from `name' on are GC'd normally. */ + for (offset = PER_BUFFER_VAR_OFFSET (undo_list); offset < sizeof (struct buffer); /* sizeof EMACS_INT == sizeof Lisp_Object */ offset += (sizeof (EMACS_INT))) @@ -1051,7 +1057,9 @@ No argument or nil as argument means use current buffer as BUFFER. */) { int offset, idx; - for (offset = PER_BUFFER_VAR_OFFSET (name); + /* buffer-local Lisp variables start at `undo_list', + tho only the ones from `name' on are GC'd normally. */ + for (offset = PER_BUFFER_VAR_OFFSET (undo_list); offset < sizeof (struct buffer); /* sizeof EMACS_INT == sizeof Lisp_Object */ offset += (sizeof (EMACS_INT)))