summaryrefslogtreecommitdiff
path: root/src/buffer.c
diff options
context:
space:
mode:
authorDmitry Antipov <dmantipov@yandex.ru>2012-07-23 15:15:43 +0400
committerDmitry Antipov <dmantipov@yandex.ru>2012-07-23 15:15:43 +0400
commitd7a7fda3cc130edb8bc10af96d322d263afbb44a (patch)
treec7e8012e1b8ab313038ccd2dab1a2b39fa2c4bd6 /src/buffer.c
parent5df1607869c5acff34382b5accf3332b1e72bc2a (diff)
downloademacs-d7a7fda3cc130edb8bc10af96d322d263afbb44a.tar.gz
Cleanup miscellaneous objects allocation and initialization.
* alloc.c (allocate_misc): Change to static. Add argument to specify the subtype. Adjust comment and users. (build_overlay): New function. * buffer.c (copy_overlays, Fmake_overlay): Use it. * lisp.h (struct Lisp_Overlay): Remove obsolete comment. (allocate_misc): Remove prototype. (build_overlay): Add prototype.
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 68208d17abe..734ddb5a1c1 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -433,12 +433,8 @@ copy_overlays (struct buffer *b, struct Lisp_Overlay *list)
XMARKER (end)->insertion_type
= XMARKER (OVERLAY_END (old_overlay))->insertion_type;
- overlay = allocate_misc ();
- XMISCTYPE (overlay) = Lisp_Misc_Overlay;
- OVERLAY_START (overlay) = start;
- OVERLAY_END (overlay) = end;
- OVERLAY_PLIST (overlay) = Fcopy_sequence (OVERLAY_PLIST (old_overlay));
- XOVERLAY (overlay)->next = NULL;
+ overlay = build_overlay
+ (start, end, Fcopy_sequence (OVERLAY_PLIST (old_overlay)));
if (tail)
tail = tail->next = XOVERLAY (overlay);
@@ -3640,12 +3636,7 @@ for the rear of the overlay advance when text is inserted there
if (!NILP (rear_advance))
XMARKER (end)->insertion_type = 1;
- overlay = allocate_misc ();
- XMISCTYPE (overlay) = Lisp_Misc_Overlay;
- XOVERLAY (overlay)->start = beg;
- XOVERLAY (overlay)->end = end;
- XOVERLAY (overlay)->plist = Qnil;
- XOVERLAY (overlay)->next = NULL;
+ overlay = build_overlay (beg, end, Qnil);
/* Put the new overlay on the wrong list. */
end = OVERLAY_END (overlay);