changeset 55744:dc4797dbcccd

(clone_per_buffer_values): Copy the alist of local vars, and the alist pairs too.
author Richard M. Stallman <rms@gnu.org>
date Sat, 22 May 2004 22:20:51 +0000
parents 4f33fa491183
children 1c3b8ce97c63
files src/buffer.c
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/buffer.c	Sat May 22 22:19:28 2004 +0000
+++ b/src/buffer.c	Sat May 22 22:20:51 2004 +0000
@@ -487,7 +487,7 @@
 clone_per_buffer_values (from, to)
      struct buffer *from, *to;
 {
-  Lisp_Object to_buffer;
+  Lisp_Object to_buffer, tem;
   int offset;
 
   XSETBUFFER (to_buffer, to);
@@ -514,6 +514,14 @@
 
   to->overlays_before = copy_overlays (to, from->overlays_before);
   to->overlays_after = copy_overlays (to, from->overlays_after);
+
+  /* Copy the alist of local variables,
+     and all the alist elements too.  */
+  to->local_var_alist
+    = Fcopy_sequence (from->local_var_alist);
+  for (tem = to->local_var_alist; CONSP (tem);
+       tem = XCDR (tem))
+    XSETCAR (tem, Fcons (XCAR (XCAR (tem)), XCDR (XCAR (tem))));
 }