re-attach intervals to its base buffer (Bug#16502).
* intervals.c (set_interval_object): Move from here...
* intervals.h (set_interval_object): ... to here. Fix comments.
+2014-01-21 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * buffer.c (Fkill_buffer): When killing an indirect buffer,
+ re-attach intervals to its base buffer (Bug#16502).
+ * intervals.c (set_interval_object): Move from here...
+ * intervals.h (set_interval_object): ... to here. Fix comments.
+
2014-01-20 Paul Eggert <eggert@cs.ucla.edu>
Avoid undefined behavior by initializing buffer redisplay bit.
if (b->base_buffer)
{
+ INTERVAL i;
/* Unchain all markers that belong to this indirect buffer.
Don't unchain the markers that belong to the base buffer
or its other indirect buffers. */
else
mp = &m->next;
}
+ /* Intervals should be owned by the base buffer (Bug#16502). */
+ i = buffer_intervals (b);
+ if (i)
+ {
+ Lisp_Object owner;
+ XSETBUFFER (owner, b->base_buffer);
+ set_interval_object (i, owner);
+ }
}
else
{
\f
/* Utility functions for intervals. */
-/* Use these functions to set Lisp_Object
- or pointer slots of struct interval. */
-
-static void
-set_interval_object (INTERVAL i, Lisp_Object obj)
-{
- eassert (BUFFERP (obj) || STRINGP (obj));
- i->up_obj = 1;
- i->up.obj = obj;
-}
+/* Use these functions to set pointer slots of struct interval. */
static void
set_interval_left (INTERVAL i, INTERVAL left)
/* Use these functions to set Lisp_Object
or pointer slots of struct interval. */
+INLINE void
+set_interval_object (INTERVAL i, Lisp_Object obj)
+{
+ eassert (BUFFERP (obj) || STRINGP (obj));
+ i->up_obj = 1;
+ i->up.obj = obj;
+}
+
INLINE void
set_interval_parent (INTERVAL i, INTERVAL parent)
{