diff options
| author | Dmitry Antipov | 2012-07-23 15:15:43 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2012-07-23 15:15:43 +0400 |
| commit | d7a7fda3cc130edb8bc10af96d322d263afbb44a (patch) | |
| tree | c7e8012e1b8ab313038ccd2dab1a2b39fa2c4bd6 /src/buffer.c | |
| parent | 5df1607869c5acff34382b5accf3332b1e72bc2a (diff) | |
| download | emacs-d7a7fda3cc130edb8bc10af96d322d263afbb44a.tar.gz emacs-d7a7fda3cc130edb8bc10af96d322d263afbb44a.zip | |
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.c | 15 |
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) | |||
| 433 | XMARKER (end)->insertion_type | 433 | XMARKER (end)->insertion_type |
| 434 | = XMARKER (OVERLAY_END (old_overlay))->insertion_type; | 434 | = XMARKER (OVERLAY_END (old_overlay))->insertion_type; |
| 435 | 435 | ||
| 436 | overlay = allocate_misc (); | 436 | overlay = build_overlay |
| 437 | XMISCTYPE (overlay) = Lisp_Misc_Overlay; | 437 | (start, end, Fcopy_sequence (OVERLAY_PLIST (old_overlay))); |
| 438 | OVERLAY_START (overlay) = start; | ||
| 439 | OVERLAY_END (overlay) = end; | ||
| 440 | OVERLAY_PLIST (overlay) = Fcopy_sequence (OVERLAY_PLIST (old_overlay)); | ||
| 441 | XOVERLAY (overlay)->next = NULL; | ||
| 442 | 438 | ||
| 443 | if (tail) | 439 | if (tail) |
| 444 | tail = tail->next = XOVERLAY (overlay); | 440 | tail = tail->next = XOVERLAY (overlay); |
| @@ -3640,12 +3636,7 @@ for the rear of the overlay advance when text is inserted there | |||
| 3640 | if (!NILP (rear_advance)) | 3636 | if (!NILP (rear_advance)) |
| 3641 | XMARKER (end)->insertion_type = 1; | 3637 | XMARKER (end)->insertion_type = 1; |
| 3642 | 3638 | ||
| 3643 | overlay = allocate_misc (); | 3639 | overlay = build_overlay (beg, end, Qnil); |
| 3644 | XMISCTYPE (overlay) = Lisp_Misc_Overlay; | ||
| 3645 | XOVERLAY (overlay)->start = beg; | ||
| 3646 | XOVERLAY (overlay)->end = end; | ||
| 3647 | XOVERLAY (overlay)->plist = Qnil; | ||
| 3648 | XOVERLAY (overlay)->next = NULL; | ||
| 3649 | 3640 | ||
| 3650 | /* Put the new overlay on the wrong list. */ | 3641 | /* Put the new overlay on the wrong list. */ |
| 3651 | end = OVERLAY_END (overlay); | 3642 | end = OVERLAY_END (overlay); |