all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: emacs-devel@gnu.org
Subject: Re: buffer-undo-list
Date: Mon, 11 Feb 2008 12:58:03 -0500	[thread overview]
Message-ID: <jwv3arz1ip0.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <yoij7ihlc5sz.fsf_-_@remote2.student.chalmers.se> ("Johan Bockgård"'s message of "Mon, 04 Feb 2008 12:35:56 +0100")

>>>>> "Johan" == Johan Bockgård <bojohan> writes:

> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>>> When I move the undo_list to before name and redo the experiment, I hit
>>> the breakpoint many many times.
>> 
>>> So either the special undo_list handling code should be removed or the
>>> undo_list moved before name in buffer.h.
>> 
>> Agreed.  The field was moved by Richard on 14-Oct-2002 but the change
>> log doesn't say why this was done, so I just undid it.

> But now

>   (assq 'buffer-undo-list (buffer-local-variables))
>     => nil

>   (buffer-local-value 'buffer-undo-list (get-buffer "*scratch*"))
>     => nil (global value)

I installed the patch below which should fix these problems.


        Stefan


Index: src/buffer.c
===================================================================
RCS file: /sources/emacs/emacs/src/buffer.c,v
retrieving revision 1.550
diff -u -r1.550 buffer.c
--- src/buffer.c	10 Feb 2008 02:14:00 -0000	1.550
+++ src/buffer.c	11 Feb 2008 17:54:48 -0000
@@ -496,7 +496,9 @@
 
   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 @@
   /* 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 @@
       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 @@
   {
     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)))




  parent reply	other threads:[~2008-02-11 17:58 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-09  3:55 mark_object crash in 22.1 and latest CVS (as of tonight) Kalman Reti
2007-11-09 11:32 ` Kalman Reti
2007-11-10 10:19   ` Kalman Reti
2007-11-11  5:22   ` Richard Stallman
2007-11-12 11:40     ` Kalman Reti
2007-11-12 22:03       ` Stefan Monnier
2007-11-13  0:30         ` Kalman Reti
2007-11-13 20:03         ` Richard Stallman
2007-11-14 17:39           ` Kalman Reti
2007-11-14 18:51             ` Stefan Monnier
2007-11-15  1:00               ` Kalman Reti
2007-11-15 17:09                 ` Richard Stallman
2007-11-16 12:05                   ` Kalman Reti
2007-11-16 14:07                     ` Kalman Reti
2007-11-16 17:28                       ` martin rudalics
2007-11-16 17:56                         ` Kalman Reti
2007-11-17  4:54                           ` Richard Stallman
2007-11-17  5:43                             ` Kalman Reti
2007-11-16 19:04                         ` Stefan Monnier
2007-11-16 21:52                           ` martin rudalics
2007-11-16 22:09                             ` Stefan Monnier
2007-11-16 22:16                             ` Stefan Monnier
2007-11-16 23:59                               ` Kalman Reti
2007-11-17  4:25                                 ` Stefan Monnier
2007-11-17 17:42                           ` Richard Stallman
2007-11-18  3:08                             ` Stefan Monnier
2007-11-18 22:45                               ` Richard Stallman
2007-11-18 23:22                                 ` David Kastrup
2007-11-19  7:50                                   ` Stefan Monnier
2007-11-19 19:03                                   ` Richard Stallman
2007-11-17  4:53                         ` Richard Stallman
2007-11-15  3:08             ` Richard Stallman
2007-11-15  8:38               ` Kalman Reti
2007-11-16 20:48                 ` Kalman Reti
2007-11-16 21:59                   ` Stefan Monnier
2007-11-16 23:09                     ` martin rudalics
2008-02-04 11:35                     ` buffer-undo-list (was: mark_object crash in 22.1 and latest CVS (as of tonight)) Johan Bockgård
2008-02-04 21:44                       ` buffer-undo-list Stefan Monnier
2008-02-11 17:58                       ` Stefan Monnier [this message]
2007-11-13  5:10       ` mark_object crash in 22.1 and latest CVS (as of tonight) Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwv3arz1ip0.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.