memcpy (to->local_flags, from->local_flags, sizeof to->local_flags);
- buffer_set_overlays
- (to, copy_overlays (to, buffer_get_overlays (from, OV_BEFORE)), OV_BEFORE);
- buffer_set_overlays
- (to, copy_overlays (to, buffer_get_overlays (from, OV_AFTER)), OV_AFTER);
+ buffer_set_overlays_before (to, copy_overlays (to, from->overlays_before));
+ buffer_set_overlays_after (to, copy_overlays (to, from->overlays_after));
/* Get (a copy of) the alist of Lisp-level local variables of FROM
and install that in TO. */
{
struct Lisp_Overlay *ov, *next;
- for (ov = buffer_get_overlays (b, OV_BEFORE); ov; ov = next)
+ for (ov = b->overlays_before; ov; ov = next)
{
drop_overlay (b, ov);
next = ov->next;
ov->next = NULL;
}
- for (ov = buffer_get_overlays (b, OV_AFTER); ov; ov = next)
+ for (ov = b->overlays_after; ov; ov = next)
{
drop_overlay (b, ov);
next = ov->next;
ov->next = NULL;
}
- buffer_set_overlays (b, NULL, OV_BEFORE);
- buffer_set_overlays (b, NULL, OV_AFTER);
+ buffer_set_overlays_before (b, NULL);
+ buffer_set_overlays_after (b, NULL);
}
/* Reinitialize everything about a buffer except its name and contents
b->auto_save_failure_time = 0;
BSET (b, auto_save_file_name, Qnil);
BSET (b, read_only, Qnil);
- buffer_set_overlays (b, NULL, OV_BEFORE);
- buffer_set_overlays (b, NULL, OV_AFTER);
+ buffer_set_overlays_before (b, NULL);
+ buffer_set_overlays_after (b, NULL);
b->overlay_center = BEG;
BSET (b, mark_active, Qnil);
BSET (b, point_before_scroll, Qnil);
ptrdiff_t prev = BEGV;
int inhibit_storing = 0;
- for (tail = buffer_get_overlays (NULL, OV_BEFORE); tail; tail = tail->next)
+ for (tail = current_buffer->overlays_before; tail; tail = tail->next)
{
ptrdiff_t startpos, endpos;
next = startpos;
}
- for (tail = buffer_get_overlays (NULL, OV_AFTER); tail; tail = tail->next)
+ for (tail = current_buffer->overlays_after; tail; tail = tail->next)
{
ptrdiff_t startpos, endpos;
int inhibit_storing = 0;
int end_is_Z = end == Z;
- for (tail = buffer_get_overlays (NULL, OV_BEFORE); tail; tail = tail->next)
+ for (tail = current_buffer->overlays_before; tail; tail = tail->next)
{
ptrdiff_t startpos, endpos;
next = startpos;
}
- for (tail = buffer_get_overlays (NULL, OV_AFTER); tail; tail = tail->next)
+ for (tail = current_buffer->overlays_after; tail; tail = tail->next)
{
ptrdiff_t startpos, endpos;
Lisp_Object overlay;
struct Lisp_Overlay *tail;
- for (tail = buffer_get_overlays (NULL, OV_BEFORE); tail; tail = tail->next)
+ for (tail = current_buffer->overlays_before; tail; tail = tail->next)
{
ptrdiff_t endpos;
return 1;
}
- for (tail = buffer_get_overlays (NULL, OV_AFTER); tail; tail = tail->next)
+ for (tail = current_buffer->overlays_after; tail; tail = tail->next)
{
ptrdiff_t startpos;
overlay_heads.used = overlay_heads.bytes = 0;
overlay_tails.used = overlay_tails.bytes = 0;
- for (ov = buffer_get_overlays (NULL, OV_BEFORE); ov; ov = ov->next)
+ for (ov = current_buffer->overlays_before; ov; ov = ov->next)
{
XSETMISC (overlay, ov);
eassert (OVERLAYP (overlay));
Foverlay_get (overlay, Qpriority),
endpos - startpos);
}
- for (ov = buffer_get_overlays (NULL, OV_AFTER); ov; ov = ov->next)
+ for (ov = current_buffer->overlays_after; ov; ov = ov->next)
{
XSETMISC (overlay, ov);
eassert (OVERLAYP (overlay));
But we use it for symmetry and in case that should cease to be true
with some future change. */
prev = NULL;
- for (tail = buffer_get_overlays (buf, OV_BEFORE); tail; prev = tail, tail = next)
+ for (tail = buf->overlays_before; tail; prev = tail, tail = next)
{
next = tail->next;
XSETMISC (overlay, tail);
if (prev)
prev->next = next;
else
- buffer_set_overlays (buf, next, OV_BEFORE);
+ buffer_set_overlays_before (buf, next);
/* Search thru overlays_after for where to put it. */
other_prev = NULL;
- for (other = buffer_get_overlays (buf, OV_AFTER); other;
+ for (other = buf->overlays_after; other;
other_prev = other, other = other->next)
{
Lisp_Object otherbeg, otheroverlay;
if (other_prev)
other_prev->next = tail;
else
- buffer_set_overlays (buf, tail, OV_AFTER);
+ buffer_set_overlays_after (buf, tail);
tail = prev;
}
else
/* See if anything in overlays_after should be in overlays_before. */
prev = NULL;
- for (tail = buffer_get_overlays (buf, OV_AFTER); tail; prev = tail, tail = next)
+ for (tail = buf->overlays_after; tail; prev = tail, tail = next)
{
next = tail->next;
XSETMISC (overlay, tail);
if (prev)
prev->next = next;
else
- buffer_set_overlays (buf, next, OV_AFTER);
+ buffer_set_overlays_after (buf, next);
/* Search thru overlays_before for where to put it. */
other_prev = NULL;
- for (other = buffer_get_overlays (buf, OV_BEFORE); other;
+ for (other = buf->overlays_before; other;
other_prev = other, other = other->next)
{
Lisp_Object otherend, otheroverlay;
if (other_prev)
other_prev->next = tail;
else
- buffer_set_overlays (buf, tail, OV_BEFORE);
+ buffer_set_overlays_before (buf, tail);
tail = prev;
}
}
assigned. */
struct Lisp_Overlay *beforep = NULL, *afterp = NULL;
/* 'Parent', likewise, indicates a cons cell or
- before or after overlays list, depending
+ current_buffer->overlays_before or overlays_after, depending
which loop we're in. */
struct Lisp_Overlay *tail, *parent;
ptrdiff_t startpos, endpos;
(after_list) if it is, is still uninitialized. So it's not a bug
that before_list isn't initialized, although it may look
strange. */
- for (parent = NULL, tail = buffer_get_overlays (NULL, OV_BEFORE); tail;)
+ for (parent = NULL, tail = current_buffer->overlays_before; tail;)
{
XSETMISC (overlay, tail);
beforep = tail;
}
if (!parent)
- buffer_set_overlays (NULL, tail->next, OV_BEFORE);
+ buffer_set_overlays_before (current_buffer, tail->next);
else
parent->next = tail->next;
tail = tail->next;
else
parent = tail, tail = parent->next;
}
- for (parent = NULL, tail = buffer_get_overlays (NULL, OV_AFTER); tail;)
+ for (parent = NULL, tail = current_buffer->overlays_after; tail;)
{
XSETMISC (overlay, tail);
beforep = tail;
}
if (!parent)
- buffer_set_overlays (NULL, tail->next, OV_AFTER);
+ buffer_set_overlays_after (current_buffer, tail->next);
else
parent->next = tail->next;
tail = tail->next;
and let the recenter function make it sane again. */
if (beforep)
{
- beforep->next = buffer_get_overlays (NULL, OV_BEFORE);
- buffer_set_overlays (NULL, before_list, OV_BEFORE);
+ beforep->next = current_buffer->overlays_before;
+ buffer_set_overlays_before (current_buffer, before_list);
}
recenter_overlay_lists (current_buffer, current_buffer->overlay_center);
if (afterp)
{
- afterp->next = buffer_get_overlays (NULL, OV_AFTER);
- buffer_set_overlays (NULL, after_list, OV_AFTER);
+ afterp->next = current_buffer->overlays_after;
+ buffer_set_overlays_after (current_buffer, after_list);
}
recenter_overlay_lists (current_buffer, current_buffer->overlay_center);
}
fix_overlays_before (struct buffer *bp, ptrdiff_t prev, ptrdiff_t pos)
{
/* If parent is nil, replace overlays_before; otherwise, parent->next. */
- struct Lisp_Overlay *tail = buffer_get_overlays (bp, OV_BEFORE);
- struct Lisp_Overlay *parent = NULL, *right_pair;
+ struct Lisp_Overlay *tail = bp->overlays_before, *parent = NULL, *right_pair;
Lisp_Object tem;
ptrdiff_t end IF_LINT (= 0);
and link it into the right place. */
if (!right_pair)
{
- found->next = buffer_get_overlays (bp, OV_BEFORE);
- buffer_set_overlays (bp, found, OV_BEFORE);
+ found->next = bp->overlays_before;
+ buffer_set_overlays_before (bp, found);
}
else
{
end = OVERLAY_END (overlay);
if (OVERLAY_POSITION (end) < b->overlay_center)
{
- if (buffer_get_overlays (b, OV_AFTER))
- XOVERLAY (overlay)->next = buffer_get_overlays (b, OV_AFTER);
- buffer_set_overlays (b, XOVERLAY (overlay), OV_AFTER);
+ if (b->overlays_after)
+ XOVERLAY (overlay)->next = b->overlays_after;
+ buffer_set_overlays_after (b, XOVERLAY (overlay));
}
else
{
- if (buffer_get_overlays (b, OV_BEFORE))
- XOVERLAY (overlay)->next = buffer_get_overlays (b, OV_BEFORE);
- buffer_set_overlays (b, XOVERLAY (overlay), OV_BEFORE);
+ if (b->overlays_before)
+ XOVERLAY (overlay)->next = b->overlays_before;
+ buffer_set_overlays_before (b, XOVERLAY (overlay));
}
/* This puts it in the right list, and in the right order. */
{
struct Lisp_Overlay *ov = XOVERLAY (overlay);
- buffer_set_overlays
- (b, unchain_overlay (buffer_get_overlays (b, OV_BEFORE), ov), OV_BEFORE);
- buffer_set_overlays
- (b, unchain_overlay (buffer_get_overlays (b, OV_AFTER), ov), OV_AFTER);
+ buffer_set_overlays_before (b, unchain_overlay (b->overlays_before, ov));
+ buffer_set_overlays_after (b, unchain_overlay (b->overlays_after, ov));
+ eassert (XOVERLAY (overlay)->next == NULL);
}
DEFUN ("move-overlay", Fmove_overlay, Smove_overlay, 3, 4, 0,
o_end = OVERLAY_POSITION (OVERLAY_END (overlay));
unchain_both (ob, overlay);
- eassert (XOVERLAY (overlay)->next == NULL);
}
/* Set the overlay boundaries, which may clip them. */
wrong list. */
if (n_end < b->overlay_center)
{
- XOVERLAY (overlay)->next = buffer_get_overlays (b, OV_AFTER);
- buffer_set_overlays (b, XOVERLAY (overlay), OV_AFTER);
+ XOVERLAY (overlay)->next = b->overlays_after;
+ buffer_set_overlays_after (b, XOVERLAY (overlay));
}
else
{
- XOVERLAY (overlay)->next = buffer_get_overlays (b, OV_BEFORE);
- buffer_set_overlays (b, XOVERLAY (overlay), OV_BEFORE);
+ XOVERLAY (overlay)->next = b->overlays_before;
+ buffer_set_overlays_before (b, XOVERLAY (overlay));
}
/* This puts it in the right list, and in the right order. */
specbind (Qinhibit_quit, Qt);
unchain_both (b, overlay);
- eassert (XOVERLAY (overlay)->next == NULL);
-
drop_overlay (b, XOVERLAY (overlay));
/* When deleting an overlay with before or after strings, turn off
struct Lisp_Overlay *ol;
Lisp_Object before = Qnil, after = Qnil, tmp;
- for (ol = buffer_get_overlays (NULL, OV_BEFORE); ol; ol = ol->next)
+ for (ol = current_buffer->overlays_before; ol; ol = ol->next)
{
XSETMISC (tmp, ol);
before = Fcons (tmp, before);
}
-
- for (ol = buffer_get_overlays (NULL, OV_AFTER); ol; ol = ol->next)
+ for (ol = current_buffer->overlays_after; ol; ol = ol->next)
{
XSETMISC (tmp, ol);
after = Fcons (tmp, after);
/* We are being called before a change.
Scan the overlays to find the functions to call. */
last_overlay_modification_hooks_used = 0;
- for (tail = buffer_get_overlays (NULL, OV_BEFORE); tail; tail = tail->next)
+ for (tail = current_buffer->overlays_before; tail; tail = tail->next)
{
ptrdiff_t startpos, endpos;
Lisp_Object ostart, oend;
}
}
- for (tail = buffer_get_overlays (NULL, OV_AFTER); tail; tail = tail->next)
+ for (tail = current_buffer->overlays_after; tail; tail = tail->next)
{
ptrdiff_t startpos, endpos;
Lisp_Object ostart, oend;
hit_list = Qnil;
if (pos <= current_buffer->overlay_center)
- for (tail = buffer_get_overlays (NULL, OV_BEFORE); tail; tail = tail->next)
+ for (tail = current_buffer->overlays_before; tail; tail = tail->next)
{
ptrdiff_t endpos;
XSETMISC (overlay, tail);
hit_list = Fcons (overlay, hit_list);
}
else
- for (tail = buffer_get_overlays (NULL, OV_AFTER); tail; tail = tail->next)
+ for (tail = current_buffer->overlays_after; tail; tail = tail->next)
{
ptrdiff_t startpos;
XSETMISC (overlay, tail);
BSET (&buffer_defaults, mark_active, Qnil);
BSET (&buffer_defaults, file_format, Qnil);
BSET (&buffer_defaults, auto_save_file_format, Qt);
- buffer_defaults.overlays_before = NULL;
- buffer_defaults.overlays_after = NULL;
+ buffer_set_overlays_before (&buffer_defaults, NULL);
+ buffer_set_overlays_after (&buffer_defaults, NULL);
buffer_defaults.overlay_center = BEG;
XSETFASTINT (BVAR (&buffer_defaults, tab_width), 8);