[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: buffer-undo-list
From: |
Stefan Monnier |
Subject: |
Re: buffer-undo-list |
Date: |
Mon, 11 Feb 2008 12:58:03 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux) |
>>>>> "Johan" == Johan Bockgård <bojohan> writes:
> Stefan Monnier <address@hidden> 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)))