mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-07 04:10:27 -08:00
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.
This commit is contained in:
parent
5df1607869
commit
d7a7fda3cc
4 changed files with 38 additions and 33 deletions
15
src/buffer.c
15
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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue