[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: transpose-regions
From: |
Chong Yidong |
Subject: |
Re: transpose-regions |
Date: |
Fri, 23 Mar 2007 11:39:40 -0400 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.96 (gnu/linux) |
I've narrowed down the location where the interval plist becomes
invalid. I patched Ftranspose_regions in editfns.c as follows:
*** emacs/src/editfns.c.~1.436.~ 2007-03-17 15:00:52.000000000 -0400
--- emacs/src/editfns.c 2007-03-23 11:31:06.000000000 -0400
***************
*** 4031,4036 ****
--- 4031,4038 ----
It's the caller's job to ensure that START1 <= END1 <= START2 <= END2. */
+ extern Lisp_Object Vdead;
+
static void
transpose_markers (start1, end1, start2, end2,
start1_byte, end1_byte, start2_byte, end2_byte)
***************
*** 4224,4232 ****
--- 4226,4245 ----
tmp_interval1 = copy_intervals (cur_intv, start1, len1);
tmp_interval2 = copy_intervals (cur_intv, start2, len2);
+
+ if (! NULL_INTERVAL_P (tmp_interval1)
+ && CONSP (tmp_interval1->plist)
+ && EQ (XCAR (tmp_interval1->plist), Vdead))
+ abort();
+
Fset_text_properties (make_number (start1), make_number (end2),
Qnil, Qnil);
+ if (! NULL_INTERVAL_P (tmp_interval1)
+ && CONSP (tmp_interval1->plist)
+ && EQ (XCAR (tmp_interval1->plist), Vdead))
+ abort();
+
/* First region smaller than second. */
if (len1_byte < len2_byte)
{
Using Martin's recipe, I obtained the following backtrace:
#0 abort () at emacs.c:431
#1 0x081af617 in Ftranspose_regions (startr1=104688, endr1=105304,
startr2=105304, endr2=105648, leave_markers=137955529) at editfns.c:4241
...
Line 4241 corresponds to the second abort() statement, which means the
plist in tmp_interval1 got garbage collected during the call to
Fset_text_properties. It looks like Fset_text_properties makes
changes to intervals in the buffer; probably this invalidates the
plist in tmp_interval1 in some way.
- Re: transpose-regions, (continued)
- Re: transpose-regions, Richard Stallman, 2007/03/23
- Re: transpose-regions, Stefan Monnier, 2007/03/26
- Re: transpose-regions, Richard Stallman, 2007/03/28
- Re: transpose-regions, Karl Fogel, 2007/03/24
- Re: transpose-regions, Richard Stallman, 2007/03/23
- Re: transpose-regions, Stefan Monnier, 2007/03/23
- Re: transpose-regions, Chong Yidong, 2007/03/24
- Re: transpose-regions, Richard Stallman, 2007/03/25
Re: transpose-regions,
Chong Yidong <=