emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: make-indirect-buffer


From: Richard Stallman
Subject: Re: make-indirect-buffer
Date: Sun, 14 Mar 2004 23:56:59 -0500

      What happens instead is that we wind up with shared
    local variables, whose value when set in either buffer also affects
    the value in the other.

That is definitely a bug.  Does this fix it correctly?


*** buffer.c.~1.445.~   Mon Feb 16 16:22:55 2004
--- buffer.c    Sun Mar 14 23:01:12 2004
***************
*** 487,493 ****
  clone_per_buffer_values (from, to)
       struct buffer *from, *to;
  {
!   Lisp_Object to_buffer;
    int offset;
  
    XSETBUFFER (to_buffer, to);
--- 487,493 ----
  clone_per_buffer_values (from, to)
       struct buffer *from, *to;
  {
!   Lisp_Object to_buffer, tem;
    int offset;
  
    XSETBUFFER (to_buffer, to);
***************
*** 514,519 ****
--- 514,527 ----
  
    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))));
  }
  
  




reply via email to

[Prev in Thread] Current Thread [Next in Thread]