diff options
| author | Andreas Politz | 2017-02-07 17:56:50 +0100 |
|---|---|---|
| committer | Andreas Politz | 2017-10-04 22:32:26 +0200 |
| commit | 8d7bdfa3fca076b34aaf86548d3243bee11872ad (patch) | |
| tree | 419c7897f336ad206bb9e99824f35819ba9796c1 | |
| parent | f204e6e1a418073bd1e24a83947f1f3c53581c7f (diff) | |
| download | emacs-8d7bdfa3fca076b34aaf86548d3243bee11872ad.tar.gz emacs-8d7bdfa3fca076b34aaf86548d3243bee11872ad.zip | |
Provide a new tree data-structure for overlays.
* src/itree.c
(interval_generator_narrow, interval_generator_next)
(interval_node_init, interval_node_begin)
(interval_node_end, interval_node_set_region)
(interval_tree_create, interval_tree_clear)
(interval_tree_init, interval_tree_destroy)
(interval_tree_size, interval_tree_insert)
(interval_tree_contains, interval_tree_remove)
(interval_tree_validate, interval_tree_iter_start)
(interval_tree_iter_finish, interval_tree_iter_next)
(interval_tree_iter_ensure_space, interval_tree_max_height)
(interval_tree_insert_gap, interval_tree_delete_gap)
(interval_generator_create, interval_generator_reset)
(interval_generator_ensure_space, interval_node_intersects)
(interval_generator_next, interval_generator_narrow)
(interval_generator_destroy, interval_stack_create)
(interval_stack_destroy, interval_stack_clear)
(interval_stack_ensure_space, interval_stack_push)
(interval_stack_push_flagged, interval_stack_pop)
(interval_tree_update_limit, interval_tree_inherit_offset)
(interval_tree_propagate_limit, interval_tree_rotate_left)
(interval_tree_rotate_right, interval_tree_insert_fix)
(interval_tree_remove_fix, interval_tree_transplant)
(interval_tree_subtree_min): New file and new functions.
* src/itree.h: New file.
* configure.ac: Create Makefile for manual overlay tests.
* src/Makefile.in: Add itree.o target.
* src/alloc.c (build_overlay, mark_overlay, mark_buffer)
(sweep_misc, sweep_buffers): Adapt to new tree data-structure.
* src/buffer.c (overlays_in, overlays_at): Remove unused arguments
prev_ptr and change_req, adapt to new data-structure and reuse
code.
(copy_overlays, drop_overlays, delete_all_overlays)
(reset_buffer, kill-buffer, buffer-swap-text, next_overlay_change)
(previous_overlay_change, mouse_face_overlay_overlaps)
(disable_line_numbers_overlay_at_eob, overlay_touches_p)
(overlay_strings, adjust_overlays_for_insert)
(adjust_overlays_for_delete, overlayp, make-overlay, move-overlay)
(delete-overlay, overlay-start, overlay-end, overlay-buffer)
(overlay-properties, overlays-at, overlays-in)
(next-overlay-change, previous-overlay-change, overlay-put)
(overlay-get, report_overlay_modification, evaporate_overlays)
(init_buffer_once): Adapt to changes and tree data-structure.
(overlay-lists, overlay-recenter): Funtions are now obsolete, but
kept anyway.
(set_buffer_overlays_before, set_buffer_overlays_after)
(recenter_overlay_lists,fix_start_end_in_overlays,fix_overlays_before)
(unchain_overlay,): Removed functions of the old list
data-structure.
(swap_buffer_overlays, make_sortvec_item): New functions.
(sort_overlays): Adapt to changes and tree data-structure.
(sortvec): Moved to buffer.h .
(make_lispy_interval_node, overlay_tree, overlay-tree)
[ITREE_DEBUG]: New debugging functions.
* src/buffer.h (overlays_before, overlays_after): Removed struct
member of the list data-structure.
(overlays): Added tree struct member.
(sortvec): Moved here from buffer.c .
(GET_OVERLAYS_AT): Adapt to changes.
(set_buffer_intervals, OVERLAY_START, OVERLAY_END, OVERLAY_PLIST):
Adapt to tree data-structure.
(OVERLAY_POSITION): Removed macro of the list data-structure.
(OVERLAY_REAR_ADVANCE_P, OVERLAY_FRONT_ADVANCE_P): New macros.
(overlay_start, overlay_end)
(set_overlay_region, maybe_alloc_buffer_overlays)
(free_buffer_overlays, add_buffer_overlay)
(remove_buffer_overlay, buffer_overlay_iter_start)
(buffer_overlay_iter_next, buffer_overlay_iter_finish)
(buffer_overlay_iter_narrow): New functions.
(compare_overlays, make_sortvec_item): Export functions.
* src/editfns.c (overlays_around): Reuse overlays_in.
(get-pos-property): Adapt to tree data-structure.
(transpose-regions): Remove call to deleted function.
* src/fileio.c: (insert-file-contents): Remove
references to deleted struct member.
* src/fns.c (internal_equal): Adapt to tree data-structure.
* src/indent.c (check_display_width): Adapt to tree
data-structure.
(skip_invisible): Remove call to deleted function.
* src/insdel.c (adjust_markers_for_insert): Remove calls to
deleted functions.
* src/intervals.c (adjust_for_invis_intang): Adapt to tree
data-structure.
* src/keyboard.c (adjust_point_for_property): Adapt to tree
data-structure.
* src/lisp.h (Lisp_Overlay): Modified struct layout.
* src/print.c (temp_output_buffer_setup, print_object): Adapt to
tree data-structure.
* src/textprop.c (get_char_property_and_overlay): Adapt to tree
data-structure. Take advantage of the new data-structure.
* src/window.h (overlay_matches_window): New function.
* src/xdisp.h (next_overlay_change): Removed function. Use
next-overlay-change, which does not use xmalloc anymore.
(handle_single_display_spec, load_overlay_strings)
(back_to_previous_visible_line_start, note_mouse_highlight): Adapt
to tree data-structure.
(move_it_to, display_line): Remove calls to deleted functions.
* src/xfaces.c (face_at_buffer_position): Adapt to changes and
tree data-structure.
* test/src/buffer-tests.el: Many tests regarding overlays added.
* test/manual/noverlay/itree-tests.c: New file with tests of the
tree data-structure on the C level.
* test/manual/noverlay/Makefile.in: New file.
* test/manual/noverlay/check-sanitize.sh: New file.
* test/manual/noverlay/emacs-compat.h: New file.
* test/manual/noverlay/.gitignore: New file.
* test/manual/noverlay/overlay-perf.el: New file providing
performance tests.
* test/manual/noverlay/many-errors.h: New file.
| -rw-r--r-- | configure.ac | 1 | ||||
| -rw-r--r-- | src/Makefile.in | 1 | ||||
| -rw-r--r-- | src/alloc.c | 49 | ||||
| -rw-r--r-- | src/buffer.c | 1458 | ||||
| -rw-r--r-- | src/buffer.h | 161 | ||||
| -rw-r--r-- | src/editfns.c | 56 | ||||
| -rw-r--r-- | src/fileio.c | 3 | ||||
| -rw-r--r-- | src/fns.c | 7 | ||||
| -rw-r--r-- | src/indent.c | 5 | ||||
| -rw-r--r-- | src/insdel.c | 12 | ||||
| -rw-r--r-- | src/intervals.c | 4 | ||||
| -rw-r--r-- | src/itree.c | 1138 | ||||
| -rw-r--r-- | src/itree.h | 88 | ||||
| -rw-r--r-- | src/keyboard.c | 4 | ||||
| -rw-r--r-- | src/lisp.h | 19 | ||||
| -rw-r--r-- | src/print.c | 12 | ||||
| -rw-r--r-- | src/textprop.c | 52 | ||||
| -rw-r--r-- | src/window.h | 10 | ||||
| -rw-r--r-- | src/xdisp.c | 167 | ||||
| -rw-r--r-- | src/xfaces.c | 17 | ||||
| -rw-r--r-- | test/manual/noverlay/.gitignore | 1 | ||||
| -rw-r--r-- | test/manual/noverlay/Makefile.in | 32 | ||||
| -rwxr-xr-x | test/manual/noverlay/check-sanitize.sh | 11 | ||||
| -rw-r--r-- | test/manual/noverlay/emacs-compat.h | 52 | ||||
| -rw-r--r-- | test/manual/noverlay/itree-tests.c | 1381 | ||||
| -rw-r--r-- | test/manual/noverlay/many-errors.py | 2480 | ||||
| -rw-r--r-- | test/manual/noverlay/overlay-perf.el | 764 | ||||
| -rw-r--r-- | test/src/buffer-tests.el | 7519 |
28 files changed, 14157 insertions, 1347 deletions
diff --git a/configure.ac b/configure.ac index eba95e2fb84..76cf5570b52 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -5495,6 +5495,7 @@ if test -f "$srcdir/$opt_makefile.in"; then | |||
| 5495 | dnl Again, it's best not to use a variable. Though you can add | 5495 | dnl Again, it's best not to use a variable. Though you can add |
| 5496 | dnl ", [], [opt_makefile='$opt_makefile']" and it should work. | 5496 | dnl ", [], [opt_makefile='$opt_makefile']" and it should work. |
| 5497 | AC_CONFIG_FILES([test/Makefile]) | 5497 | AC_CONFIG_FILES([test/Makefile]) |
| 5498 | AC_CONFIG_FILES([test/manual/noverlay/Makefile]) | ||
| 5498 | fi | 5499 | fi |
| 5499 | 5500 | ||
| 5500 | 5501 | ||
diff --git a/src/Makefile.in b/src/Makefile.in index 9a8c9c85f04..8a8df03e49f 100644 --- a/src/Makefile.in +++ b/src/Makefile.in | |||
| @@ -395,6 +395,7 @@ base_obj = dispnew.o frame.o scroll.o xdisp.o menu.o $(XMENU_OBJ) window.o \ | |||
| 395 | $(XWIDGETS_OBJ) \ | 395 | $(XWIDGETS_OBJ) \ |
| 396 | profiler.o decompress.o \ | 396 | profiler.o decompress.o \ |
| 397 | thread.o systhread.o \ | 397 | thread.o systhread.o \ |
| 398 | itree.o \ | ||
| 398 | $(if $(HYBRID_MALLOC),sheap.o) \ | 399 | $(if $(HYBRID_MALLOC),sheap.o) \ |
| 399 | $(MSDOS_OBJ) $(MSDOS_X_OBJ) $(NS_OBJ) $(CYGWIN_OBJ) $(FONT_OBJ) \ | 400 | $(MSDOS_OBJ) $(MSDOS_X_OBJ) $(NS_OBJ) $(CYGWIN_OBJ) $(FONT_OBJ) \ |
| 400 | $(W32_OBJ) $(WINDOW_SYSTEM_OBJ) $(XGSELOBJ) | 401 | $(W32_OBJ) $(WINDOW_SYSTEM_OBJ) $(XGSELOBJ) |
diff --git a/src/alloc.c b/src/alloc.c index 2e6399e7f8d..15a6fc43b72 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -43,6 +43,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ | |||
| 43 | #include "frame.h" | 43 | #include "frame.h" |
| 44 | #include "blockinput.h" | 44 | #include "blockinput.h" |
| 45 | #include "termhooks.h" /* For struct terminal. */ | 45 | #include "termhooks.h" /* For struct terminal. */ |
| 46 | #include "itree.h" | ||
| 46 | #ifdef HAVE_WINDOW_SYSTEM | 47 | #ifdef HAVE_WINDOW_SYSTEM |
| 47 | #include TERM_HEADER | 48 | #include TERM_HEADER |
| 48 | #endif /* HAVE_WINDOW_SYSTEM */ | 49 | #endif /* HAVE_WINDOW_SYSTEM */ |
| @@ -3835,16 +3836,19 @@ free_save_value (Lisp_Object save) | |||
| 3835 | /* Return a Lisp_Misc_Overlay object with specified START, END and PLIST. */ | 3836 | /* Return a Lisp_Misc_Overlay object with specified START, END and PLIST. */ |
| 3836 | 3837 | ||
| 3837 | Lisp_Object | 3838 | Lisp_Object |
| 3838 | build_overlay (Lisp_Object start, Lisp_Object end, Lisp_Object plist) | 3839 | build_overlay (ptrdiff_t begin, ptrdiff_t end, |
| 3840 | bool front_advance, bool rear_advance, | ||
| 3841 | Lisp_Object plist) | ||
| 3839 | { | 3842 | { |
| 3840 | register Lisp_Object overlay; | 3843 | Lisp_Object ov = allocate_misc (Lisp_Misc_Overlay); |
| 3844 | struct interval_node *node = xmalloc (sizeof (*node)); | ||
| 3841 | 3845 | ||
| 3842 | overlay = allocate_misc (Lisp_Misc_Overlay); | 3846 | interval_node_init (node, begin, end, front_advance, |
| 3843 | OVERLAY_START (overlay) = start; | 3847 | rear_advance, ov); |
| 3844 | OVERLAY_END (overlay) = end; | 3848 | XOVERLAY (ov)->interval = node; |
| 3845 | set_overlay_plist (overlay, plist); | 3849 | XOVERLAY (ov)->buffer = NULL; |
| 3846 | XOVERLAY (overlay)->next = NULL; | 3850 | set_overlay_plist (ov, plist); |
| 3847 | return overlay; | 3851 | return ov; |
| 3848 | } | 3852 | } |
| 3849 | 3853 | ||
| 3850 | DEFUN ("make-marker", Fmake_marker, Smake_marker, 0, 0, 0, | 3854 | DEFUN ("make-marker", Fmake_marker, Smake_marker, 0, 0, 0, |
| @@ -6280,16 +6284,10 @@ mark_compiled (struct Lisp_Vector *ptr) | |||
| 6280 | /* Mark the chain of overlays starting at PTR. */ | 6284 | /* Mark the chain of overlays starting at PTR. */ |
| 6281 | 6285 | ||
| 6282 | static void | 6286 | static void |
| 6283 | mark_overlay (struct Lisp_Overlay *ptr) | 6287 | mark_overlay (struct Lisp_Overlay *ov) |
| 6284 | { | 6288 | { |
| 6285 | for (; ptr && !ptr->gcmarkbit; ptr = ptr->next) | 6289 | ov->gcmarkbit = 1; |
| 6286 | { | 6290 | mark_object (ov->plist); |
| 6287 | ptr->gcmarkbit = 1; | ||
| 6288 | /* These two are always markers and can be marked fast. */ | ||
| 6289 | XMARKER (ptr->start)->gcmarkbit = 1; | ||
| 6290 | XMARKER (ptr->end)->gcmarkbit = 1; | ||
| 6291 | mark_object (ptr->plist); | ||
| 6292 | } | ||
| 6293 | } | 6291 | } |
| 6294 | 6292 | ||
| 6295 | /* Mark Lisp_Objects and special pointers in BUFFER. */ | 6293 | /* Mark Lisp_Objects and special pointers in BUFFER. */ |
| @@ -6308,8 +6306,15 @@ mark_buffer (struct buffer *buffer) | |||
| 6308 | a special way just before the sweep phase, and after stripping | 6306 | a special way just before the sweep phase, and after stripping |
| 6309 | some of its elements that are not needed any more. */ | 6307 | some of its elements that are not needed any more. */ |
| 6310 | 6308 | ||
| 6311 | mark_overlay (buffer->overlays_before); | 6309 | if (buffer->overlays) |
| 6312 | mark_overlay (buffer->overlays_after); | 6310 | { |
| 6311 | struct interval_node *node; | ||
| 6312 | buffer_overlay_iter_start (buffer, PTRDIFF_MIN, PTRDIFF_MAX, ITREE_ASCENDING); | ||
| 6313 | |||
| 6314 | while ((node = buffer_overlay_iter_next (buffer))) | ||
| 6315 | mark_overlay (XOVERLAY (node->data)); | ||
| 6316 | buffer_overlay_iter_finish (buffer); | ||
| 6317 | } | ||
| 6313 | 6318 | ||
| 6314 | /* If this is an indirect buffer, mark its base buffer. */ | 6319 | /* If this is an indirect buffer, mark its base buffer. */ |
| 6315 | if (buffer->base_buffer && !VECTOR_MARKED_P (buffer->base_buffer)) | 6320 | if (buffer->base_buffer && !VECTOR_MARKED_P (buffer->base_buffer)) |
| @@ -7090,6 +7095,11 @@ sweep_misc (void) | |||
| 7090 | unchain_marker (&mblk->markers[i].m.u_marker); | 7095 | unchain_marker (&mblk->markers[i].m.u_marker); |
| 7091 | else if (mblk->markers[i].m.u_any.type == Lisp_Misc_Finalizer) | 7096 | else if (mblk->markers[i].m.u_any.type == Lisp_Misc_Finalizer) |
| 7092 | unchain_finalizer (&mblk->markers[i].m.u_finalizer); | 7097 | unchain_finalizer (&mblk->markers[i].m.u_finalizer); |
| 7098 | else if (mblk->markers[i].m.u_any.type == Lisp_Misc_Overlay) | ||
| 7099 | { | ||
| 7100 | xfree (mblk->markers[i].m.u_overlay.interval); | ||
| 7101 | mblk->markers[i].m.u_overlay.interval = NULL; | ||
| 7102 | } | ||
| 7093 | #ifdef HAVE_MODULES | 7103 | #ifdef HAVE_MODULES |
| 7094 | else if (mblk->markers[i].m.u_any.type == Lisp_Misc_User_Ptr) | 7104 | else if (mblk->markers[i].m.u_any.type == Lisp_Misc_User_Ptr) |
| 7095 | { | 7105 | { |
| @@ -7145,6 +7155,7 @@ sweep_buffers (void) | |||
| 7145 | if (!VECTOR_MARKED_P (buffer)) | 7155 | if (!VECTOR_MARKED_P (buffer)) |
| 7146 | { | 7156 | { |
| 7147 | *bprev = buffer->next; | 7157 | *bprev = buffer->next; |
| 7158 | free_buffer_overlays (buffer); | ||
| 7148 | lisp_free (buffer); | 7159 | lisp_free (buffer); |
| 7149 | } | 7160 | } |
| 7150 | else | 7161 | else |
diff --git a/src/buffer.c b/src/buffer.c index 76670b89545..21c040ad0e1 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -44,6 +44,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ | |||
| 44 | #include "keymap.h" | 44 | #include "keymap.h" |
| 45 | #include "frame.h" | 45 | #include "frame.h" |
| 46 | #include "xwidget.h" | 46 | #include "xwidget.h" |
| 47 | #include "itree.h" | ||
| 47 | 48 | ||
| 48 | #ifdef WINDOWSNT | 49 | #ifdef WINDOWSNT |
| 49 | #include "w32heap.h" /* for mmap_* */ | 50 | #include "w32heap.h" /* for mmap_* */ |
| @@ -120,7 +121,7 @@ static Lisp_Object QSFundamental; /* A string "Fundamental". */ | |||
| 120 | 121 | ||
| 121 | static void alloc_buffer_text (struct buffer *, ptrdiff_t); | 122 | static void alloc_buffer_text (struct buffer *, ptrdiff_t); |
| 122 | static void free_buffer_text (struct buffer *b); | 123 | static void free_buffer_text (struct buffer *b); |
| 123 | static struct Lisp_Overlay * copy_overlays (struct buffer *, struct Lisp_Overlay *); | 124 | static void copy_overlays (struct buffer *, struct buffer *); |
| 124 | static void modify_overlay (struct buffer *, ptrdiff_t, ptrdiff_t); | 125 | static void modify_overlay (struct buffer *, ptrdiff_t, ptrdiff_t); |
| 125 | static Lisp_Object buffer_lisp_local_variables (struct buffer *, bool); | 126 | static Lisp_Object buffer_lisp_local_variables (struct buffer *, bool); |
| 126 | 127 | ||
| @@ -600,51 +601,30 @@ even if it is dead. The return value is never nil. */) | |||
| 600 | } | 601 | } |
| 601 | 602 | ||
| 602 | 603 | ||
| 603 | /* Return a list of overlays which is a copy of the overlay list | 604 | /* Copy overlays of buffer FROM to buffer TO. */ |
| 604 | LIST, but for buffer B. */ | ||
| 605 | 605 | ||
| 606 | static struct Lisp_Overlay * | 606 | static void |
| 607 | copy_overlays (struct buffer *b, struct Lisp_Overlay *list) | 607 | copy_overlays (struct buffer *from, struct buffer *to) |
| 608 | { | 608 | { |
| 609 | struct Lisp_Overlay *result = NULL, *tail = NULL; | 609 | eassert (to && ! to->overlays); |
| 610 | 610 | ||
| 611 | for (; list; list = list->next) | 611 | struct interval_node *node; |
| 612 | { | ||
| 613 | Lisp_Object overlay, start, end; | ||
| 614 | struct Lisp_Marker *m; | ||
| 615 | |||
| 616 | eassert (MARKERP (list->start)); | ||
| 617 | m = XMARKER (list->start); | ||
| 618 | start = build_marker (b, m->charpos, m->bytepos); | ||
| 619 | XMARKER (start)->insertion_type = m->insertion_type; | ||
| 620 | |||
| 621 | eassert (MARKERP (list->end)); | ||
| 622 | m = XMARKER (list->end); | ||
| 623 | end = build_marker (b, m->charpos, m->bytepos); | ||
| 624 | XMARKER (end)->insertion_type = m->insertion_type; | ||
| 625 | |||
| 626 | overlay = build_overlay (start, end, Fcopy_sequence (list->plist)); | ||
| 627 | if (tail) | ||
| 628 | tail = tail->next = XOVERLAY (overlay); | ||
| 629 | else | ||
| 630 | result = tail = XOVERLAY (overlay); | ||
| 631 | } | ||
| 632 | |||
| 633 | return result; | ||
| 634 | } | ||
| 635 | 612 | ||
| 636 | /* Set an appropriate overlay of B. */ | 613 | if (! from->overlays) |
| 614 | return; | ||
| 637 | 615 | ||
| 638 | static void | 616 | buffer_overlay_iter_start (from, PTRDIFF_MIN, PTRDIFF_MAX, ITREE_ASCENDING); |
| 639 | set_buffer_overlays_before (struct buffer *b, struct Lisp_Overlay *o) | ||
| 640 | { | ||
| 641 | b->overlays_before = o; | ||
| 642 | } | ||
| 643 | 617 | ||
| 644 | static void | 618 | while ((node = buffer_overlay_iter_next (from))) |
| 645 | set_buffer_overlays_after (struct buffer *b, struct Lisp_Overlay *o) | 619 | { |
| 646 | { | 620 | Lisp_Object ov = node->data; |
| 647 | b->overlays_after = o; | 621 | Lisp_Object copy = build_overlay (node->begin, node->end, |
| 622 | node->front_advance, | ||
| 623 | node->rear_advance, | ||
| 624 | Fcopy_sequence (OVERLAY_PLIST (ov))); | ||
| 625 | add_buffer_overlay (to, XOVERLAY (copy)); | ||
| 626 | } | ||
| 627 | buffer_overlay_iter_finish (from); | ||
| 648 | } | 628 | } |
| 649 | 629 | ||
| 650 | /* Clone per-buffer values of buffer FROM. | 630 | /* Clone per-buffer values of buffer FROM. |
| @@ -681,8 +661,7 @@ clone_per_buffer_values (struct buffer *from, struct buffer *to) | |||
| 681 | 661 | ||
| 682 | memcpy (to->local_flags, from->local_flags, sizeof to->local_flags); | 662 | memcpy (to->local_flags, from->local_flags, sizeof to->local_flags); |
| 683 | 663 | ||
| 684 | set_buffer_overlays_before (to, copy_overlays (to, from->overlays_before)); | 664 | copy_overlays (from, to); |
| 685 | set_buffer_overlays_after (to, copy_overlays (to, from->overlays_after)); | ||
| 686 | 665 | ||
| 687 | /* Get (a copy of) the alist of Lisp-level local variables of FROM | 666 | /* Get (a copy of) the alist of Lisp-level local variables of FROM |
| 688 | and install that in TO. */ | 667 | and install that in TO. */ |
| @@ -867,17 +846,16 @@ CLONE nil means the indirect buffer's state is reset to default values. */) | |||
| 867 | return buf; | 846 | return buf; |
| 868 | } | 847 | } |
| 869 | 848 | ||
| 870 | /* Mark OV as no longer associated with B. */ | 849 | /* Mark OV as no longer associated with its buffer. */ |
| 871 | 850 | ||
| 872 | static void | 851 | static void |
| 873 | drop_overlay (struct buffer *b, struct Lisp_Overlay *ov) | 852 | drop_overlay (struct Lisp_Overlay *ov) |
| 874 | { | 853 | { |
| 875 | eassert (b == XBUFFER (Fmarker_buffer (ov->start))); | 854 | if (! ov->buffer) |
| 876 | modify_overlay (b, marker_position (ov->start), | 855 | return; |
| 877 | marker_position (ov->end)); | ||
| 878 | unchain_marker (XMARKER (ov->start)); | ||
| 879 | unchain_marker (XMARKER (ov->end)); | ||
| 880 | 856 | ||
| 857 | modify_overlay (ov->buffer, overlay_start (ov), overlay_end (ov)); | ||
| 858 | remove_buffer_overlay (ov->buffer, ov); | ||
| 881 | } | 859 | } |
| 882 | 860 | ||
| 883 | /* Delete all overlays of B and reset its overlay lists. */ | 861 | /* Delete all overlays of B and reset its overlay lists. */ |
| @@ -885,26 +863,20 @@ drop_overlay (struct buffer *b, struct Lisp_Overlay *ov) | |||
| 885 | void | 863 | void |
| 886 | delete_all_overlays (struct buffer *b) | 864 | delete_all_overlays (struct buffer *b) |
| 887 | { | 865 | { |
| 888 | struct Lisp_Overlay *ov, *next; | 866 | struct interval_node *node; |
| 889 | 867 | ||
| 890 | /* FIXME: Since each drop_overlay will scan BUF_MARKERS to unlink its | 868 | if (! b->overlays) |
| 891 | markers, we have an unneeded O(N^2) behavior here. */ | 869 | return; |
| 892 | for (ov = b->overlays_before; ov; ov = next) | ||
| 893 | { | ||
| 894 | drop_overlay (b, ov); | ||
| 895 | next = ov->next; | ||
| 896 | ov->next = NULL; | ||
| 897 | } | ||
| 898 | 870 | ||
| 899 | for (ov = b->overlays_after; ov; ov = next) | 871 | buffer_overlay_iter_start (b, PTRDIFF_MIN, PTRDIFF_MAX, ITREE_ASCENDING); |
| 872 | while ((node = buffer_overlay_iter_next (b))) | ||
| 900 | { | 873 | { |
| 901 | drop_overlay (b, ov); | 874 | modify_overlay (b, node->begin, node->end); |
| 902 | next = ov->next; | 875 | /* Where are the nodes freed ? --ap */ |
| 903 | ov->next = NULL; | 876 | XOVERLAY (node->data)->buffer = NULL; |
| 904 | } | 877 | } |
| 905 | 878 | buffer_overlay_iter_finish (b); | |
| 906 | set_buffer_overlays_before (b, NULL); | 879 | interval_tree_clear (b->overlays); |
| 907 | set_buffer_overlays_after (b, NULL); | ||
| 908 | } | 880 | } |
| 909 | 881 | ||
| 910 | /* Reinitialize everything about a buffer except its name and contents | 882 | /* Reinitialize everything about a buffer except its name and contents |
| @@ -932,9 +904,7 @@ reset_buffer (register struct buffer *b) | |||
| 932 | b->auto_save_failure_time = 0; | 904 | b->auto_save_failure_time = 0; |
| 933 | bset_auto_save_file_name (b, Qnil); | 905 | bset_auto_save_file_name (b, Qnil); |
| 934 | bset_read_only (b, Qnil); | 906 | bset_read_only (b, Qnil); |
| 935 | set_buffer_overlays_before (b, NULL); | 907 | b->overlays = NULL; |
| 936 | set_buffer_overlays_after (b, NULL); | ||
| 937 | b->overlay_center = BEG; | ||
| 938 | bset_mark_active (b, Qnil); | 908 | bset_mark_active (b, Qnil); |
| 939 | bset_point_before_scroll (b, Qnil); | 909 | bset_point_before_scroll (b, Qnil); |
| 940 | bset_file_format (b, Qnil); | 910 | bset_file_format (b, Qnil); |
| @@ -1843,10 +1813,8 @@ cleaning up all windows currently displaying the buffer to be killed. */) | |||
| 1843 | 1813 | ||
| 1844 | /* Perhaps we should explicitly free the interval tree here... */ | 1814 | /* Perhaps we should explicitly free the interval tree here... */ |
| 1845 | } | 1815 | } |
| 1846 | /* Since we've unlinked the markers, the overlays can't be here any more | 1816 | delete_all_overlays (b); |
| 1847 | either. */ | 1817 | free_buffer_overlays (b); |
| 1848 | b->overlays_before = NULL; | ||
| 1849 | b->overlays_after = NULL; | ||
| 1850 | 1818 | ||
| 1851 | /* Reset the local variables, so that this buffer's local values | 1819 | /* Reset the local variables, so that this buffer's local values |
| 1852 | won't be protected from GC. They would be protected | 1820 | won't be protected from GC. They would be protected |
| @@ -2254,6 +2222,31 @@ advance_to_char_boundary (ptrdiff_t byte_pos) | |||
| 2254 | return byte_pos; | 2222 | return byte_pos; |
| 2255 | } | 2223 | } |
| 2256 | 2224 | ||
| 2225 | static void | ||
| 2226 | swap_buffer_overlays (struct buffer *buffer, struct buffer *other) | ||
| 2227 | { | ||
| 2228 | struct interval_node *node; | ||
| 2229 | |||
| 2230 | if (buffer->overlays) | ||
| 2231 | { | ||
| 2232 | buffer_overlay_iter_start (buffer, PTRDIFF_MIN, PTRDIFF_MAX, ITREE_ASCENDING); | ||
| 2233 | while ((node = buffer_overlay_iter_next (buffer))) | ||
| 2234 | XOVERLAY (node->data)->buffer = other; | ||
| 2235 | buffer_overlay_iter_finish (buffer); | ||
| 2236 | } | ||
| 2237 | if (other->overlays) | ||
| 2238 | { | ||
| 2239 | buffer_overlay_iter_start (other, PTRDIFF_MIN, PTRDIFF_MAX, ITREE_ASCENDING); | ||
| 2240 | while ((node = buffer_overlay_iter_next (other))) | ||
| 2241 | XOVERLAY (node->data)->buffer = buffer; | ||
| 2242 | buffer_overlay_iter_finish (other); | ||
| 2243 | } | ||
| 2244 | /* Swap the interval trees. */ | ||
| 2245 | void *tmp = buffer->overlays; | ||
| 2246 | buffer->overlays = other->overlays; | ||
| 2247 | other->overlays = tmp; | ||
| 2248 | } | ||
| 2249 | |||
| 2257 | DEFUN ("buffer-swap-text", Fbuffer_swap_text, Sbuffer_swap_text, | 2250 | DEFUN ("buffer-swap-text", Fbuffer_swap_text, Sbuffer_swap_text, |
| 2258 | 1, 1, 0, | 2251 | 1, 1, 0, |
| 2259 | doc: /* Swap the text between current buffer and BUFFER. | 2252 | doc: /* Swap the text between current buffer and BUFFER. |
| @@ -2324,9 +2317,6 @@ results, see Info node `(elisp)Swapping Text'. */) | |||
| 2324 | swapfield (bidi_paragraph_cache, struct region_cache *); | 2317 | swapfield (bidi_paragraph_cache, struct region_cache *); |
| 2325 | current_buffer->prevent_redisplay_optimizations_p = 1; | 2318 | current_buffer->prevent_redisplay_optimizations_p = 1; |
| 2326 | other_buffer->prevent_redisplay_optimizations_p = 1; | 2319 | other_buffer->prevent_redisplay_optimizations_p = 1; |
| 2327 | swapfield (overlays_before, struct Lisp_Overlay *); | ||
| 2328 | swapfield (overlays_after, struct Lisp_Overlay *); | ||
| 2329 | swapfield (overlay_center, ptrdiff_t); | ||
| 2330 | swapfield_ (undo_list, Lisp_Object); | 2320 | swapfield_ (undo_list, Lisp_Object); |
| 2331 | swapfield_ (mark, Lisp_Object); | 2321 | swapfield_ (mark, Lisp_Object); |
| 2332 | swapfield_ (enable_multibyte_characters, Lisp_Object); | 2322 | swapfield_ (enable_multibyte_characters, Lisp_Object); |
| @@ -2349,6 +2339,7 @@ results, see Info node `(elisp)Swapping Text'. */) | |||
| 2349 | current_buffer->text->end_unchanged = current_buffer->text->gpt; | 2339 | current_buffer->text->end_unchanged = current_buffer->text->gpt; |
| 2350 | other_buffer->text->beg_unchanged = other_buffer->text->gpt; | 2340 | other_buffer->text->beg_unchanged = other_buffer->text->gpt; |
| 2351 | other_buffer->text->end_unchanged = other_buffer->text->gpt; | 2341 | other_buffer->text->end_unchanged = other_buffer->text->gpt; |
| 2342 | swap_buffer_overlays (current_buffer, other_buffer); | ||
| 2352 | { | 2343 | { |
| 2353 | struct Lisp_Marker *m; | 2344 | struct Lisp_Marker *m; |
| 2354 | for (m = BUF_MARKERS (current_buffer); m; m = m->next) | 2345 | for (m = BUF_MARKERS (current_buffer); m; m = m->next) |
| @@ -2763,285 +2754,160 @@ swap_out_buffer_local_variables (struct buffer *b) | |||
| 2763 | } | 2754 | } |
| 2764 | } | 2755 | } |
| 2765 | } | 2756 | } |
| 2757 | |||
| 2766 | 2758 | ||
| 2767 | /* Find all the overlays in the current buffer that contain position POS. | 2759 | /* Find all the overlays in the current buffer that overlap the range |
| 2760 | [BEG, END). | ||
| 2761 | |||
| 2762 | If EMPTY is true, include empty overlays in that range and also at | ||
| 2763 | END, provided END denotes the position at the end of the buffer. | ||
| 2764 | |||
| 2768 | Return the number found, and store them in a vector in *VEC_PTR. | 2765 | Return the number found, and store them in a vector in *VEC_PTR. |
| 2769 | Store in *LEN_PTR the size allocated for the vector. | 2766 | Store in *LEN_PTR the size allocated for the vector. |
| 2770 | Store in *NEXT_PTR the next position after POS where an overlay starts, | 2767 | Store in *NEXT_PTR the next position after POS where an overlay starts, |
| 2771 | or ZV if there are no more overlays between POS and ZV. | 2768 | or ZV if there are no more overlays. |
| 2772 | Store in *PREV_PTR the previous position before POS where an overlay ends, | 2769 | NEXT_PTR may be 0, meaning don't store that info. |
| 2773 | or where an overlay starts which ends at or after POS; | ||
| 2774 | or BEGV if there are no such overlays from BEGV to POS. | ||
| 2775 | NEXT_PTR and/or PREV_PTR may be 0, meaning don't store that info. | ||
| 2776 | 2770 | ||
| 2777 | *VEC_PTR and *LEN_PTR should contain a valid vector and size | 2771 | *VEC_PTR and *LEN_PTR should contain a valid vector and size |
| 2778 | when this function is called. | 2772 | when this function is called. |
| 2779 | 2773 | ||
| 2780 | If EXTEND, make the vector bigger if necessary. | 2774 | If EXTEND, make the vector bigger if necessary. If not, never |
| 2781 | If not, never extend the vector, | 2775 | extend the vector, and store only as many overlays as will fit. |
| 2782 | and store only as many overlays as will fit. | ||
| 2783 | But still return the total number of overlays. | 2776 | But still return the total number of overlays. |
| 2784 | 2777 | */ | |
| 2785 | If CHANGE_REQ, any position written into *PREV_PTR or | ||
| 2786 | *NEXT_PTR is guaranteed to be not equal to POS, unless it is the | ||
| 2787 | default (BEGV or ZV). */ | ||
| 2788 | 2778 | ||
| 2789 | ptrdiff_t | 2779 | ptrdiff_t |
| 2790 | overlays_at (EMACS_INT pos, bool extend, Lisp_Object **vec_ptr, | 2780 | overlays_in (ptrdiff_t beg, ptrdiff_t end, bool extend, |
| 2791 | ptrdiff_t *len_ptr, | 2781 | Lisp_Object **vec_ptr, ptrdiff_t *len_ptr, bool empty, |
| 2792 | ptrdiff_t *next_ptr, ptrdiff_t *prev_ptr, bool change_req) | 2782 | ptrdiff_t *next_ptr) |
| 2793 | { | 2783 | { |
| 2794 | Lisp_Object overlay, start, end; | ||
| 2795 | struct Lisp_Overlay *tail; | ||
| 2796 | ptrdiff_t idx = 0; | 2784 | ptrdiff_t idx = 0; |
| 2797 | ptrdiff_t len = *len_ptr; | 2785 | ptrdiff_t len = *len_ptr; |
| 2798 | Lisp_Object *vec = *vec_ptr; | ||
| 2799 | ptrdiff_t next = ZV; | 2786 | ptrdiff_t next = ZV; |
| 2800 | ptrdiff_t prev = BEGV; | 2787 | Lisp_Object *vec = *vec_ptr; |
| 2801 | bool inhibit_storing = 0; | ||
| 2802 | |||
| 2803 | for (tail = current_buffer->overlays_before; tail; tail = tail->next) | ||
| 2804 | { | ||
| 2805 | ptrdiff_t startpos, endpos; | ||
| 2806 | 2788 | ||
| 2807 | XSETMISC (overlay, tail); | 2789 | struct interval_node *node; |
| 2808 | 2790 | ||
| 2809 | start = OVERLAY_START (overlay); | 2791 | if (! current_buffer->overlays) |
| 2810 | end = OVERLAY_END (overlay); | 2792 | return idx; |
| 2811 | endpos = OVERLAY_POSITION (end); | ||
| 2812 | if (endpos < pos) | ||
| 2813 | { | ||
| 2814 | if (prev < endpos) | ||
| 2815 | prev = endpos; | ||
| 2816 | break; | ||
| 2817 | } | ||
| 2818 | startpos = OVERLAY_POSITION (start); | ||
| 2819 | /* This one ends at or after POS | ||
| 2820 | so its start counts for PREV_PTR if it's before POS. */ | ||
| 2821 | if (prev < startpos && startpos < pos) | ||
| 2822 | prev = startpos; | ||
| 2823 | if (endpos == pos) | ||
| 2824 | continue; | ||
| 2825 | if (startpos <= pos) | ||
| 2826 | { | ||
| 2827 | if (idx == len) | ||
| 2828 | { | ||
| 2829 | /* The supplied vector is full. | ||
| 2830 | Either make it bigger, or don't store any more in it. */ | ||
| 2831 | if (extend) | ||
| 2832 | { | ||
| 2833 | vec = xpalloc (vec, len_ptr, 1, OVERLAY_COUNT_MAX, | ||
| 2834 | sizeof *vec); | ||
| 2835 | *vec_ptr = vec; | ||
| 2836 | len = *len_ptr; | ||
| 2837 | } | ||
| 2838 | else | ||
| 2839 | inhibit_storing = 1; | ||
| 2840 | } | ||
| 2841 | 2793 | ||
| 2842 | if (!inhibit_storing) | 2794 | buffer_overlay_iter_start (current_buffer, beg, |
| 2843 | vec[idx] = overlay; | 2795 | /* Find empty OV at Z ? */ |
| 2844 | /* Keep counting overlays even if we can't return them all. */ | 2796 | (end >= Z && empty) ? Z + 1 : ZV, |
| 2845 | idx++; | 2797 | ITREE_ASCENDING); |
| 2846 | } | ||
| 2847 | else if (startpos < next) | ||
| 2848 | next = startpos; | ||
| 2849 | } | ||
| 2850 | 2798 | ||
| 2851 | for (tail = current_buffer->overlays_after; tail; tail = tail->next) | 2799 | while ((node = buffer_overlay_iter_next (current_buffer))) |
| 2852 | { | 2800 | { |
| 2853 | ptrdiff_t startpos, endpos; | 2801 | if (node->begin > end) |
| 2854 | 2802 | { | |
| 2855 | XSETMISC (overlay, tail); | 2803 | next = min (next, node->begin); |
| 2856 | 2804 | break; | |
| 2857 | start = OVERLAY_START (overlay); | 2805 | } |
| 2858 | end = OVERLAY_END (overlay); | 2806 | else if (node->begin == end) |
| 2859 | startpos = OVERLAY_POSITION (start); | 2807 | { |
| 2860 | if (pos < startpos) | 2808 | next = node->begin; |
| 2861 | { | 2809 | if ((! empty || end < Z) && beg < end) |
| 2862 | if (startpos < next) | 2810 | break; |
| 2863 | next = startpos; | 2811 | } |
| 2864 | break; | ||
| 2865 | } | ||
| 2866 | endpos = OVERLAY_POSITION (end); | ||
| 2867 | if (pos < endpos) | ||
| 2868 | { | ||
| 2869 | if (idx == len) | ||
| 2870 | { | ||
| 2871 | if (extend) | ||
| 2872 | { | ||
| 2873 | vec = xpalloc (vec, len_ptr, 1, OVERLAY_COUNT_MAX, | ||
| 2874 | sizeof *vec); | ||
| 2875 | *vec_ptr = vec; | ||
| 2876 | len = *len_ptr; | ||
| 2877 | } | ||
| 2878 | else | ||
| 2879 | inhibit_storing = 1; | ||
| 2880 | } | ||
| 2881 | 2812 | ||
| 2882 | if (!inhibit_storing) | 2813 | if (! empty && node->begin == node->end) |
| 2883 | vec[idx] = overlay; | 2814 | continue; |
| 2884 | idx++; | ||
| 2885 | 2815 | ||
| 2886 | if (startpos < pos && startpos > prev) | 2816 | if (extend && idx == len) |
| 2887 | prev = startpos; | 2817 | { |
| 2888 | } | 2818 | vec = xpalloc (vec, len_ptr, 1, OVERLAY_COUNT_MAX, |
| 2889 | else if (endpos < pos && endpos > prev) | 2819 | sizeof *vec); |
| 2890 | prev = endpos; | 2820 | *vec_ptr = vec; |
| 2891 | else if (endpos == pos && startpos > prev | 2821 | len = *len_ptr; |
| 2892 | && (!change_req || startpos < pos)) | 2822 | } |
| 2893 | prev = startpos; | 2823 | if (idx < len) |
| 2824 | vec[idx] = node->data; | ||
| 2825 | /* Keep counting overlays even if we can't return them all. */ | ||
| 2826 | idx++; | ||
| 2894 | } | 2827 | } |
| 2895 | 2828 | buffer_overlay_iter_finish (current_buffer); | |
| 2896 | if (next_ptr) | 2829 | if (next_ptr) |
| 2897 | *next_ptr = next; | 2830 | *next_ptr = next ? next : ZV; |
| 2898 | if (prev_ptr) | 2831 | |
| 2899 | *prev_ptr = prev; | ||
| 2900 | return idx; | 2832 | return idx; |
| 2901 | } | 2833 | } |
| 2902 | |||
| 2903 | /* Find all the overlays in the current buffer that overlap the range | ||
| 2904 | BEG-END, or are empty at BEG, or are empty at END provided END | ||
| 2905 | denotes the position at the end of the current buffer. | ||
| 2906 | 2834 | ||
| 2907 | Return the number found, and store them in a vector in *VEC_PTR. | 2835 | /* Find all non-empty overlays in the current buffer that contain |
| 2908 | Store in *LEN_PTR the size allocated for the vector. | 2836 | position POS. |
| 2909 | Store in *NEXT_PTR the next position after POS where an overlay starts, | ||
| 2910 | or ZV if there are no more overlays. | ||
| 2911 | Store in *PREV_PTR the previous position before POS where an overlay ends, | ||
| 2912 | or BEGV if there are no previous overlays. | ||
| 2913 | NEXT_PTR and/or PREV_PTR may be 0, meaning don't store that info. | ||
| 2914 | 2837 | ||
| 2915 | *VEC_PTR and *LEN_PTR should contain a valid vector and size | 2838 | See overlays_in for the meaning of the arguments. |
| 2916 | when this function is called. | 2839 | */ |
| 2917 | 2840 | ||
| 2918 | If EXTEND, make the vector bigger if necessary. | 2841 | ptrdiff_t |
| 2919 | If not, never extend the vector, | 2842 | overlays_at (ptrdiff_t pos, bool extend, |
| 2920 | and store only as many overlays as will fit. | 2843 | Lisp_Object **vec_ptr, ptrdiff_t *len_ptr, |
| 2921 | But still return the total number of overlays. */ | 2844 | ptrdiff_t *next_ptr) |
| 2845 | { | ||
| 2846 | return overlays_in (pos, pos + 1, extend, vec_ptr, len_ptr, false, next_ptr); | ||
| 2847 | } | ||
| 2922 | 2848 | ||
| 2923 | static ptrdiff_t | 2849 | ptrdiff_t |
| 2924 | overlays_in (EMACS_INT beg, EMACS_INT end, bool extend, | 2850 | next_overlay_change (ptrdiff_t pos) |
| 2925 | Lisp_Object **vec_ptr, ptrdiff_t *len_ptr, | ||
| 2926 | ptrdiff_t *next_ptr, ptrdiff_t *prev_ptr) | ||
| 2927 | { | 2851 | { |
| 2928 | Lisp_Object overlay, ostart, oend; | ||
| 2929 | struct Lisp_Overlay *tail; | ||
| 2930 | ptrdiff_t idx = 0; | ||
| 2931 | ptrdiff_t len = *len_ptr; | ||
| 2932 | Lisp_Object *vec = *vec_ptr; | ||
| 2933 | ptrdiff_t next = ZV; | 2852 | ptrdiff_t next = ZV; |
| 2934 | ptrdiff_t prev = BEGV; | 2853 | struct interval_node *node; |
| 2935 | bool inhibit_storing = 0; | ||
| 2936 | bool end_is_Z = end == Z; | ||
| 2937 | 2854 | ||
| 2938 | for (tail = current_buffer->overlays_before; tail; tail = tail->next) | 2855 | if (! current_buffer->overlays) |
| 2939 | { | 2856 | return next; |
| 2940 | ptrdiff_t startpos, endpos; | ||
| 2941 | 2857 | ||
| 2942 | XSETMISC (overlay, tail); | 2858 | buffer_overlay_iter_start (current_buffer, pos, ZV, ITREE_ASCENDING); |
| 2943 | 2859 | while ((node = buffer_overlay_iter_next (current_buffer))) | |
| 2944 | ostart = OVERLAY_START (overlay); | 2860 | { |
| 2945 | oend = OVERLAY_END (overlay); | 2861 | if (node->begin > pos) |
| 2946 | endpos = OVERLAY_POSITION (oend); | 2862 | { |
| 2947 | if (endpos < beg) | 2863 | /* If we reach this branch, node->begin must be the least upper bound |
| 2948 | { | 2864 | of pos, because the search is limited to [pos,next) . */ |
| 2949 | if (prev < endpos) | 2865 | eassert (node->begin < next); |
| 2950 | prev = endpos; | 2866 | next = node->begin; |
| 2951 | break; | 2867 | break; |
| 2952 | } | 2868 | } |
| 2953 | startpos = OVERLAY_POSITION (ostart); | 2869 | else if (node->begin < node->end && node->end < next) |
| 2954 | /* Count an interval if it overlaps the range, is empty at the | 2870 | { |
| 2955 | start of the range, or is empty at END provided END denotes the | 2871 | next = node->end; |
| 2956 | end of the buffer. */ | 2872 | buffer_overlay_iter_narrow (current_buffer, pos, next); |
| 2957 | if ((beg < endpos && startpos < end) | 2873 | } |
| 2958 | || (startpos == endpos | ||
| 2959 | && (beg == endpos || (end_is_Z && endpos == end)))) | ||
| 2960 | { | ||
| 2961 | if (idx == len) | ||
| 2962 | { | ||
| 2963 | /* The supplied vector is full. | ||
| 2964 | Either make it bigger, or don't store any more in it. */ | ||
| 2965 | if (extend) | ||
| 2966 | { | ||
| 2967 | vec = xpalloc (vec, len_ptr, 1, OVERLAY_COUNT_MAX, | ||
| 2968 | sizeof *vec); | ||
| 2969 | *vec_ptr = vec; | ||
| 2970 | len = *len_ptr; | ||
| 2971 | } | ||
| 2972 | else | ||
| 2973 | inhibit_storing = 1; | ||
| 2974 | } | ||
| 2975 | |||
| 2976 | if (!inhibit_storing) | ||
| 2977 | vec[idx] = overlay; | ||
| 2978 | /* Keep counting overlays even if we can't return them all. */ | ||
| 2979 | idx++; | ||
| 2980 | } | ||
| 2981 | else if (startpos < next) | ||
| 2982 | next = startpos; | ||
| 2983 | } | 2874 | } |
| 2875 | buffer_overlay_iter_finish (current_buffer); | ||
| 2984 | 2876 | ||
| 2985 | for (tail = current_buffer->overlays_after; tail; tail = tail->next) | 2877 | return next; |
| 2986 | { | 2878 | } |
| 2987 | ptrdiff_t startpos, endpos; | ||
| 2988 | 2879 | ||
| 2989 | XSETMISC (overlay, tail); | 2880 | ptrdiff_t |
| 2881 | previous_overlay_change (ptrdiff_t pos) | ||
| 2882 | { | ||
| 2883 | struct interval_node *node; | ||
| 2884 | ptrdiff_t prev = BEGV; | ||
| 2990 | 2885 | ||
| 2991 | ostart = OVERLAY_START (overlay); | 2886 | if (! current_buffer->overlays) |
| 2992 | oend = OVERLAY_END (overlay); | 2887 | return prev; |
| 2993 | startpos = OVERLAY_POSITION (ostart); | ||
| 2994 | if (end < startpos) | ||
| 2995 | { | ||
| 2996 | if (startpos < next) | ||
| 2997 | next = startpos; | ||
| 2998 | break; | ||
| 2999 | } | ||
| 3000 | endpos = OVERLAY_POSITION (oend); | ||
| 3001 | /* Count an interval if it overlaps the range, is empty at the | ||
| 3002 | start of the range, or is empty at END provided END denotes the | ||
| 3003 | end of the buffer. */ | ||
| 3004 | if ((beg < endpos && startpos < end) | ||
| 3005 | || (startpos == endpos | ||
| 3006 | && (beg == endpos || (end_is_Z && endpos == end)))) | ||
| 3007 | { | ||
| 3008 | if (idx == len) | ||
| 3009 | { | ||
| 3010 | if (extend) | ||
| 3011 | { | ||
| 3012 | vec = xpalloc (vec, len_ptr, 1, OVERLAY_COUNT_MAX, | ||
| 3013 | sizeof *vec); | ||
| 3014 | *vec_ptr = vec; | ||
| 3015 | len = *len_ptr; | ||
| 3016 | } | ||
| 3017 | else | ||
| 3018 | inhibit_storing = 1; | ||
| 3019 | } | ||
| 3020 | 2888 | ||
| 3021 | if (!inhibit_storing) | 2889 | buffer_overlay_iter_start (current_buffer, BEGV, pos, ITREE_DESCENDING); |
| 3022 | vec[idx] = overlay; | 2890 | while ((node = buffer_overlay_iter_next (current_buffer))) |
| 3023 | idx++; | 2891 | { |
| 3024 | } | 2892 | if (node->end < pos) |
| 3025 | else if (endpos < beg && endpos > prev) | 2893 | prev = node->end; |
| 3026 | prev = endpos; | 2894 | else |
| 2895 | prev = max (prev, node->begin); | ||
| 2896 | buffer_overlay_iter_narrow (current_buffer, prev, pos); | ||
| 3027 | } | 2897 | } |
| 2898 | buffer_overlay_iter_finish (current_buffer); | ||
| 3028 | 2899 | ||
| 3029 | if (next_ptr) | 2900 | return prev; |
| 3030 | *next_ptr = next; | ||
| 3031 | if (prev_ptr) | ||
| 3032 | *prev_ptr = prev; | ||
| 3033 | return idx; | ||
| 3034 | } | 2901 | } |
| 3035 | 2902 | ||
| 3036 | |||
| 3037 | /* Return true if there exists an overlay with a non-nil | 2903 | /* Return true if there exists an overlay with a non-nil |
| 3038 | `mouse-face' property overlapping OVERLAY. */ | 2904 | `mouse-face' property overlapping OVERLAY. */ |
| 3039 | 2905 | ||
| 3040 | bool | 2906 | bool |
| 3041 | mouse_face_overlay_overlaps (Lisp_Object overlay) | 2907 | mouse_face_overlay_overlaps (Lisp_Object overlay) |
| 3042 | { | 2908 | { |
| 3043 | ptrdiff_t start = OVERLAY_POSITION (OVERLAY_START (overlay)); | 2909 | ptrdiff_t start = OVERLAY_START (overlay); |
| 3044 | ptrdiff_t end = OVERLAY_POSITION (OVERLAY_END (overlay)); | 2910 | ptrdiff_t end = OVERLAY_END (overlay); |
| 3045 | ptrdiff_t n, i, size; | 2911 | ptrdiff_t n, i, size; |
| 3046 | Lisp_Object *v, tem; | 2912 | Lisp_Object *v, tem; |
| 3047 | Lisp_Object vbuf[10]; | 2913 | Lisp_Object vbuf[10]; |
| @@ -3049,11 +2915,11 @@ mouse_face_overlay_overlaps (Lisp_Object overlay) | |||
| 3049 | 2915 | ||
| 3050 | size = ARRAYELTS (vbuf); | 2916 | size = ARRAYELTS (vbuf); |
| 3051 | v = vbuf; | 2917 | v = vbuf; |
| 3052 | n = overlays_in (start, end, 0, &v, &size, NULL, NULL); | 2918 | n = overlays_in (start, end, 0, &v, &size, true, NULL); |
| 3053 | if (n > size) | 2919 | if (n > size) |
| 3054 | { | 2920 | { |
| 3055 | SAFE_NALLOCA (v, 1, n); | 2921 | SAFE_NALLOCA (v, 1, n); |
| 3056 | overlays_in (start, end, 0, &v, &n, NULL, NULL); | 2922 | overlays_in (start, end, 0, &v, &n, true, NULL); |
| 3057 | } | 2923 | } |
| 3058 | 2924 | ||
| 3059 | for (i = 0; i < n; ++i) | 2925 | for (i = 0; i < n; ++i) |
| @@ -3095,52 +2961,34 @@ disable_line_numbers_overlay_at_eob (void) | |||
| 3095 | } | 2961 | } |
| 3096 | 2962 | ||
| 3097 | 2963 | ||
| 3098 | /* Fast function to just test if we're at an overlay boundary. */ | 2964 | /* Fast function to just test if we're at an overlay boundary. |
| 2965 | |||
| 2966 | Returns true if some overlay starts or ends (or both) at POS, | ||
| 2967 | */ | ||
| 3099 | bool | 2968 | bool |
| 3100 | overlay_touches_p (ptrdiff_t pos) | 2969 | overlay_touches_p (ptrdiff_t pos) |
| 3101 | { | 2970 | { |
| 3102 | Lisp_Object overlay; | 2971 | struct interval_node *node; |
| 3103 | struct Lisp_Overlay *tail; | 2972 | bool result = false; |
| 3104 | |||
| 3105 | for (tail = current_buffer->overlays_before; tail; tail = tail->next) | ||
| 3106 | { | ||
| 3107 | ptrdiff_t endpos; | ||
| 3108 | 2973 | ||
| 3109 | XSETMISC (overlay ,tail); | 2974 | if (! current_buffer->overlays) |
| 3110 | eassert (OVERLAYP (overlay)); | 2975 | return false; |
| 3111 | 2976 | ||
| 3112 | endpos = OVERLAY_POSITION (OVERLAY_END (overlay)); | 2977 | /* We need to find overlays ending in pos, as well as empty ones at |
| 3113 | if (endpos < pos) | 2978 | pos. */ |
| 3114 | break; | 2979 | buffer_overlay_iter_start (current_buffer, |
| 3115 | if (endpos == pos || OVERLAY_POSITION (OVERLAY_START (overlay)) == pos) | 2980 | pos - 1, pos + 1, ITREE_DESCENDING); |
| 3116 | return 1; | ||
| 3117 | } | ||
| 3118 | 2981 | ||
| 3119 | for (tail = current_buffer->overlays_after; tail; tail = tail->next) | 2982 | while (! result && (node = buffer_overlay_iter_next (current_buffer))) |
| 3120 | { | 2983 | result = (node->begin == pos || node->end == pos); |
| 3121 | ptrdiff_t startpos; | ||
| 3122 | 2984 | ||
| 3123 | XSETMISC (overlay, tail); | 2985 | buffer_overlay_iter_finish (current_buffer); |
| 3124 | eassert (OVERLAYP (overlay)); | ||
| 3125 | 2986 | ||
| 3126 | startpos = OVERLAY_POSITION (OVERLAY_START (overlay)); | 2987 | return result; |
| 3127 | if (pos < startpos) | ||
| 3128 | break; | ||
| 3129 | if (startpos == pos || OVERLAY_POSITION (OVERLAY_END (overlay)) == pos) | ||
| 3130 | return 1; | ||
| 3131 | } | ||
| 3132 | return 0; | ||
| 3133 | } | 2988 | } |
| 3134 | |||
| 3135 | struct sortvec | ||
| 3136 | { | ||
| 3137 | Lisp_Object overlay; | ||
| 3138 | ptrdiff_t beg, end; | ||
| 3139 | EMACS_INT priority; | ||
| 3140 | EMACS_INT spriority; /* Secondary priority. */ | ||
| 3141 | }; | ||
| 3142 | 2989 | ||
| 3143 | static int | 2990 | |
| 2991 | int | ||
| 3144 | compare_overlays (const void *v1, const void *v2) | 2992 | compare_overlays (const void *v1, const void *v2) |
| 3145 | { | 2993 | { |
| 3146 | const struct sortvec *s1 = v1; | 2994 | const struct sortvec *s1 = v1; |
| @@ -3169,6 +3017,33 @@ compare_overlays (const void *v1, const void *v2) | |||
| 3169 | return XLI (s1->overlay) < XLI (s2->overlay) ? -1 : 1; | 3017 | return XLI (s1->overlay) < XLI (s2->overlay) ? -1 : 1; |
| 3170 | } | 3018 | } |
| 3171 | 3019 | ||
| 3020 | void | ||
| 3021 | make_sortvec_item (struct sortvec *item, Lisp_Object overlay) | ||
| 3022 | { | ||
| 3023 | Lisp_Object tem; | ||
| 3024 | /* This overlay is good and counts: put it into sortvec. */ | ||
| 3025 | item->overlay = overlay; | ||
| 3026 | item->beg = OVERLAY_START (overlay); | ||
| 3027 | item->end = OVERLAY_END (overlay); | ||
| 3028 | tem = Foverlay_get (overlay, Qpriority); | ||
| 3029 | if (NILP (tem)) | ||
| 3030 | { | ||
| 3031 | item->priority = 0; | ||
| 3032 | item->spriority = 0; | ||
| 3033 | } | ||
| 3034 | else if (INTEGERP (tem)) | ||
| 3035 | { | ||
| 3036 | item->priority = XINT (tem); | ||
| 3037 | item->spriority = 0; | ||
| 3038 | } | ||
| 3039 | else if (CONSP (tem)) | ||
| 3040 | { | ||
| 3041 | Lisp_Object car = XCAR (tem); | ||
| 3042 | Lisp_Object cdr = XCDR (tem); | ||
| 3043 | item->priority = INTEGERP (car) ? XINT (car) : 0; | ||
| 3044 | item->spriority = INTEGERP (cdr) ? XINT (cdr) : 0; | ||
| 3045 | } | ||
| 3046 | } | ||
| 3172 | /* Sort an array of overlays by priority. The array is modified in place. | 3047 | /* Sort an array of overlays by priority. The array is modified in place. |
| 3173 | The return value is the new size; this may be smaller than the original | 3048 | The return value is the new size; this may be smaller than the original |
| 3174 | size if some of the overlays were invalid or were window-specific. */ | 3049 | size if some of the overlays were invalid or were window-specific. */ |
| @@ -3185,47 +3060,18 @@ sort_overlays (Lisp_Object *overlay_vec, ptrdiff_t noverlays, struct window *w) | |||
| 3185 | 3060 | ||
| 3186 | for (i = 0, j = 0; i < noverlays; i++) | 3061 | for (i = 0, j = 0; i < noverlays; i++) |
| 3187 | { | 3062 | { |
| 3188 | Lisp_Object tem; | ||
| 3189 | Lisp_Object overlay; | 3063 | Lisp_Object overlay; |
| 3190 | 3064 | ||
| 3191 | overlay = overlay_vec[i]; | 3065 | overlay = overlay_vec[i]; |
| 3192 | if (OVERLAYP (overlay) | 3066 | if (OVERLAYP (overlay) |
| 3193 | && OVERLAY_POSITION (OVERLAY_START (overlay)) > 0 | 3067 | && OVERLAY_START (overlay) > 0 |
| 3194 | && OVERLAY_POSITION (OVERLAY_END (overlay)) > 0) | 3068 | && OVERLAY_END (overlay) > 0) |
| 3195 | { | 3069 | { |
| 3196 | /* If we're interested in a specific window, then ignore | 3070 | /* If we're interested in a specific window, then ignore |
| 3197 | overlays that are limited to some other window. */ | 3071 | overlays that are limited to some other window. */ |
| 3198 | if (w) | 3072 | if (w && ! overlay_matches_window (w, overlay)) |
| 3199 | { | 3073 | continue; |
| 3200 | Lisp_Object window; | 3074 | make_sortvec_item (sortvec + j, overlay); |
| 3201 | |||
| 3202 | window = Foverlay_get (overlay, Qwindow); | ||
| 3203 | if (WINDOWP (window) && XWINDOW (window) != w) | ||
| 3204 | continue; | ||
| 3205 | } | ||
| 3206 | |||
| 3207 | /* This overlay is good and counts: put it into sortvec. */ | ||
| 3208 | sortvec[j].overlay = overlay; | ||
| 3209 | sortvec[j].beg = OVERLAY_POSITION (OVERLAY_START (overlay)); | ||
| 3210 | sortvec[j].end = OVERLAY_POSITION (OVERLAY_END (overlay)); | ||
| 3211 | tem = Foverlay_get (overlay, Qpriority); | ||
| 3212 | if (NILP (tem)) | ||
| 3213 | { | ||
| 3214 | sortvec[j].priority = 0; | ||
| 3215 | sortvec[j].spriority = 0; | ||
| 3216 | } | ||
| 3217 | else if (INTEGERP (tem)) | ||
| 3218 | { | ||
| 3219 | sortvec[j].priority = XINT (tem); | ||
| 3220 | sortvec[j].spriority = 0; | ||
| 3221 | } | ||
| 3222 | else if (CONSP (tem)) | ||
| 3223 | { | ||
| 3224 | Lisp_Object car = XCAR (tem); | ||
| 3225 | Lisp_Object cdr = XCDR (tem); | ||
| 3226 | sortvec[j].priority = INTEGERP (car) ? XINT (car) : 0; | ||
| 3227 | sortvec[j].spriority = INTEGERP (cdr) ? XINT (cdr) : 0; | ||
| 3228 | } | ||
| 3229 | j++; | 3075 | j++; |
| 3230 | } | 3076 | } |
| 3231 | } | 3077 | } |
| @@ -3340,68 +3186,44 @@ ptrdiff_t | |||
| 3340 | overlay_strings (ptrdiff_t pos, struct window *w, unsigned char **pstr) | 3186 | overlay_strings (ptrdiff_t pos, struct window *w, unsigned char **pstr) |
| 3341 | { | 3187 | { |
| 3342 | Lisp_Object overlay, window, str; | 3188 | Lisp_Object overlay, window, str; |
| 3343 | struct Lisp_Overlay *ov; | 3189 | ptrdiff_t obegin, oend; |
| 3344 | ptrdiff_t startpos, endpos; | ||
| 3345 | bool multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters)); | 3190 | bool multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters)); |
| 3191 | struct interval_node *node; | ||
| 3346 | 3192 | ||
| 3347 | overlay_heads.used = overlay_heads.bytes = 0; | 3193 | overlay_heads.used = overlay_heads.bytes = 0; |
| 3348 | overlay_tails.used = overlay_tails.bytes = 0; | 3194 | overlay_tails.used = overlay_tails.bytes = 0; |
| 3349 | for (ov = current_buffer->overlays_before; ov; ov = ov->next) | 3195 | |
| 3196 | buffer_overlay_iter_start (current_buffer, | ||
| 3197 | pos - 1, pos + 1, ITREE_DESCENDING); | ||
| 3198 | while ((node = buffer_overlay_iter_next (current_buffer))) | ||
| 3350 | { | 3199 | { |
| 3351 | XSETMISC (overlay, ov); | 3200 | overlay = node->data; |
| 3352 | eassert (OVERLAYP (overlay)); | 3201 | eassert (OVERLAYP (overlay)); |
| 3353 | 3202 | ||
| 3354 | startpos = OVERLAY_POSITION (OVERLAY_START (overlay)); | 3203 | obegin = node->begin; |
| 3355 | endpos = OVERLAY_POSITION (OVERLAY_END (overlay)); | 3204 | oend = node->end; |
| 3356 | if (endpos < pos) | 3205 | |
| 3357 | break; | 3206 | if (oend != pos && obegin != pos) |
| 3358 | if (endpos != pos && startpos != pos) | ||
| 3359 | continue; | 3207 | continue; |
| 3360 | window = Foverlay_get (overlay, Qwindow); | 3208 | window = Foverlay_get (overlay, Qwindow); |
| 3361 | if (WINDOWP (window) && XWINDOW (window) != w) | 3209 | if (WINDOWP (window) && XWINDOW (window) != w) |
| 3362 | continue; | 3210 | continue; |
| 3363 | if (startpos == pos | 3211 | if (obegin == pos |
| 3364 | && (str = Foverlay_get (overlay, Qbefore_string), STRINGP (str))) | 3212 | && (str = Foverlay_get (overlay, Qbefore_string), STRINGP (str))) |
| 3365 | record_overlay_string (&overlay_heads, str, | 3213 | record_overlay_string (&overlay_heads, str, |
| 3366 | (startpos == endpos | 3214 | (obegin == oend |
| 3367 | ? Foverlay_get (overlay, Qafter_string) | 3215 | ? Foverlay_get (overlay, Qafter_string) |
| 3368 | : Qnil), | 3216 | : Qnil), |
| 3369 | Foverlay_get (overlay, Qpriority), | 3217 | Foverlay_get (overlay, Qpriority), |
| 3370 | endpos - startpos); | 3218 | oend - obegin); |
| 3371 | else if (endpos == pos | 3219 | else if (oend == pos |
| 3372 | && (str = Foverlay_get (overlay, Qafter_string), STRINGP (str))) | 3220 | && (str = Foverlay_get (overlay, Qafter_string), STRINGP (str))) |
| 3373 | record_overlay_string (&overlay_tails, str, Qnil, | 3221 | record_overlay_string (&overlay_tails, str, Qnil, |
| 3374 | Foverlay_get (overlay, Qpriority), | 3222 | Foverlay_get (overlay, Qpriority), |
| 3375 | endpos - startpos); | 3223 | oend - obegin); |
| 3376 | } | 3224 | } |
| 3377 | for (ov = current_buffer->overlays_after; ov; ov = ov->next) | 3225 | buffer_overlay_iter_finish (current_buffer); |
| 3378 | { | ||
| 3379 | XSETMISC (overlay, ov); | ||
| 3380 | eassert (OVERLAYP (overlay)); | ||
| 3381 | 3226 | ||
| 3382 | startpos = OVERLAY_POSITION (OVERLAY_START (overlay)); | ||
| 3383 | endpos = OVERLAY_POSITION (OVERLAY_END (overlay)); | ||
| 3384 | if (startpos > pos) | ||
| 3385 | break; | ||
| 3386 | if (endpos != pos && startpos != pos) | ||
| 3387 | continue; | ||
| 3388 | window = Foverlay_get (overlay, Qwindow); | ||
| 3389 | if (WINDOWP (window) && XWINDOW (window) != w) | ||
| 3390 | continue; | ||
| 3391 | if (startpos == pos | ||
| 3392 | && (str = Foverlay_get (overlay, Qbefore_string), STRINGP (str))) | ||
| 3393 | record_overlay_string (&overlay_heads, str, | ||
| 3394 | (startpos == endpos | ||
| 3395 | ? Foverlay_get (overlay, Qafter_string) | ||
| 3396 | : Qnil), | ||
| 3397 | Foverlay_get (overlay, Qpriority), | ||
| 3398 | endpos - startpos); | ||
| 3399 | else if (endpos == pos | ||
| 3400 | && (str = Foverlay_get (overlay, Qafter_string), STRINGP (str))) | ||
| 3401 | record_overlay_string (&overlay_tails, str, Qnil, | ||
| 3402 | Foverlay_get (overlay, Qpriority), | ||
| 3403 | endpos - startpos); | ||
| 3404 | } | ||
| 3405 | if (overlay_tails.used > 1) | 3227 | if (overlay_tails.used > 1) |
| 3406 | qsort (overlay_tails.buf, overlay_tails.used, sizeof (struct sortstr), | 3228 | qsort (overlay_tails.buf, overlay_tails.used, sizeof (struct sortstr), |
| 3407 | cmp_for_strings); | 3229 | cmp_for_strings); |
| @@ -3456,385 +3278,26 @@ overlay_strings (ptrdiff_t pos, struct window *w, unsigned char **pstr) | |||
| 3456 | } | 3278 | } |
| 3457 | return 0; | 3279 | return 0; |
| 3458 | } | 3280 | } |
| 3459 | |||
| 3460 | /* Shift overlays in BUF's overlay lists, to center the lists at POS. */ | ||
| 3461 | |||
| 3462 | void | ||
| 3463 | recenter_overlay_lists (struct buffer *buf, ptrdiff_t pos) | ||
| 3464 | { | ||
| 3465 | Lisp_Object overlay, beg, end; | ||
| 3466 | struct Lisp_Overlay *prev, *tail, *next; | ||
| 3467 | |||
| 3468 | /* See if anything in overlays_before should move to overlays_after. */ | ||
| 3469 | |||
| 3470 | /* We don't strictly need prev in this loop; it should always be nil. | ||
| 3471 | But we use it for symmetry and in case that should cease to be true | ||
| 3472 | with some future change. */ | ||
| 3473 | prev = NULL; | ||
| 3474 | for (tail = buf->overlays_before; tail; prev = tail, tail = next) | ||
| 3475 | { | ||
| 3476 | next = tail->next; | ||
| 3477 | XSETMISC (overlay, tail); | ||
| 3478 | eassert (OVERLAYP (overlay)); | ||
| 3479 | |||
| 3480 | beg = OVERLAY_START (overlay); | ||
| 3481 | end = OVERLAY_END (overlay); | ||
| 3482 | |||
| 3483 | if (OVERLAY_POSITION (end) > pos) | ||
| 3484 | { | ||
| 3485 | /* OVERLAY needs to be moved. */ | ||
| 3486 | ptrdiff_t where = OVERLAY_POSITION (beg); | ||
| 3487 | struct Lisp_Overlay *other, *other_prev; | ||
| 3488 | |||
| 3489 | /* Splice the cons cell TAIL out of overlays_before. */ | ||
| 3490 | if (prev) | ||
| 3491 | prev->next = next; | ||
| 3492 | else | ||
| 3493 | set_buffer_overlays_before (buf, next); | ||
| 3494 | |||
| 3495 | /* Search thru overlays_after for where to put it. */ | ||
| 3496 | other_prev = NULL; | ||
| 3497 | for (other = buf->overlays_after; other; | ||
| 3498 | other_prev = other, other = other->next) | ||
| 3499 | { | ||
| 3500 | Lisp_Object otherbeg, otheroverlay; | ||
| 3501 | |||
| 3502 | XSETMISC (otheroverlay, other); | ||
| 3503 | eassert (OVERLAYP (otheroverlay)); | ||
| 3504 | |||
| 3505 | otherbeg = OVERLAY_START (otheroverlay); | ||
| 3506 | if (OVERLAY_POSITION (otherbeg) >= where) | ||
| 3507 | break; | ||
| 3508 | } | ||
| 3509 | |||
| 3510 | /* Add TAIL to overlays_after before OTHER. */ | ||
| 3511 | tail->next = other; | ||
| 3512 | if (other_prev) | ||
| 3513 | other_prev->next = tail; | ||
| 3514 | else | ||
| 3515 | set_buffer_overlays_after (buf, tail); | ||
| 3516 | tail = prev; | ||
| 3517 | } | ||
| 3518 | else | ||
| 3519 | /* We've reached the things that should stay in overlays_before. | ||
| 3520 | All the rest of overlays_before must end even earlier, | ||
| 3521 | so stop now. */ | ||
| 3522 | break; | ||
| 3523 | } | ||
| 3524 | |||
| 3525 | /* See if anything in overlays_after should be in overlays_before. */ | ||
| 3526 | prev = NULL; | ||
| 3527 | for (tail = buf->overlays_after; tail; prev = tail, tail = next) | ||
| 3528 | { | ||
| 3529 | next = tail->next; | ||
| 3530 | XSETMISC (overlay, tail); | ||
| 3531 | eassert (OVERLAYP (overlay)); | ||
| 3532 | |||
| 3533 | beg = OVERLAY_START (overlay); | ||
| 3534 | end = OVERLAY_END (overlay); | ||
| 3535 | |||
| 3536 | /* Stop looking, when we know that nothing further | ||
| 3537 | can possibly end before POS. */ | ||
| 3538 | if (OVERLAY_POSITION (beg) > pos) | ||
| 3539 | break; | ||
| 3540 | |||
| 3541 | if (OVERLAY_POSITION (end) <= pos) | ||
| 3542 | { | ||
| 3543 | /* OVERLAY needs to be moved. */ | ||
| 3544 | ptrdiff_t where = OVERLAY_POSITION (end); | ||
| 3545 | struct Lisp_Overlay *other, *other_prev; | ||
| 3546 | |||
| 3547 | /* Splice the cons cell TAIL out of overlays_after. */ | ||
| 3548 | if (prev) | ||
| 3549 | prev->next = next; | ||
| 3550 | else | ||
| 3551 | set_buffer_overlays_after (buf, next); | ||
| 3552 | |||
| 3553 | /* Search thru overlays_before for where to put it. */ | ||
| 3554 | other_prev = NULL; | ||
| 3555 | for (other = buf->overlays_before; other; | ||
| 3556 | other_prev = other, other = other->next) | ||
| 3557 | { | ||
| 3558 | Lisp_Object otherend, otheroverlay; | ||
| 3559 | |||
| 3560 | XSETMISC (otheroverlay, other); | ||
| 3561 | eassert (OVERLAYP (otheroverlay)); | ||
| 3562 | |||
| 3563 | otherend = OVERLAY_END (otheroverlay); | ||
| 3564 | if (OVERLAY_POSITION (otherend) <= where) | ||
| 3565 | break; | ||
| 3566 | } | ||
| 3567 | |||
| 3568 | /* Add TAIL to overlays_before before OTHER. */ | ||
| 3569 | tail->next = other; | ||
| 3570 | if (other_prev) | ||
| 3571 | other_prev->next = tail; | ||
| 3572 | else | ||
| 3573 | set_buffer_overlays_before (buf, tail); | ||
| 3574 | tail = prev; | ||
| 3575 | } | ||
| 3576 | } | ||
| 3577 | |||
| 3578 | buf->overlay_center = pos; | ||
| 3579 | } | ||
| 3580 | 3281 | ||
| 3282 | |||
| 3581 | void | 3283 | void |
| 3582 | adjust_overlays_for_insert (ptrdiff_t pos, ptrdiff_t length) | 3284 | adjust_overlays_for_insert (ptrdiff_t pos, ptrdiff_t length) |
| 3583 | { | 3285 | { |
| 3584 | /* After an insertion, the lists are still sorted properly, | 3286 | /* After an insertion, the lists are still sorted properly, |
| 3585 | but we may need to update the value of the overlay center. */ | 3287 | but we may need to update the value of the overlay center. */ |
| 3586 | if (current_buffer->overlay_center >= pos) | 3288 | if (! current_buffer->overlays) |
| 3587 | current_buffer->overlay_center += length; | 3289 | return; |
| 3290 | interval_tree_insert_gap (current_buffer->overlays, pos, length); | ||
| 3588 | } | 3291 | } |
| 3589 | 3292 | ||
| 3590 | void | 3293 | void |
| 3591 | adjust_overlays_for_delete (ptrdiff_t pos, ptrdiff_t length) | 3294 | adjust_overlays_for_delete (ptrdiff_t pos, ptrdiff_t length) |
| 3592 | { | 3295 | { |
| 3593 | if (current_buffer->overlay_center < pos) | 3296 | if (! current_buffer->overlays) |
| 3594 | /* The deletion was to our right. No change needed; the before- and | ||
| 3595 | after-lists are still consistent. */ | ||
| 3596 | ; | ||
| 3597 | else if (current_buffer->overlay_center - pos > length) | ||
| 3598 | /* The deletion was to our left. We need to adjust the center value | ||
| 3599 | to account for the change in position, but the lists are consistent | ||
| 3600 | given the new value. */ | ||
| 3601 | current_buffer->overlay_center -= length; | ||
| 3602 | else | ||
| 3603 | /* We're right in the middle. There might be things on the after-list | ||
| 3604 | that now belong on the before-list. Recentering will move them, | ||
| 3605 | and also update the center point. */ | ||
| 3606 | recenter_overlay_lists (current_buffer, pos); | ||
| 3607 | } | ||
| 3608 | |||
| 3609 | /* Fix up overlays that were garbled as a result of permuting markers | ||
| 3610 | in the range START through END. Any overlay with at least one | ||
| 3611 | endpoint in this range will need to be unlinked from the overlay | ||
| 3612 | list and reinserted in its proper place. | ||
| 3613 | Such an overlay might even have negative size at this point. | ||
| 3614 | If so, we'll make the overlay empty. */ | ||
| 3615 | void | ||
| 3616 | fix_start_end_in_overlays (register ptrdiff_t start, register ptrdiff_t end) | ||
| 3617 | { | ||
| 3618 | Lisp_Object overlay; | ||
| 3619 | struct Lisp_Overlay *before_list; | ||
| 3620 | struct Lisp_Overlay *after_list; | ||
| 3621 | /* These are either nil, indicating that before_list or after_list | ||
| 3622 | should be assigned, or the cons cell the cdr of which should be | ||
| 3623 | assigned. */ | ||
| 3624 | struct Lisp_Overlay *beforep = NULL, *afterp = NULL; | ||
| 3625 | /* 'Parent', likewise, indicates a cons cell or | ||
| 3626 | current_buffer->overlays_before or overlays_after, depending | ||
| 3627 | which loop we're in. */ | ||
| 3628 | struct Lisp_Overlay *tail, *parent; | ||
| 3629 | ptrdiff_t startpos, endpos; | ||
| 3630 | |||
| 3631 | /* This algorithm shifts links around instead of consing and GCing. | ||
| 3632 | The loop invariant is that before_list (resp. after_list) is a | ||
| 3633 | well-formed list except that its last element, the CDR of beforep | ||
| 3634 | (resp. afterp) if beforep (afterp) isn't nil or before_list | ||
| 3635 | (after_list) if it is, is still uninitialized. So it's not a bug | ||
| 3636 | that before_list isn't initialized, although it may look | ||
| 3637 | strange. */ | ||
| 3638 | for (parent = NULL, tail = current_buffer->overlays_before; tail;) | ||
| 3639 | { | ||
| 3640 | XSETMISC (overlay, tail); | ||
| 3641 | |||
| 3642 | endpos = OVERLAY_POSITION (OVERLAY_END (overlay)); | ||
| 3643 | startpos = OVERLAY_POSITION (OVERLAY_START (overlay)); | ||
| 3644 | |||
| 3645 | /* If the overlay is backwards, make it empty. */ | ||
| 3646 | if (endpos < startpos) | ||
| 3647 | { | ||
| 3648 | startpos = endpos; | ||
| 3649 | Fset_marker (OVERLAY_START (overlay), make_number (startpos), | ||
| 3650 | Qnil); | ||
| 3651 | } | ||
| 3652 | |||
| 3653 | if (endpos < start) | ||
| 3654 | break; | ||
| 3655 | |||
| 3656 | if (endpos < end | ||
| 3657 | || (startpos >= start && startpos < end)) | ||
| 3658 | { | ||
| 3659 | /* Add it to the end of the wrong list. Later on, | ||
| 3660 | recenter_overlay_lists will move it to the right place. */ | ||
| 3661 | if (endpos < current_buffer->overlay_center) | ||
| 3662 | { | ||
| 3663 | if (!afterp) | ||
| 3664 | after_list = tail; | ||
| 3665 | else | ||
| 3666 | afterp->next = tail; | ||
| 3667 | afterp = tail; | ||
| 3668 | } | ||
| 3669 | else | ||
| 3670 | { | ||
| 3671 | if (!beforep) | ||
| 3672 | before_list = tail; | ||
| 3673 | else | ||
| 3674 | beforep->next = tail; | ||
| 3675 | beforep = tail; | ||
| 3676 | } | ||
| 3677 | if (!parent) | ||
| 3678 | set_buffer_overlays_before (current_buffer, tail->next); | ||
| 3679 | else | ||
| 3680 | parent->next = tail->next; | ||
| 3681 | tail = tail->next; | ||
| 3682 | } | ||
| 3683 | else | ||
| 3684 | parent = tail, tail = parent->next; | ||
| 3685 | } | ||
| 3686 | for (parent = NULL, tail = current_buffer->overlays_after; tail;) | ||
| 3687 | { | ||
| 3688 | XSETMISC (overlay, tail); | ||
| 3689 | |||
| 3690 | startpos = OVERLAY_POSITION (OVERLAY_START (overlay)); | ||
| 3691 | endpos = OVERLAY_POSITION (OVERLAY_END (overlay)); | ||
| 3692 | |||
| 3693 | /* If the overlay is backwards, make it empty. */ | ||
| 3694 | if (endpos < startpos) | ||
| 3695 | { | ||
| 3696 | startpos = endpos; | ||
| 3697 | Fset_marker (OVERLAY_START (overlay), make_number (startpos), | ||
| 3698 | Qnil); | ||
| 3699 | } | ||
| 3700 | |||
| 3701 | if (startpos >= end) | ||
| 3702 | break; | ||
| 3703 | |||
| 3704 | if (startpos >= start | ||
| 3705 | || (endpos >= start && endpos < end)) | ||
| 3706 | { | ||
| 3707 | if (endpos < current_buffer->overlay_center) | ||
| 3708 | { | ||
| 3709 | if (!afterp) | ||
| 3710 | after_list = tail; | ||
| 3711 | else | ||
| 3712 | afterp->next = tail; | ||
| 3713 | afterp = tail; | ||
| 3714 | } | ||
| 3715 | else | ||
| 3716 | { | ||
| 3717 | if (!beforep) | ||
| 3718 | before_list = tail; | ||
| 3719 | else | ||
| 3720 | beforep->next = tail; | ||
| 3721 | beforep = tail; | ||
| 3722 | } | ||
| 3723 | if (!parent) | ||
| 3724 | set_buffer_overlays_after (current_buffer, tail->next); | ||
| 3725 | else | ||
| 3726 | parent->next = tail->next; | ||
| 3727 | tail = tail->next; | ||
| 3728 | } | ||
| 3729 | else | ||
| 3730 | parent = tail, tail = parent->next; | ||
| 3731 | } | ||
| 3732 | |||
| 3733 | /* Splice the constructed (wrong) lists into the buffer's lists, | ||
| 3734 | and let the recenter function make it sane again. */ | ||
| 3735 | if (beforep) | ||
| 3736 | { | ||
| 3737 | beforep->next = current_buffer->overlays_before; | ||
| 3738 | set_buffer_overlays_before (current_buffer, before_list); | ||
| 3739 | } | ||
| 3740 | |||
| 3741 | if (afterp) | ||
| 3742 | { | ||
| 3743 | afterp->next = current_buffer->overlays_after; | ||
| 3744 | set_buffer_overlays_after (current_buffer, after_list); | ||
| 3745 | } | ||
| 3746 | recenter_overlay_lists (current_buffer, current_buffer->overlay_center); | ||
| 3747 | } | ||
| 3748 | |||
| 3749 | /* We have two types of overlay: the one whose ending marker is | ||
| 3750 | after-insertion-marker (this is the usual case) and the one whose | ||
| 3751 | ending marker is before-insertion-marker. When `overlays_before' | ||
| 3752 | contains overlays of the latter type and the former type in this | ||
| 3753 | order and both overlays end at inserting position, inserting a text | ||
| 3754 | increases only the ending marker of the latter type, which results | ||
| 3755 | in incorrect ordering of `overlays_before'. | ||
| 3756 | |||
| 3757 | This function fixes ordering of overlays in the slot | ||
| 3758 | `overlays_before' of the buffer *BP. Before the insertion, `point' | ||
| 3759 | was at PREV, and now is at POS. */ | ||
| 3760 | |||
| 3761 | void | ||
| 3762 | fix_overlays_before (struct buffer *bp, ptrdiff_t prev, ptrdiff_t pos) | ||
| 3763 | { | ||
| 3764 | /* If parent is nil, replace overlays_before; otherwise, parent->next. */ | ||
| 3765 | struct Lisp_Overlay *tail = bp->overlays_before, *parent = NULL, *right_pair; | ||
| 3766 | Lisp_Object tem; | ||
| 3767 | ptrdiff_t end UNINIT; | ||
| 3768 | |||
| 3769 | /* After the insertion, the several overlays may be in incorrect | ||
| 3770 | order. The possibility is that, in the list `overlays_before', | ||
| 3771 | an overlay which ends at POS appears after an overlay which ends | ||
| 3772 | at PREV. Since POS is greater than PREV, we must fix the | ||
| 3773 | ordering of these overlays, by moving overlays ends at POS before | ||
| 3774 | the overlays ends at PREV. */ | ||
| 3775 | |||
| 3776 | /* At first, find a place where disordered overlays should be linked | ||
| 3777 | in. It is where an overlay which end before POS exists. (i.e. an | ||
| 3778 | overlay whose ending marker is after-insertion-marker if disorder | ||
| 3779 | exists). */ | ||
| 3780 | while (tail | ||
| 3781 | && (XSETMISC (tem, tail), | ||
| 3782 | (end = OVERLAY_POSITION (OVERLAY_END (tem))) >= pos)) | ||
| 3783 | { | ||
| 3784 | parent = tail; | ||
| 3785 | tail = tail->next; | ||
| 3786 | } | ||
| 3787 | |||
| 3788 | /* If we don't find such an overlay, | ||
| 3789 | or the found one ends before PREV, | ||
| 3790 | or the found one is the last one in the list, | ||
| 3791 | we don't have to fix anything. */ | ||
| 3792 | if (!tail || end < prev || !tail->next) | ||
| 3793 | return; | 3297 | return; |
| 3794 | 3298 | interval_tree_delete_gap (current_buffer->overlays, pos, length); | |
| 3795 | right_pair = parent; | ||
| 3796 | parent = tail; | ||
| 3797 | tail = tail->next; | ||
| 3798 | |||
| 3799 | /* Now, end position of overlays in the list TAIL should be before | ||
| 3800 | or equal to PREV. In the loop, an overlay which ends at POS is | ||
| 3801 | moved ahead to the place indicated by the CDR of RIGHT_PAIR. If | ||
| 3802 | we found an overlay which ends before PREV, the remaining | ||
| 3803 | overlays are in correct order. */ | ||
| 3804 | while (tail) | ||
| 3805 | { | ||
| 3806 | XSETMISC (tem, tail); | ||
| 3807 | end = OVERLAY_POSITION (OVERLAY_END (tem)); | ||
| 3808 | |||
| 3809 | if (end == pos) | ||
| 3810 | { /* This overlay is disordered. */ | ||
| 3811 | struct Lisp_Overlay *found = tail; | ||
| 3812 | |||
| 3813 | /* Unlink the found overlay. */ | ||
| 3814 | tail = found->next; | ||
| 3815 | parent->next = tail; | ||
| 3816 | /* Move an overlay at RIGHT_PLACE to the next of the found one, | ||
| 3817 | and link it into the right place. */ | ||
| 3818 | if (!right_pair) | ||
| 3819 | { | ||
| 3820 | found->next = bp->overlays_before; | ||
| 3821 | set_buffer_overlays_before (bp, found); | ||
| 3822 | } | ||
| 3823 | else | ||
| 3824 | { | ||
| 3825 | found->next = right_pair->next; | ||
| 3826 | right_pair->next = found; | ||
| 3827 | } | ||
| 3828 | } | ||
| 3829 | else if (end == prev) | ||
| 3830 | { | ||
| 3831 | parent = tail; | ||
| 3832 | tail = tail->next; | ||
| 3833 | } | ||
| 3834 | else /* No more disordered overlay. */ | ||
| 3835 | break; | ||
| 3836 | } | ||
| 3837 | } | 3299 | } |
| 3300 | |||
| 3838 | 3301 | ||
| 3839 | DEFUN ("overlayp", Foverlayp, Soverlayp, 1, 1, 0, | 3302 | DEFUN ("overlayp", Foverlayp, Soverlayp, 1, 1, 0, |
| 3840 | doc: /* Return t if OBJECT is an overlay. */) | 3303 | doc: /* Return t if OBJECT is an overlay. */) |
| @@ -3853,10 +3316,11 @@ for the front of the overlay advance when text is inserted there | |||
| 3853 | The fifth arg REAR-ADVANCE, if non-nil, makes the marker | 3316 | The fifth arg REAR-ADVANCE, if non-nil, makes the marker |
| 3854 | for the rear of the overlay advance when text is inserted there | 3317 | for the rear of the overlay advance when text is inserted there |
| 3855 | \(which means the text *is* included in the overlay). */) | 3318 | \(which means the text *is* included in the overlay). */) |
| 3856 | (Lisp_Object beg, Lisp_Object end, Lisp_Object buffer, | 3319 | (Lisp_Object begin, Lisp_Object end, Lisp_Object buffer, |
| 3857 | Lisp_Object front_advance, Lisp_Object rear_advance) | 3320 | Lisp_Object front_advance, Lisp_Object rear_advance) |
| 3858 | { | 3321 | { |
| 3859 | Lisp_Object overlay; | 3322 | Lisp_Object ov; |
| 3323 | ptrdiff_t obegin, oend; | ||
| 3860 | struct buffer *b; | 3324 | struct buffer *b; |
| 3861 | 3325 | ||
| 3862 | if (NILP (buffer)) | 3326 | if (NILP (buffer)) |
| @@ -3864,53 +3328,35 @@ for the rear of the overlay advance when text is inserted there | |||
| 3864 | else | 3328 | else |
| 3865 | CHECK_BUFFER (buffer); | 3329 | CHECK_BUFFER (buffer); |
| 3866 | 3330 | ||
| 3867 | if (MARKERP (beg) && !EQ (Fmarker_buffer (beg), buffer)) | 3331 | b = XBUFFER (buffer); |
| 3868 | signal_error ("Marker points into wrong buffer", beg); | 3332 | if (! BUFFER_LIVE_P (b)) |
| 3333 | error ("Attempt to create overlay in a dead buffer"); | ||
| 3334 | |||
| 3335 | if (MARKERP (begin) && !EQ (Fmarker_buffer (begin), buffer)) | ||
| 3336 | signal_error ("Marker points into wrong buffer", begin); | ||
| 3869 | if (MARKERP (end) && !EQ (Fmarker_buffer (end), buffer)) | 3337 | if (MARKERP (end) && !EQ (Fmarker_buffer (end), buffer)) |
| 3870 | signal_error ("Marker points into wrong buffer", end); | 3338 | signal_error ("Marker points into wrong buffer", end); |
| 3871 | 3339 | ||
| 3872 | CHECK_NUMBER_COERCE_MARKER (beg); | 3340 | CHECK_NUMBER_COERCE_MARKER (begin); |
| 3873 | CHECK_NUMBER_COERCE_MARKER (end); | 3341 | CHECK_NUMBER_COERCE_MARKER (end); |
| 3874 | 3342 | ||
| 3875 | if (XINT (beg) > XINT (end)) | 3343 | if (XINT (begin) > XINT (end)) |
| 3876 | { | 3344 | { |
| 3877 | Lisp_Object temp; | 3345 | Lisp_Object temp; |
| 3878 | temp = beg; beg = end; end = temp; | 3346 | temp = begin; begin = end; end = temp; |
| 3879 | } | 3347 | } |
| 3880 | 3348 | ||
| 3881 | b = XBUFFER (buffer); | 3349 | obegin = clip_to_bounds (BEG, XINT (begin), b->text->z); |
| 3882 | 3350 | oend = clip_to_bounds (obegin, XINT (end), b->text->z); | |
| 3883 | beg = Fset_marker (Fmake_marker (), beg, buffer); | 3351 | ov = build_overlay (obegin, oend, |
| 3884 | end = Fset_marker (Fmake_marker (), end, buffer); | 3352 | ! NILP (front_advance), |
| 3885 | 3353 | ! NILP (rear_advance), Qnil); | |
| 3886 | if (!NILP (front_advance)) | 3354 | add_buffer_overlay (b, XOVERLAY (ov)); |
| 3887 | XMARKER (beg)->insertion_type = 1; | ||
| 3888 | if (!NILP (rear_advance)) | ||
| 3889 | XMARKER (end)->insertion_type = 1; | ||
| 3890 | |||
| 3891 | overlay = build_overlay (beg, end, Qnil); | ||
| 3892 | |||
| 3893 | /* Put the new overlay on the wrong list. */ | ||
| 3894 | end = OVERLAY_END (overlay); | ||
| 3895 | if (OVERLAY_POSITION (end) < b->overlay_center) | ||
| 3896 | { | ||
| 3897 | eassert (b->overlays_after || (XOVERLAY (overlay)->next == NULL)); | ||
| 3898 | XOVERLAY (overlay)->next = b->overlays_after; | ||
| 3899 | set_buffer_overlays_after (b, XOVERLAY (overlay)); | ||
| 3900 | } | ||
| 3901 | else | ||
| 3902 | { | ||
| 3903 | eassert (b->overlays_before || (XOVERLAY (overlay)->next == NULL)); | ||
| 3904 | XOVERLAY (overlay)->next = b->overlays_before; | ||
| 3905 | set_buffer_overlays_before (b, XOVERLAY (overlay)); | ||
| 3906 | } | ||
| 3907 | /* This puts it in the right list, and in the right order. */ | ||
| 3908 | recenter_overlay_lists (b, b->overlay_center); | ||
| 3909 | 3355 | ||
| 3910 | /* We don't need to redisplay the region covered by the overlay, because | 3356 | /* We don't need to redisplay the region covered by the overlay, because |
| 3911 | the overlay has no properties at the moment. */ | 3357 | the overlay has no properties at the moment. */ |
| 3912 | 3358 | ||
| 3913 | return overlay; | 3359 | return ov; |
| 3914 | } | 3360 | } |
| 3915 | 3361 | ||
| 3916 | /* Mark a section of BUF as needing redisplay because of overlays changes. */ | 3362 | /* Mark a section of BUF as needing redisplay because of overlays changes. */ |
| @@ -3932,35 +3378,6 @@ modify_overlay (struct buffer *buf, ptrdiff_t start, ptrdiff_t end) | |||
| 3932 | ++BUF_OVERLAY_MODIFF (buf); | 3378 | ++BUF_OVERLAY_MODIFF (buf); |
| 3933 | } | 3379 | } |
| 3934 | 3380 | ||
| 3935 | /* Remove OVERLAY from LIST. */ | ||
| 3936 | |||
| 3937 | static struct Lisp_Overlay * | ||
| 3938 | unchain_overlay (struct Lisp_Overlay *list, struct Lisp_Overlay *overlay) | ||
| 3939 | { | ||
| 3940 | register struct Lisp_Overlay *tail, **prev = &list; | ||
| 3941 | |||
| 3942 | for (tail = list; tail; prev = &tail->next, tail = *prev) | ||
| 3943 | if (tail == overlay) | ||
| 3944 | { | ||
| 3945 | *prev = overlay->next; | ||
| 3946 | overlay->next = NULL; | ||
| 3947 | break; | ||
| 3948 | } | ||
| 3949 | return list; | ||
| 3950 | } | ||
| 3951 | |||
| 3952 | /* Remove OVERLAY from both overlay lists of B. */ | ||
| 3953 | |||
| 3954 | static void | ||
| 3955 | unchain_both (struct buffer *b, Lisp_Object overlay) | ||
| 3956 | { | ||
| 3957 | struct Lisp_Overlay *ov = XOVERLAY (overlay); | ||
| 3958 | |||
| 3959 | set_buffer_overlays_before (b, unchain_overlay (b->overlays_before, ov)); | ||
| 3960 | set_buffer_overlays_after (b, unchain_overlay (b->overlays_after, ov)); | ||
| 3961 | eassert (XOVERLAY (overlay)->next == NULL); | ||
| 3962 | } | ||
| 3963 | |||
| 3964 | DEFUN ("move-overlay", Fmove_overlay, Smove_overlay, 3, 4, 0, | 3381 | DEFUN ("move-overlay", Fmove_overlay, Smove_overlay, 3, 4, 0, |
| 3965 | doc: /* Set the endpoints of OVERLAY to BEG and END in BUFFER. | 3382 | doc: /* Set the endpoints of OVERLAY to BEG and END in BUFFER. |
| 3966 | If BUFFER is omitted, leave OVERLAY in the same buffer it inhabits now. | 3383 | If BUFFER is omitted, leave OVERLAY in the same buffer it inhabits now. |
| @@ -3976,7 +3393,7 @@ buffer. */) | |||
| 3976 | 3393 | ||
| 3977 | CHECK_OVERLAY (overlay); | 3394 | CHECK_OVERLAY (overlay); |
| 3978 | if (NILP (buffer)) | 3395 | if (NILP (buffer)) |
| 3979 | buffer = Fmarker_buffer (OVERLAY_START (overlay)); | 3396 | buffer = Foverlay_buffer (overlay); |
| 3980 | if (NILP (buffer)) | 3397 | if (NILP (buffer)) |
| 3981 | XSETBUFFER (buffer, current_buffer); | 3398 | XSETBUFFER (buffer, current_buffer); |
| 3982 | CHECK_BUFFER (buffer); | 3399 | CHECK_BUFFER (buffer); |
| @@ -4000,25 +3417,28 @@ buffer. */) | |||
| 4000 | 3417 | ||
| 4001 | specbind (Qinhibit_quit, Qt); | 3418 | specbind (Qinhibit_quit, Qt); |
| 4002 | 3419 | ||
| 4003 | obuffer = Fmarker_buffer (OVERLAY_START (overlay)); | 3420 | obuffer = Foverlay_buffer (overlay); |
| 4004 | b = XBUFFER (buffer); | 3421 | b = XBUFFER (buffer); |
| 4005 | 3422 | ||
| 4006 | if (!NILP (obuffer)) | 3423 | if (!NILP (obuffer)) |
| 4007 | { | 3424 | { |
| 4008 | ob = XBUFFER (obuffer); | 3425 | ob = XBUFFER (obuffer); |
| 4009 | 3426 | ||
| 4010 | o_beg = OVERLAY_POSITION (OVERLAY_START (overlay)); | 3427 | o_beg = OVERLAY_START (overlay); |
| 4011 | o_end = OVERLAY_POSITION (OVERLAY_END (overlay)); | 3428 | o_end = OVERLAY_END (overlay); |
| 4012 | |||
| 4013 | unchain_both (ob, overlay); | ||
| 4014 | } | 3429 | } |
| 4015 | 3430 | ||
| 3431 | if (! EQ (buffer, obuffer)) | ||
| 3432 | { | ||
| 3433 | if (! NILP (obuffer)) | ||
| 3434 | remove_buffer_overlay (XBUFFER (obuffer), XOVERLAY (overlay)); | ||
| 3435 | add_buffer_overlay (XBUFFER (buffer), XOVERLAY (overlay)); | ||
| 3436 | } | ||
| 4016 | /* Set the overlay boundaries, which may clip them. */ | 3437 | /* Set the overlay boundaries, which may clip them. */ |
| 4017 | Fset_marker (OVERLAY_START (overlay), beg, buffer); | 3438 | set_overlay_region (XOVERLAY (overlay), XINT (beg), XINT (end)); |
| 4018 | Fset_marker (OVERLAY_END (overlay), end, buffer); | ||
| 4019 | 3439 | ||
| 4020 | n_beg = marker_position (OVERLAY_START (overlay)); | 3440 | n_beg = OVERLAY_START (overlay); |
| 4021 | n_end = marker_position (OVERLAY_END (overlay)); | 3441 | n_end = OVERLAY_END (overlay); |
| 4022 | 3442 | ||
| 4023 | /* If the overlay has changed buffers, do a thorough redisplay. */ | 3443 | /* If the overlay has changed buffers, do a thorough redisplay. */ |
| 4024 | if (!EQ (buffer, obuffer)) | 3444 | if (!EQ (buffer, obuffer)) |
| @@ -4046,22 +3466,6 @@ buffer. */) | |||
| 4046 | if (n_beg == n_end && !NILP (Foverlay_get (overlay, Qevaporate))) | 3466 | if (n_beg == n_end && !NILP (Foverlay_get (overlay, Qevaporate))) |
| 4047 | return unbind_to (count, Fdelete_overlay (overlay)); | 3467 | return unbind_to (count, Fdelete_overlay (overlay)); |
| 4048 | 3468 | ||
| 4049 | /* Put the overlay into the new buffer's overlay lists, first on the | ||
| 4050 | wrong list. */ | ||
| 4051 | if (n_end < b->overlay_center) | ||
| 4052 | { | ||
| 4053 | XOVERLAY (overlay)->next = b->overlays_after; | ||
| 4054 | set_buffer_overlays_after (b, XOVERLAY (overlay)); | ||
| 4055 | } | ||
| 4056 | else | ||
| 4057 | { | ||
| 4058 | XOVERLAY (overlay)->next = b->overlays_before; | ||
| 4059 | set_buffer_overlays_before (b, XOVERLAY (overlay)); | ||
| 4060 | } | ||
| 4061 | |||
| 4062 | /* This puts it in the right list, and in the right order. */ | ||
| 4063 | recenter_overlay_lists (b, b->overlay_center); | ||
| 4064 | |||
| 4065 | return unbind_to (count, overlay); | 3469 | return unbind_to (count, overlay); |
| 4066 | } | 3470 | } |
| 4067 | 3471 | ||
| @@ -4069,21 +3473,18 @@ DEFUN ("delete-overlay", Fdelete_overlay, Sdelete_overlay, 1, 1, 0, | |||
| 4069 | doc: /* Delete the overlay OVERLAY from its buffer. */) | 3473 | doc: /* Delete the overlay OVERLAY from its buffer. */) |
| 4070 | (Lisp_Object overlay) | 3474 | (Lisp_Object overlay) |
| 4071 | { | 3475 | { |
| 4072 | Lisp_Object buffer; | ||
| 4073 | struct buffer *b; | 3476 | struct buffer *b; |
| 4074 | ptrdiff_t count = SPECPDL_INDEX (); | 3477 | ptrdiff_t count = SPECPDL_INDEX (); |
| 4075 | 3478 | ||
| 4076 | CHECK_OVERLAY (overlay); | 3479 | CHECK_OVERLAY (overlay); |
| 4077 | 3480 | ||
| 4078 | buffer = Fmarker_buffer (OVERLAY_START (overlay)); | 3481 | b = OVERLAY_BUFFER (overlay); |
| 4079 | if (NILP (buffer)) | 3482 | if (! b) |
| 4080 | return Qnil; | 3483 | return Qnil; |
| 4081 | 3484 | ||
| 4082 | b = XBUFFER (buffer); | ||
| 4083 | specbind (Qinhibit_quit, Qt); | 3485 | specbind (Qinhibit_quit, Qt); |
| 4084 | 3486 | ||
| 4085 | unchain_both (b, overlay); | 3487 | drop_overlay (XOVERLAY (overlay)); |
| 4086 | drop_overlay (b, XOVERLAY (overlay)); | ||
| 4087 | 3488 | ||
| 4088 | /* When deleting an overlay with before or after strings, turn off | 3489 | /* When deleting an overlay with before or after strings, turn off |
| 4089 | display optimizations for the affected buffer, on the basis that | 3490 | display optimizations for the affected buffer, on the basis that |
| @@ -4114,8 +3515,10 @@ DEFUN ("overlay-start", Foverlay_start, Soverlay_start, 1, 1, 0, | |||
| 4114 | (Lisp_Object overlay) | 3515 | (Lisp_Object overlay) |
| 4115 | { | 3516 | { |
| 4116 | CHECK_OVERLAY (overlay); | 3517 | CHECK_OVERLAY (overlay); |
| 3518 | if (! OVERLAY_BUFFER (overlay)) | ||
| 3519 | return Qnil; | ||
| 4117 | 3520 | ||
| 4118 | return (Fmarker_position (OVERLAY_START (overlay))); | 3521 | return make_number (OVERLAY_START (overlay)); |
| 4119 | } | 3522 | } |
| 4120 | 3523 | ||
| 4121 | DEFUN ("overlay-end", Foverlay_end, Soverlay_end, 1, 1, 0, | 3524 | DEFUN ("overlay-end", Foverlay_end, Soverlay_end, 1, 1, 0, |
| @@ -4123,8 +3526,10 @@ DEFUN ("overlay-end", Foverlay_end, Soverlay_end, 1, 1, 0, | |||
| 4123 | (Lisp_Object overlay) | 3526 | (Lisp_Object overlay) |
| 4124 | { | 3527 | { |
| 4125 | CHECK_OVERLAY (overlay); | 3528 | CHECK_OVERLAY (overlay); |
| 3529 | if (! OVERLAY_BUFFER (overlay)) | ||
| 3530 | return Qnil; | ||
| 4126 | 3531 | ||
| 4127 | return (Fmarker_position (OVERLAY_END (overlay))); | 3532 | return make_number (OVERLAY_END (overlay)); |
| 4128 | } | 3533 | } |
| 4129 | 3534 | ||
| 4130 | DEFUN ("overlay-buffer", Foverlay_buffer, Soverlay_buffer, 1, 1, 0, | 3535 | DEFUN ("overlay-buffer", Foverlay_buffer, Soverlay_buffer, 1, 1, 0, |
| @@ -4132,9 +3537,16 @@ DEFUN ("overlay-buffer", Foverlay_buffer, Soverlay_buffer, 1, 1, 0, | |||
| 4132 | Return nil if OVERLAY has been deleted. */) | 3537 | Return nil if OVERLAY has been deleted. */) |
| 4133 | (Lisp_Object overlay) | 3538 | (Lisp_Object overlay) |
| 4134 | { | 3539 | { |
| 3540 | Lisp_Object buffer; | ||
| 3541 | |||
| 4135 | CHECK_OVERLAY (overlay); | 3542 | CHECK_OVERLAY (overlay); |
| 4136 | 3543 | ||
| 4137 | return Fmarker_buffer (OVERLAY_START (overlay)); | 3544 | if (! OVERLAY_BUFFER (overlay)) |
| 3545 | return Qnil; | ||
| 3546 | |||
| 3547 | XSETBUFFER (buffer, OVERLAY_BUFFER (overlay)); | ||
| 3548 | |||
| 3549 | return buffer; | ||
| 4138 | } | 3550 | } |
| 4139 | 3551 | ||
| 4140 | DEFUN ("overlay-properties", Foverlay_properties, Soverlay_properties, 1, 1, 0, | 3552 | DEFUN ("overlay-properties", Foverlay_properties, Soverlay_properties, 1, 1, 0, |
| @@ -4145,7 +3557,7 @@ OVERLAY. */) | |||
| 4145 | { | 3557 | { |
| 4146 | CHECK_OVERLAY (overlay); | 3558 | CHECK_OVERLAY (overlay); |
| 4147 | 3559 | ||
| 4148 | return Fcopy_sequence (XOVERLAY (overlay)->plist); | 3560 | return Fcopy_sequence (OVERLAY_PLIST (overlay)); |
| 4149 | } | 3561 | } |
| 4150 | 3562 | ||
| 4151 | 3563 | ||
| @@ -4169,8 +3581,7 @@ If SORTED is non-nil, then sort them by decreasing priority. */) | |||
| 4169 | 3581 | ||
| 4170 | /* Put all the overlays we want in a vector in overlay_vec. | 3582 | /* Put all the overlays we want in a vector in overlay_vec. |
| 4171 | Store the length in len. */ | 3583 | Store the length in len. */ |
| 4172 | noverlays = overlays_at (XINT (pos), 1, &overlay_vec, &len, | 3584 | noverlays = overlays_at (XINT (pos), 1, &overlay_vec, &len, NULL); |
| 4173 | NULL, NULL, 0); | ||
| 4174 | 3585 | ||
| 4175 | if (!NILP (sorted)) | 3586 | if (!NILP (sorted)) |
| 4176 | noverlays = sort_overlays (overlay_vec, noverlays, | 3587 | noverlays = sort_overlays (overlay_vec, noverlays, |
| @@ -4213,8 +3624,7 @@ end of the buffer. */) | |||
| 4213 | 3624 | ||
| 4214 | /* Put all the overlays we want in a vector in overlay_vec. | 3625 | /* Put all the overlays we want in a vector in overlay_vec. |
| 4215 | Store the length in len. */ | 3626 | Store the length in len. */ |
| 4216 | noverlays = overlays_in (XINT (beg), XINT (end), 1, &overlay_vec, &len, | 3627 | noverlays = overlays_in (XINT (beg), XINT (end), 1, &overlay_vec, &len, true, NULL); |
| 4217 | NULL, NULL); | ||
| 4218 | 3628 | ||
| 4219 | /* Make a list of them all. */ | 3629 | /* Make a list of them all. */ |
| 4220 | result = Flist (noverlays, overlay_vec); | 3630 | result = Flist (noverlays, overlay_vec); |
| @@ -4230,39 +3640,12 @@ If there are no overlay boundaries from POS to (point-max), | |||
| 4230 | the value is (point-max). */) | 3640 | the value is (point-max). */) |
| 4231 | (Lisp_Object pos) | 3641 | (Lisp_Object pos) |
| 4232 | { | 3642 | { |
| 4233 | ptrdiff_t i, len, noverlays; | ||
| 4234 | ptrdiff_t endpos; | ||
| 4235 | Lisp_Object *overlay_vec; | ||
| 4236 | |||
| 4237 | CHECK_NUMBER_COERCE_MARKER (pos); | 3643 | CHECK_NUMBER_COERCE_MARKER (pos); |
| 4238 | 3644 | ||
| 4239 | if (!buffer_has_overlays ()) | 3645 | if (!buffer_has_overlays ()) |
| 4240 | return make_number (ZV); | 3646 | return make_number (ZV); |
| 4241 | 3647 | ||
| 4242 | len = 10; | 3648 | return make_number (next_overlay_change (XINT (pos))); |
| 4243 | overlay_vec = xmalloc (len * sizeof *overlay_vec); | ||
| 4244 | |||
| 4245 | /* Put all the overlays we want in a vector in overlay_vec. | ||
| 4246 | Store the length in len. | ||
| 4247 | endpos gets the position where the next overlay starts. */ | ||
| 4248 | noverlays = overlays_at (XINT (pos), 1, &overlay_vec, &len, | ||
| 4249 | &endpos, 0, 1); | ||
| 4250 | |||
| 4251 | /* If any of these overlays ends before endpos, | ||
| 4252 | use its ending point instead. */ | ||
| 4253 | for (i = 0; i < noverlays; i++) | ||
| 4254 | { | ||
| 4255 | Lisp_Object oend; | ||
| 4256 | ptrdiff_t oendpos; | ||
| 4257 | |||
| 4258 | oend = OVERLAY_END (overlay_vec[i]); | ||
| 4259 | oendpos = OVERLAY_POSITION (oend); | ||
| 4260 | if (oendpos < endpos) | ||
| 4261 | endpos = oendpos; | ||
| 4262 | } | ||
| 4263 | |||
| 4264 | xfree (overlay_vec); | ||
| 4265 | return make_number (endpos); | ||
| 4266 | } | 3649 | } |
| 4267 | 3650 | ||
| 4268 | DEFUN ("previous-overlay-change", Fprevious_overlay_change, | 3651 | DEFUN ("previous-overlay-change", Fprevious_overlay_change, |
| @@ -4272,32 +3655,15 @@ If there are no overlay boundaries from (point-min) to POS, | |||
| 4272 | the value is (point-min). */) | 3655 | the value is (point-min). */) |
| 4273 | (Lisp_Object pos) | 3656 | (Lisp_Object pos) |
| 4274 | { | 3657 | { |
| 4275 | ptrdiff_t prevpos; | ||
| 4276 | Lisp_Object *overlay_vec; | ||
| 4277 | ptrdiff_t len; | ||
| 4278 | 3658 | ||
| 4279 | CHECK_NUMBER_COERCE_MARKER (pos); | 3659 | CHECK_NUMBER_COERCE_MARKER (pos); |
| 4280 | 3660 | ||
| 4281 | if (!buffer_has_overlays ()) | 3661 | if (!buffer_has_overlays ()) |
| 4282 | return make_number (BEGV); | 3662 | return make_number (BEGV); |
| 4283 | 3663 | ||
| 4284 | /* At beginning of buffer, we know the answer; | 3664 | return make_number (previous_overlay_change (XINT (pos))); |
| 4285 | avoid bug subtracting 1 below. */ | ||
| 4286 | if (XINT (pos) == BEGV) | ||
| 4287 | return pos; | ||
| 4288 | |||
| 4289 | len = 10; | ||
| 4290 | overlay_vec = xmalloc (len * sizeof *overlay_vec); | ||
| 4291 | |||
| 4292 | /* Put all the overlays we want in a vector in overlay_vec. | ||
| 4293 | Store the length in len. | ||
| 4294 | prevpos gets the position of the previous change. */ | ||
| 4295 | overlays_at (XINT (pos), 1, &overlay_vec, &len, | ||
| 4296 | 0, &prevpos, 1); | ||
| 4297 | |||
| 4298 | xfree (overlay_vec); | ||
| 4299 | return make_number (prevpos); | ||
| 4300 | } | 3665 | } |
| 3666 | |||
| 4301 | 3667 | ||
| 4302 | /* These functions are for debugging overlays. */ | 3668 | /* These functions are for debugging overlays. */ |
| 4303 | 3669 | ||
| @@ -4307,24 +3673,21 @@ The car has all the overlays before the overlay center; | |||
| 4307 | the cdr has all the overlays after the overlay center. | 3673 | the cdr has all the overlays after the overlay center. |
| 4308 | Recentering overlays moves overlays between these lists. | 3674 | Recentering overlays moves overlays between these lists. |
| 4309 | The lists you get are copies, so that changing them has no effect. | 3675 | The lists you get are copies, so that changing them has no effect. |
| 4310 | However, the overlays you get are the real objects that the buffer uses. */) | 3676 | However, the overlays you get are the real objects that the buffer uses. */) |
| 4311 | (void) | 3677 | (void) |
| 4312 | { | 3678 | { |
| 4313 | struct Lisp_Overlay *ol; | 3679 | Lisp_Object overlays = Qnil; |
| 4314 | Lisp_Object before = Qnil, after = Qnil, tmp; | ||
| 4315 | 3680 | ||
| 4316 | for (ol = current_buffer->overlays_before; ol; ol = ol->next) | 3681 | if (current_buffer->overlays) |
| 4317 | { | ||
| 4318 | XSETMISC (tmp, ol); | ||
| 4319 | before = Fcons (tmp, before); | ||
| 4320 | } | ||
| 4321 | for (ol = current_buffer->overlays_after; ol; ol = ol->next) | ||
| 4322 | { | 3682 | { |
| 4323 | XSETMISC (tmp, ol); | 3683 | struct interval_node *node; |
| 4324 | after = Fcons (tmp, after); | ||
| 4325 | } | ||
| 4326 | 3684 | ||
| 4327 | return Fcons (Fnreverse (before), Fnreverse (after)); | 3685 | buffer_overlay_iter_start (current_buffer, BEG, Z, ITREE_DESCENDING); |
| 3686 | while ((node = buffer_overlay_iter_next (current_buffer))) | ||
| 3687 | overlays = Fcons (node->data, overlays); | ||
| 3688 | buffer_overlay_iter_finish (current_buffer); | ||
| 3689 | } | ||
| 3690 | return Fcons (overlays, Qnil); | ||
| 4328 | } | 3691 | } |
| 4329 | 3692 | ||
| 4330 | DEFUN ("overlay-recenter", Foverlay_recenter, Soverlay_recenter, 1, 1, 0, | 3693 | DEFUN ("overlay-recenter", Foverlay_recenter, Soverlay_recenter, 1, 1, 0, |
| @@ -4333,11 +3696,8 @@ That makes overlay lookup faster for positions near POS (but perhaps slower | |||
| 4333 | for positions far away from POS). */) | 3696 | for positions far away from POS). */) |
| 4334 | (Lisp_Object pos) | 3697 | (Lisp_Object pos) |
| 4335 | { | 3698 | { |
| 4336 | ptrdiff_t p; | ||
| 4337 | CHECK_NUMBER_COERCE_MARKER (pos); | 3699 | CHECK_NUMBER_COERCE_MARKER (pos); |
| 4338 | 3700 | /* Noop */ | |
| 4339 | p = clip_to_bounds (PTRDIFF_MIN, XINT (pos), PTRDIFF_MAX); | ||
| 4340 | recenter_overlay_lists (current_buffer, p); | ||
| 4341 | return Qnil; | 3701 | return Qnil; |
| 4342 | } | 3702 | } |
| 4343 | 3703 | ||
| @@ -4354,12 +3714,13 @@ DEFUN ("overlay-put", Foverlay_put, Soverlay_put, 3, 3, 0, | |||
| 4354 | VALUE will be returned.*/) | 3714 | VALUE will be returned.*/) |
| 4355 | (Lisp_Object overlay, Lisp_Object prop, Lisp_Object value) | 3715 | (Lisp_Object overlay, Lisp_Object prop, Lisp_Object value) |
| 4356 | { | 3716 | { |
| 4357 | Lisp_Object tail, buffer; | 3717 | Lisp_Object tail; |
| 3718 | struct buffer *b; | ||
| 4358 | bool changed; | 3719 | bool changed; |
| 4359 | 3720 | ||
| 4360 | CHECK_OVERLAY (overlay); | 3721 | CHECK_OVERLAY (overlay); |
| 4361 | 3722 | ||
| 4362 | buffer = Fmarker_buffer (OVERLAY_START (overlay)); | 3723 | b = OVERLAY_BUFFER (overlay); |
| 4363 | 3724 | ||
| 4364 | for (tail = XOVERLAY (overlay)->plist; | 3725 | for (tail = XOVERLAY (overlay)->plist; |
| 4365 | CONSP (tail) && CONSP (XCDR (tail)); | 3726 | CONSP (tail) && CONSP (XCDR (tail)); |
| @@ -4375,15 +3736,14 @@ VALUE will be returned.*/) | |||
| 4375 | set_overlay_plist | 3736 | set_overlay_plist |
| 4376 | (overlay, Fcons (prop, Fcons (value, XOVERLAY (overlay)->plist))); | 3737 | (overlay, Fcons (prop, Fcons (value, XOVERLAY (overlay)->plist))); |
| 4377 | found: | 3738 | found: |
| 4378 | if (! NILP (buffer)) | 3739 | if (b) |
| 4379 | { | 3740 | { |
| 4380 | if (changed) | 3741 | if (changed) |
| 4381 | modify_overlay (XBUFFER (buffer), | 3742 | modify_overlay (b, OVERLAY_START (overlay), |
| 4382 | marker_position (OVERLAY_START (overlay)), | 3743 | OVERLAY_END (overlay)); |
| 4383 | marker_position (OVERLAY_END (overlay))); | ||
| 4384 | if (EQ (prop, Qevaporate) && ! NILP (value) | 3744 | if (EQ (prop, Qevaporate) && ! NILP (value) |
| 4385 | && (OVERLAY_POSITION (OVERLAY_START (overlay)) | 3745 | && (OVERLAY_START (overlay) |
| 4386 | == OVERLAY_POSITION (OVERLAY_END (overlay)))) | 3746 | == OVERLAY_END (overlay))) |
| 4387 | Fdelete_overlay (overlay); | 3747 | Fdelete_overlay (overlay); |
| 4388 | } | 3748 | } |
| 4389 | 3749 | ||
| @@ -4441,14 +3801,9 @@ void | |||
| 4441 | report_overlay_modification (Lisp_Object start, Lisp_Object end, bool after, | 3801 | report_overlay_modification (Lisp_Object start, Lisp_Object end, bool after, |
| 4442 | Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3) | 3802 | Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3) |
| 4443 | { | 3803 | { |
| 4444 | Lisp_Object prop, overlay; | ||
| 4445 | struct Lisp_Overlay *tail; | ||
| 4446 | /* True if this change is an insertion. */ | 3804 | /* True if this change is an insertion. */ |
| 4447 | bool insertion = (after ? XFASTINT (arg3) == 0 : EQ (start, end)); | 3805 | bool insertion = (after ? XFASTINT (arg3) == 0 : EQ (start, end)); |
| 4448 | 3806 | ||
| 4449 | overlay = Qnil; | ||
| 4450 | tail = NULL; | ||
| 4451 | |||
| 4452 | /* We used to run the functions as soon as we found them and only register | 3807 | /* We used to run the functions as soon as we found them and only register |
| 4453 | them in last_overlay_modification_hooks for the purpose of the `after' | 3808 | them in last_overlay_modification_hooks for the purpose of the `after' |
| 4454 | case. But running elisp code as we traverse the list of overlays is | 3809 | case. But running elisp code as we traverse the list of overlays is |
| @@ -4459,68 +3814,35 @@ report_overlay_modification (Lisp_Object start, Lisp_Object end, bool after, | |||
| 4459 | 3814 | ||
| 4460 | if (!after) | 3815 | if (!after) |
| 4461 | { | 3816 | { |
| 3817 | struct interval_node *node; | ||
| 3818 | EMACS_INT begin_arg = XFASTINT (start); | ||
| 3819 | EMACS_INT end_arg = XFASTINT (end); | ||
| 4462 | /* We are being called before a change. | 3820 | /* We are being called before a change. |
| 4463 | Scan the overlays to find the functions to call. */ | 3821 | Scan the overlays to find the functions to call. */ |
| 4464 | last_overlay_modification_hooks_used = 0; | 3822 | last_overlay_modification_hooks_used = 0; |
| 4465 | for (tail = current_buffer->overlays_before; tail; tail = tail->next) | ||
| 4466 | { | ||
| 4467 | ptrdiff_t startpos, endpos; | ||
| 4468 | Lisp_Object ostart, oend; | ||
| 4469 | |||
| 4470 | XSETMISC (overlay, tail); | ||
| 4471 | |||
| 4472 | ostart = OVERLAY_START (overlay); | ||
| 4473 | oend = OVERLAY_END (overlay); | ||
| 4474 | endpos = OVERLAY_POSITION (oend); | ||
| 4475 | if (XFASTINT (start) > endpos) | ||
| 4476 | break; | ||
| 4477 | startpos = OVERLAY_POSITION (ostart); | ||
| 4478 | if (insertion && (XFASTINT (start) == startpos | ||
| 4479 | || XFASTINT (end) == startpos)) | ||
| 4480 | { | ||
| 4481 | prop = Foverlay_get (overlay, Qinsert_in_front_hooks); | ||
| 4482 | if (!NILP (prop)) | ||
| 4483 | add_overlay_mod_hooklist (prop, overlay); | ||
| 4484 | } | ||
| 4485 | if (insertion && (XFASTINT (start) == endpos | ||
| 4486 | || XFASTINT (end) == endpos)) | ||
| 4487 | { | ||
| 4488 | prop = Foverlay_get (overlay, Qinsert_behind_hooks); | ||
| 4489 | if (!NILP (prop)) | ||
| 4490 | add_overlay_mod_hooklist (prop, overlay); | ||
| 4491 | } | ||
| 4492 | /* Test for intersecting intervals. This does the right thing | ||
| 4493 | for both insertion and deletion. */ | ||
| 4494 | if (XFASTINT (end) > startpos && XFASTINT (start) < endpos) | ||
| 4495 | { | ||
| 4496 | prop = Foverlay_get (overlay, Qmodification_hooks); | ||
| 4497 | if (!NILP (prop)) | ||
| 4498 | add_overlay_mod_hooklist (prop, overlay); | ||
| 4499 | } | ||
| 4500 | } | ||
| 4501 | 3823 | ||
| 4502 | for (tail = current_buffer->overlays_after; tail; tail = tail->next) | 3824 | if (! current_buffer->overlays) |
| 3825 | return; | ||
| 3826 | buffer_overlay_iter_start (current_buffer, | ||
| 3827 | begin_arg - (insertion ? 1 : 0), | ||
| 3828 | end_arg + (insertion ? 1 : 0), | ||
| 3829 | ITREE_ASCENDING); | ||
| 3830 | while ((node = buffer_overlay_iter_next (current_buffer))) | ||
| 4503 | { | 3831 | { |
| 4504 | ptrdiff_t startpos, endpos; | 3832 | Lisp_Object overlay = node->data; |
| 4505 | Lisp_Object ostart, oend; | 3833 | ptrdiff_t obegin = OVERLAY_START (overlay); |
| 4506 | 3834 | ptrdiff_t oend = OVERLAY_END (overlay); | |
| 4507 | XSETMISC (overlay, tail); | 3835 | Lisp_Object prop; |
| 4508 | 3836 | ||
| 4509 | ostart = OVERLAY_START (overlay); | 3837 | if (insertion && (begin_arg == obegin |
| 4510 | oend = OVERLAY_END (overlay); | 3838 | || end_arg == obegin)) |
| 4511 | startpos = OVERLAY_POSITION (ostart); | ||
| 4512 | endpos = OVERLAY_POSITION (oend); | ||
| 4513 | if (XFASTINT (end) < startpos) | ||
| 4514 | break; | ||
| 4515 | if (insertion && (XFASTINT (start) == startpos | ||
| 4516 | || XFASTINT (end) == startpos)) | ||
| 4517 | { | 3839 | { |
| 4518 | prop = Foverlay_get (overlay, Qinsert_in_front_hooks); | 3840 | prop = Foverlay_get (overlay, Qinsert_in_front_hooks); |
| 4519 | if (!NILP (prop)) | 3841 | if (!NILP (prop)) |
| 4520 | add_overlay_mod_hooklist (prop, overlay); | 3842 | add_overlay_mod_hooklist (prop, overlay); |
| 4521 | } | 3843 | } |
| 4522 | if (insertion && (XFASTINT (start) == endpos | 3844 | if (insertion && (begin_arg == oend |
| 4523 | || XFASTINT (end) == endpos)) | 3845 | || end_arg == oend)) |
| 4524 | { | 3846 | { |
| 4525 | prop = Foverlay_get (overlay, Qinsert_behind_hooks); | 3847 | prop = Foverlay_get (overlay, Qinsert_behind_hooks); |
| 4526 | if (!NILP (prop)) | 3848 | if (!NILP (prop)) |
| @@ -4528,15 +3850,15 @@ report_overlay_modification (Lisp_Object start, Lisp_Object end, bool after, | |||
| 4528 | } | 3850 | } |
| 4529 | /* Test for intersecting intervals. This does the right thing | 3851 | /* Test for intersecting intervals. This does the right thing |
| 4530 | for both insertion and deletion. */ | 3852 | for both insertion and deletion. */ |
| 4531 | if (XFASTINT (end) > startpos && XFASTINT (start) < endpos) | 3853 | if (! insertion || (end_arg > obegin && begin_arg < oend)) |
| 4532 | { | 3854 | { |
| 4533 | prop = Foverlay_get (overlay, Qmodification_hooks); | 3855 | prop = Foverlay_get (overlay, Qmodification_hooks); |
| 4534 | if (!NILP (prop)) | 3856 | if (!NILP (prop)) |
| 4535 | add_overlay_mod_hooklist (prop, overlay); | 3857 | add_overlay_mod_hooklist (prop, overlay); |
| 4536 | } | 3858 | } |
| 4537 | } | 3859 | } |
| 3860 | buffer_overlay_iter_finish (current_buffer); | ||
| 4538 | } | 3861 | } |
| 4539 | |||
| 4540 | { | 3862 | { |
| 4541 | /* Call the functions recorded in last_overlay_modification_hooks. | 3863 | /* Call the functions recorded in last_overlay_modification_hooks. |
| 4542 | First copy the vector contents, in case some of these hooks | 3864 | First copy the vector contents, in case some of these hooks |
| @@ -4558,7 +3880,7 @@ report_overlay_modification (Lisp_Object start, Lisp_Object end, bool after, | |||
| 4558 | function is never called to record the overlay modification | 3880 | function is never called to record the overlay modification |
| 4559 | hook functions in the last_overlay_modification_hooks | 3881 | hook functions in the last_overlay_modification_hooks |
| 4560 | array, so anything we find there is not ours. */ | 3882 | array, so anything we find there is not ours. */ |
| 4561 | if (XMARKER (OVERLAY_START (ovl))->buffer != current_buffer) | 3883 | if (OVERLAY_BUFFER (ovl) != current_buffer) |
| 4562 | return; | 3884 | return; |
| 4563 | } | 3885 | } |
| 4564 | 3886 | ||
| @@ -4598,34 +3920,22 @@ call_overlay_mod_hooks (Lisp_Object list, Lisp_Object overlay, bool after, | |||
| 4598 | void | 3920 | void |
| 4599 | evaporate_overlays (ptrdiff_t pos) | 3921 | evaporate_overlays (ptrdiff_t pos) |
| 4600 | { | 3922 | { |
| 4601 | Lisp_Object overlay, hit_list; | 3923 | Lisp_Object hit_list; |
| 4602 | struct Lisp_Overlay *tail; | 3924 | struct interval_node *node; |
| 3925 | |||
| 3926 | if (! current_buffer->overlays) | ||
| 3927 | return; | ||
| 4603 | 3928 | ||
| 4604 | hit_list = Qnil; | 3929 | hit_list = Qnil; |
| 4605 | if (pos <= current_buffer->overlay_center) | 3930 | buffer_overlay_iter_start (current_buffer, pos, pos, ITREE_ASCENDING); |
| 4606 | for (tail = current_buffer->overlays_before; tail; tail = tail->next) | 3931 | |
| 4607 | { | 3932 | while ((node = buffer_overlay_iter_next (current_buffer))) |
| 4608 | ptrdiff_t endpos; | 3933 | { |
| 4609 | XSETMISC (overlay, tail); | 3934 | if (node->end == pos |
| 4610 | endpos = OVERLAY_POSITION (OVERLAY_END (overlay)); | 3935 | && ! NILP (Foverlay_get (node->data, Qevaporate))) |
| 4611 | if (endpos < pos) | 3936 | hit_list = Fcons (node->data, hit_list); |
| 4612 | break; | 3937 | } |
| 4613 | if (endpos == pos && OVERLAY_POSITION (OVERLAY_START (overlay)) == pos | 3938 | buffer_overlay_iter_finish (current_buffer); |
| 4614 | && ! NILP (Foverlay_get (overlay, Qevaporate))) | ||
| 4615 | hit_list = Fcons (overlay, hit_list); | ||
| 4616 | } | ||
| 4617 | else | ||
| 4618 | for (tail = current_buffer->overlays_after; tail; tail = tail->next) | ||
| 4619 | { | ||
| 4620 | ptrdiff_t startpos; | ||
| 4621 | XSETMISC (overlay, tail); | ||
| 4622 | startpos = OVERLAY_POSITION (OVERLAY_START (overlay)); | ||
| 4623 | if (startpos > pos) | ||
| 4624 | break; | ||
| 4625 | if (startpos == pos && OVERLAY_POSITION (OVERLAY_END (overlay)) == pos | ||
| 4626 | && ! NILP (Foverlay_get (overlay, Qevaporate))) | ||
| 4627 | hit_list = Fcons (overlay, hit_list); | ||
| 4628 | } | ||
| 4629 | for (; CONSP (hit_list); hit_list = XCDR (hit_list)) | 3939 | for (; CONSP (hit_list); hit_list = XCDR (hit_list)) |
| 4630 | Fdelete_overlay (XCAR (hit_list)); | 3940 | Fdelete_overlay (XCAR (hit_list)); |
| 4631 | } | 3941 | } |
| @@ -5212,9 +4522,7 @@ init_buffer_once (void) | |||
| 5212 | bset_mark_active (&buffer_defaults, Qnil); | 4522 | bset_mark_active (&buffer_defaults, Qnil); |
| 5213 | bset_file_format (&buffer_defaults, Qnil); | 4523 | bset_file_format (&buffer_defaults, Qnil); |
| 5214 | bset_auto_save_file_format (&buffer_defaults, Qt); | 4524 | bset_auto_save_file_format (&buffer_defaults, Qt); |
| 5215 | set_buffer_overlays_before (&buffer_defaults, NULL); | 4525 | buffer_defaults.overlays = NULL; |
| 5216 | set_buffer_overlays_after (&buffer_defaults, NULL); | ||
| 5217 | buffer_defaults.overlay_center = BEG; | ||
| 5218 | 4526 | ||
| 5219 | XSETFASTINT (BVAR (&buffer_defaults, tab_width), 8); | 4527 | XSETFASTINT (BVAR (&buffer_defaults, tab_width), 8); |
| 5220 | bset_truncate_lines (&buffer_defaults, Qnil); | 4528 | bset_truncate_lines (&buffer_defaults, Qnil); |
| @@ -5434,6 +4742,48 @@ defvar_per_buffer (struct Lisp_Buffer_Objfwd *bo_fwd, const char *namestring, | |||
| 5434 | emacs_abort (); | 4742 | emacs_abort (); |
| 5435 | } | 4743 | } |
| 5436 | 4744 | ||
| 4745 | #ifdef ITREE_DEBUG | ||
| 4746 | static Lisp_Object | ||
| 4747 | make_lispy_interval_node (const struct interval_node *node) | ||
| 4748 | { | ||
| 4749 | return listn (CONSTYPE_HEAP, 12, | ||
| 4750 | intern (":begin"), | ||
| 4751 | make_number (node->begin), | ||
| 4752 | intern (":end"), | ||
| 4753 | make_number (node->end), | ||
| 4754 | intern (":limit"), | ||
| 4755 | make_number (node->limit), | ||
| 4756 | intern (":offset"), | ||
| 4757 | make_number (node->offset), | ||
| 4758 | intern (":rear-advance"), | ||
| 4759 | node->rear_advance ? Qt : Qnil, | ||
| 4760 | intern (":front-advance"), | ||
| 4761 | node->front_advance ? Qt : Qnil); | ||
| 4762 | } | ||
| 4763 | |||
| 4764 | static Lisp_Object | ||
| 4765 | overlay_tree (const struct interval_tree *tree, | ||
| 4766 | const struct interval_node *node) | ||
| 4767 | { | ||
| 4768 | if (node == &tree->nil) | ||
| 4769 | return Qnil; | ||
| 4770 | return list3 (make_lispy_interval_node (node), | ||
| 4771 | overlay_tree (tree, node->left), | ||
| 4772 | overlay_tree (tree, node->right)); | ||
| 4773 | } | ||
| 4774 | |||
| 4775 | DEFUN ("overlay-tree", Foverlay_tree, Soverlay_tree, 0, 1, 0, | ||
| 4776 | doc: /* Get the overlay tree for BUFFER. */) | ||
| 4777 | (Lisp_Object buffer) | ||
| 4778 | { | ||
| 4779 | struct buffer *b = decode_buffer (buffer); | ||
| 4780 | if (! b->overlays) | ||
| 4781 | return Qnil; | ||
| 4782 | return overlay_tree (b->overlays, b->overlays->root); | ||
| 4783 | } | ||
| 4784 | #endif | ||
| 4785 | |||
| 4786 | |||
| 5437 | 4787 | ||
| 5438 | /* Initialize the buffer routines. */ | 4788 | /* Initialize the buffer routines. */ |
| 5439 | void | 4789 | void |
| @@ -6303,6 +5653,10 @@ Functions running this hook are, `get-buffer-create', | |||
| 6303 | defsubr (&Srestore_buffer_modified_p); | 5653 | defsubr (&Srestore_buffer_modified_p); |
| 6304 | 5654 | ||
| 6305 | Fput (intern_c_string ("erase-buffer"), Qdisabled, Qt); | 5655 | Fput (intern_c_string ("erase-buffer"), Qdisabled, Qt); |
| 5656 | |||
| 5657 | #ifdef ITREE_DEBUG | ||
| 5658 | defsubr (&Soverlay_tree); | ||
| 5659 | #endif | ||
| 6306 | } | 5660 | } |
| 6307 | 5661 | ||
| 6308 | void | 5662 | void |
diff --git a/src/buffer.h b/src/buffer.h index ac7c5a54679..ef31ad1ed9d 100644 --- a/src/buffer.h +++ b/src/buffer.h | |||
| @@ -26,6 +26,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ | |||
| 26 | 26 | ||
| 27 | #include "character.h" | 27 | #include "character.h" |
| 28 | #include "lisp.h" | 28 | #include "lisp.h" |
| 29 | #include "itree.h" | ||
| 29 | 30 | ||
| 30 | INLINE_HEADER_BEGIN | 31 | INLINE_HEADER_BEGIN |
| 31 | 32 | ||
| @@ -877,16 +878,8 @@ struct buffer | |||
| 877 | /* Non-zero whenever the narrowing is changed in this buffer. */ | 878 | /* Non-zero whenever the narrowing is changed in this buffer. */ |
| 878 | bool_bf clip_changed : 1; | 879 | bool_bf clip_changed : 1; |
| 879 | 880 | ||
| 880 | /* List of overlays that end at or before the current center, | 881 | /* The inveral tree containing this buffer's overlays. */ |
| 881 | in order of end-position. */ | 882 | struct interval_tree *overlays; |
| 882 | struct Lisp_Overlay *overlays_before; | ||
| 883 | |||
| 884 | /* List of overlays that end after the current center, | ||
| 885 | in order of start-position. */ | ||
| 886 | struct Lisp_Overlay *overlays_after; | ||
| 887 | |||
| 888 | /* Position where the overlay lists are centered. */ | ||
| 889 | ptrdiff_t overlay_center; | ||
| 890 | 883 | ||
| 891 | /* Changes in the buffer are recorded here for undo, and t means | 884 | /* Changes in the buffer are recorded here for undo, and t means |
| 892 | don't record anything. This information belongs to the base | 885 | don't record anything. This information belongs to the base |
| @@ -896,6 +889,14 @@ struct buffer | |||
| 896 | Lisp_Object undo_list_; | 889 | Lisp_Object undo_list_; |
| 897 | }; | 890 | }; |
| 898 | 891 | ||
| 892 | struct sortvec | ||
| 893 | { | ||
| 894 | Lisp_Object overlay; | ||
| 895 | ptrdiff_t beg, end; | ||
| 896 | EMACS_INT priority; | ||
| 897 | EMACS_INT spriority; /* Secondary priority. */ | ||
| 898 | }; | ||
| 899 | |||
| 899 | INLINE bool | 900 | INLINE bool |
| 900 | BUFFERP (Lisp_Object a) | 901 | BUFFERP (Lisp_Object a) |
| 901 | { | 902 | { |
| @@ -1109,8 +1110,11 @@ extern void delete_all_overlays (struct buffer *); | |||
| 1109 | extern void reset_buffer (struct buffer *); | 1110 | extern void reset_buffer (struct buffer *); |
| 1110 | extern void compact_buffer (struct buffer *); | 1111 | extern void compact_buffer (struct buffer *); |
| 1111 | extern void evaporate_overlays (ptrdiff_t); | 1112 | extern void evaporate_overlays (ptrdiff_t); |
| 1112 | extern ptrdiff_t overlays_at (EMACS_INT, bool, Lisp_Object **, | 1113 | extern ptrdiff_t overlays_at (ptrdiff_t, bool, Lisp_Object **, ptrdiff_t *, ptrdiff_t *); |
| 1113 | ptrdiff_t *, ptrdiff_t *, ptrdiff_t *, bool); | 1114 | extern ptrdiff_t overlays_in (ptrdiff_t, ptrdiff_t, bool, Lisp_Object **, |
| 1115 | ptrdiff_t *, bool, ptrdiff_t *); | ||
| 1116 | extern ptrdiff_t previous_overlay_change (ptrdiff_t); | ||
| 1117 | extern ptrdiff_t next_overlay_change (ptrdiff_t); | ||
| 1114 | extern ptrdiff_t sort_overlays (Lisp_Object *, ptrdiff_t, struct window *); | 1118 | extern ptrdiff_t sort_overlays (Lisp_Object *, ptrdiff_t, struct window *); |
| 1115 | extern void recenter_overlay_lists (struct buffer *, ptrdiff_t); | 1119 | extern void recenter_overlay_lists (struct buffer *, ptrdiff_t); |
| 1116 | extern ptrdiff_t overlay_strings (ptrdiff_t, struct window *, unsigned char **); | 1120 | extern ptrdiff_t overlay_strings (ptrdiff_t, struct window *, unsigned char **); |
| @@ -1162,18 +1166,16 @@ record_unwind_current_buffer (void) | |||
| 1162 | If NEXTP is non-NULL, return next overlay there. | 1166 | If NEXTP is non-NULL, return next overlay there. |
| 1163 | See overlay_at arg CHANGE_REQ for meaning of CHRQ arg. */ | 1167 | See overlay_at arg CHANGE_REQ for meaning of CHRQ arg. */ |
| 1164 | 1168 | ||
| 1165 | #define GET_OVERLAYS_AT(posn, overlays, noverlays, nextp, chrq) \ | 1169 | #define GET_OVERLAYS_AT(posn, overlays, noverlays, next) \ |
| 1166 | do { \ | 1170 | do { \ |
| 1167 | ptrdiff_t maxlen = 40; \ | 1171 | ptrdiff_t maxlen = 40; \ |
| 1168 | SAFE_NALLOCA (overlays, 1, maxlen); \ | 1172 | SAFE_NALLOCA (overlays, 1, maxlen); \ |
| 1169 | (noverlays) = overlays_at (posn, false, &(overlays), &maxlen, \ | 1173 | (noverlays) = overlays_at (posn, false, &(overlays), &maxlen, next); \ |
| 1170 | nextp, NULL, chrq); \ | ||
| 1171 | if ((noverlays) > maxlen) \ | 1174 | if ((noverlays) > maxlen) \ |
| 1172 | { \ | 1175 | { \ |
| 1173 | maxlen = noverlays; \ | 1176 | maxlen = noverlays; \ |
| 1174 | SAFE_NALLOCA (overlays, 1, maxlen); \ | 1177 | SAFE_NALLOCA (overlays, 1, maxlen); \ |
| 1175 | (noverlays) = overlays_at (posn, false, &(overlays), &maxlen, \ | 1178 | (noverlays) = overlays_at (posn, false, &(overlays), &maxlen, next); \ |
| 1176 | nextp, NULL, chrq); \ | ||
| 1177 | } \ | 1179 | } \ |
| 1178 | } while (false) | 1180 | } while (false) |
| 1179 | 1181 | ||
| @@ -1208,7 +1210,8 @@ set_buffer_intervals (struct buffer *b, INTERVAL i) | |||
| 1208 | INLINE bool | 1210 | INLINE bool |
| 1209 | buffer_has_overlays (void) | 1211 | buffer_has_overlays (void) |
| 1210 | { | 1212 | { |
| 1211 | return current_buffer->overlays_before || current_buffer->overlays_after; | 1213 | return current_buffer->overlays |
| 1214 | && (interval_tree_size (current_buffer->overlays) > 0); | ||
| 1212 | } | 1215 | } |
| 1213 | 1216 | ||
| 1214 | /* Return character code of multi-byte form at byte position POS. If POS | 1217 | /* Return character code of multi-byte form at byte position POS. If POS |
| @@ -1248,23 +1251,124 @@ buffer_window_count (struct buffer *b) | |||
| 1248 | 1251 | ||
| 1249 | /* Overlays */ | 1252 | /* Overlays */ |
| 1250 | 1253 | ||
| 1251 | /* Return the marker that stands for where OV starts in the buffer. */ | 1254 | INLINE ptrdiff_t |
| 1255 | overlay_start (struct Lisp_Overlay *ov) | ||
| 1256 | { | ||
| 1257 | if (! ov->buffer) | ||
| 1258 | return -1; | ||
| 1259 | return interval_node_begin (ov->buffer->overlays, ov->interval); | ||
| 1260 | } | ||
| 1261 | |||
| 1262 | INLINE ptrdiff_t | ||
| 1263 | overlay_end (struct Lisp_Overlay *ov) | ||
| 1264 | { | ||
| 1265 | if (! ov->buffer) | ||
| 1266 | return -1; | ||
| 1267 | return interval_node_end (ov->buffer->overlays, ov->interval); | ||
| 1268 | } | ||
| 1269 | |||
| 1270 | INLINE void | ||
| 1271 | set_overlay_region (struct Lisp_Overlay *ov, ptrdiff_t begin, ptrdiff_t end) | ||
| 1272 | { | ||
| 1273 | eassert (ov->buffer); | ||
| 1274 | begin = clip_to_bounds (BEG, begin, ov->buffer->text->z); | ||
| 1275 | end = clip_to_bounds (begin, end, ov->buffer->text->z); | ||
| 1276 | interval_node_set_region (ov->buffer->overlays, ov->interval, begin, end); | ||
| 1277 | } | ||
| 1278 | |||
| 1279 | INLINE void | ||
| 1280 | maybe_alloc_buffer_overlays (struct buffer *b) | ||
| 1281 | { | ||
| 1282 | if (! b->overlays) | ||
| 1283 | b->overlays = interval_tree_create (); | ||
| 1284 | } | ||
| 1285 | |||
| 1286 | /* FIXME: Actually this does not free any overlay, but the tree | ||
| 1287 | only. --ap */ | ||
| 1288 | |||
| 1289 | INLINE void | ||
| 1290 | free_buffer_overlays (struct buffer *b) | ||
| 1291 | { | ||
| 1292 | eassert (! b->overlays || 0 == interval_tree_size (b->overlays)); | ||
| 1293 | if (b->overlays) | ||
| 1294 | { | ||
| 1295 | interval_tree_destroy (b->overlays); | ||
| 1296 | b->overlays = NULL; | ||
| 1297 | } | ||
| 1298 | } | ||
| 1299 | |||
| 1300 | INLINE void | ||
| 1301 | add_buffer_overlay (struct buffer *b, struct Lisp_Overlay *ov) | ||
| 1302 | { | ||
| 1303 | eassert (! ov->buffer); | ||
| 1304 | maybe_alloc_buffer_overlays (b); | ||
| 1305 | ov->buffer = b; | ||
| 1306 | interval_tree_insert (b->overlays, ov->interval); | ||
| 1307 | } | ||
| 1308 | |||
| 1309 | INLINE void | ||
| 1310 | remove_buffer_overlay (struct buffer *b, struct Lisp_Overlay *ov) | ||
| 1311 | { | ||
| 1312 | eassert (b->overlays); | ||
| 1313 | eassert (ov->buffer == b); | ||
| 1314 | interval_tree_remove (ov->buffer->overlays, ov->interval); | ||
| 1315 | ov->buffer = NULL; | ||
| 1316 | } | ||
| 1317 | |||
| 1318 | INLINE void | ||
| 1319 | buffer_overlay_iter_start (struct buffer *b, ptrdiff_t begin, ptrdiff_t end, | ||
| 1320 | enum interval_tree_order order) | ||
| 1321 | { | ||
| 1322 | if (b->overlays) | ||
| 1323 | interval_tree_iter_start (b->overlays, begin, end, order); | ||
| 1324 | } | ||
| 1325 | |||
| 1326 | INLINE struct interval_node* | ||
| 1327 | buffer_overlay_iter_next (struct buffer *b) | ||
| 1328 | { | ||
| 1329 | if (! b->overlays) | ||
| 1330 | return NULL; | ||
| 1331 | return interval_tree_iter_next (b->overlays); | ||
| 1332 | } | ||
| 1333 | |||
| 1334 | INLINE void | ||
| 1335 | buffer_overlay_iter_finish (struct buffer *b) | ||
| 1336 | { | ||
| 1337 | if (b->overlays) | ||
| 1338 | interval_tree_iter_finish (b->overlays); | ||
| 1339 | } | ||
| 1340 | |||
| 1341 | INLINE void | ||
| 1342 | buffer_overlay_iter_narrow (struct buffer *b, ptrdiff_t begin, ptrdiff_t end) | ||
| 1343 | { | ||
| 1344 | if (b->overlays) | ||
| 1345 | interval_tree_iter_narrow (b->overlays, begin, end); | ||
| 1346 | } | ||
| 1252 | 1347 | ||
| 1253 | #define OVERLAY_START(OV) XOVERLAY (OV)->start | 1348 | /* Return the start of OV in its buffer, or -1 if OV is not associated |
| 1349 | with any buffer. */ | ||
| 1254 | 1350 | ||
| 1255 | /* Return the marker that stands for where OV ends in the buffer. */ | 1351 | #define OVERLAY_START(OV) (overlay_start (XOVERLAY (OV))) |
| 1256 | 1352 | ||
| 1257 | #define OVERLAY_END(OV) XOVERLAY (OV)->end | 1353 | /* Return the end of OV in its buffer, or -1. */ |
| 1354 | |||
| 1355 | #define OVERLAY_END(OV) (overlay_end (XOVERLAY (OV))) | ||
| 1258 | 1356 | ||
| 1259 | /* Return the plist of overlay OV. */ | 1357 | /* Return the plist of overlay OV. */ |
| 1260 | 1358 | ||
| 1261 | #define OVERLAY_PLIST(OV) XOVERLAY (OV)->plist | 1359 | #define OVERLAY_PLIST(OV) (XOVERLAY (OV)->plist) |
| 1360 | |||
| 1361 | /* Return the buffer of overlay OV. */ | ||
| 1362 | |||
| 1363 | #define OVERLAY_BUFFER(OV) (XOVERLAY (OV)->buffer) | ||
| 1262 | 1364 | ||
| 1263 | /* Return the actual buffer position for the marker P. | 1365 | /* Return true, if OV's rear-advance is set. */ |
| 1264 | We assume you know which buffer it's pointing into. */ | ||
| 1265 | 1366 | ||
| 1266 | #define OVERLAY_POSITION(P) \ | 1367 | #define OVERLAY_REAR_ADVANCE_P(OV) (XOVERLAY (OV)->interval->rear_advance) |
| 1267 | (MARKERP (P) ? marker_position (P) : (emacs_abort (), 0)) | 1368 | |
| 1369 | /* Return true, if OV's front-advance is set. */ | ||
| 1370 | |||
| 1371 | #define OVERLAY_FRONT_ADVANCE_P(OV) (XOVERLAY (OV)->interval->front_advance) | ||
| 1268 | 1372 | ||
| 1269 | 1373 | ||
| 1270 | /*********************************************************************** | 1374 | /*********************************************************************** |
| @@ -1405,4 +1509,7 @@ lowercasep (int c) | |||
| 1405 | 1509 | ||
| 1406 | INLINE_HEADER_END | 1510 | INLINE_HEADER_END |
| 1407 | 1511 | ||
| 1512 | int compare_overlays (const void *v1, const void *v2); | ||
| 1513 | void make_sortvec_item (struct sortvec *item, Lisp_Object overlay); | ||
| 1514 | |||
| 1408 | #endif /* EMACS_BUFFER_H */ | 1515 | #endif /* EMACS_BUFFER_H */ |
diff --git a/src/editfns.c b/src/editfns.c index 4dcf7cbe6ef..8628b1b2d49 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -457,51 +457,9 @@ If you set the marker not to point anywhere, the buffer will have no mark. */) | |||
| 457 | of length LEN. */ | 457 | of length LEN. */ |
| 458 | 458 | ||
| 459 | static ptrdiff_t | 459 | static ptrdiff_t |
| 460 | overlays_around (EMACS_INT pos, Lisp_Object *vec, ptrdiff_t len) | 460 | overlays_around (ptrdiff_t pos, Lisp_Object *vec, ptrdiff_t len) |
| 461 | { | 461 | { |
| 462 | Lisp_Object overlay, start, end; | 462 | return overlays_in (pos - 1, pos, false, &vec, &len, false, NULL); |
| 463 | struct Lisp_Overlay *tail; | ||
| 464 | ptrdiff_t startpos, endpos; | ||
| 465 | ptrdiff_t idx = 0; | ||
| 466 | |||
| 467 | for (tail = current_buffer->overlays_before; tail; tail = tail->next) | ||
| 468 | { | ||
| 469 | XSETMISC (overlay, tail); | ||
| 470 | |||
| 471 | end = OVERLAY_END (overlay); | ||
| 472 | endpos = OVERLAY_POSITION (end); | ||
| 473 | if (endpos < pos) | ||
| 474 | break; | ||
| 475 | start = OVERLAY_START (overlay); | ||
| 476 | startpos = OVERLAY_POSITION (start); | ||
| 477 | if (startpos <= pos) | ||
| 478 | { | ||
| 479 | if (idx < len) | ||
| 480 | vec[idx] = overlay; | ||
| 481 | /* Keep counting overlays even if we can't return them all. */ | ||
| 482 | idx++; | ||
| 483 | } | ||
| 484 | } | ||
| 485 | |||
| 486 | for (tail = current_buffer->overlays_after; tail; tail = tail->next) | ||
| 487 | { | ||
| 488 | XSETMISC (overlay, tail); | ||
| 489 | |||
| 490 | start = OVERLAY_START (overlay); | ||
| 491 | startpos = OVERLAY_POSITION (start); | ||
| 492 | if (pos < startpos) | ||
| 493 | break; | ||
| 494 | end = OVERLAY_END (overlay); | ||
| 495 | endpos = OVERLAY_POSITION (end); | ||
| 496 | if (pos <= endpos) | ||
| 497 | { | ||
| 498 | if (idx < len) | ||
| 499 | vec[idx] = overlay; | ||
| 500 | idx++; | ||
| 501 | } | ||
| 502 | } | ||
| 503 | |||
| 504 | return idx; | ||
| 505 | } | 463 | } |
| 506 | 464 | ||
| 507 | DEFUN ("get-pos-property", Fget_pos_property, Sget_pos_property, 2, 3, 0, | 465 | DEFUN ("get-pos-property", Fget_pos_property, Sget_pos_property, 2, 3, 0, |
| @@ -561,11 +519,10 @@ at POSITION. */) | |||
| 561 | if (!NILP (tem)) | 519 | if (!NILP (tem)) |
| 562 | { | 520 | { |
| 563 | /* Check the overlay is indeed active at point. */ | 521 | /* Check the overlay is indeed active at point. */ |
| 564 | Lisp_Object start = OVERLAY_START (ol), finish = OVERLAY_END (ol); | 522 | if ((OVERLAY_START (ol) == posn |
| 565 | if ((OVERLAY_POSITION (start) == posn | 523 | && OVERLAY_FRONT_ADVANCE_P (ol)) |
| 566 | && XMARKER (start)->insertion_type == 1) | 524 | || (OVERLAY_END (ol) == posn |
| 567 | || (OVERLAY_POSITION (finish) == posn | 525 | && ! OVERLAY_REAR_ADVANCE_P (ol))) |
| 568 | && XMARKER (finish)->insertion_type == 0)) | ||
| 569 | ; /* The overlay will not cover a char inserted at point. */ | 526 | ; /* The overlay will not cover a char inserted at point. */ |
| 570 | else | 527 | else |
| 571 | { | 528 | { |
| @@ -5385,7 +5342,6 @@ Transposing beyond buffer boundaries is an error. */) | |||
| 5385 | transpose_markers (start1, end1, start2, end2, | 5342 | transpose_markers (start1, end1, start2, end2, |
| 5386 | start1_byte, start1_byte + len1_byte, | 5343 | start1_byte, start1_byte + len1_byte, |
| 5387 | start2_byte, start2_byte + len2_byte); | 5344 | start2_byte, start2_byte + len2_byte); |
| 5388 | fix_start_end_in_overlays (start1, end2); | ||
| 5389 | } | 5345 | } |
| 5390 | else | 5346 | else |
| 5391 | { | 5347 | { |
diff --git a/src/fileio.c b/src/fileio.c index 11370279d1b..6b22b29aa70 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -3656,8 +3656,7 @@ by calling `format-decode', which see. */) | |||
| 3656 | bset_read_only (buf, Qnil); | 3656 | bset_read_only (buf, Qnil); |
| 3657 | bset_filename (buf, Qnil); | 3657 | bset_filename (buf, Qnil); |
| 3658 | bset_undo_list (buf, Qt); | 3658 | bset_undo_list (buf, Qt); |
| 3659 | eassert (buf->overlays_before == NULL); | 3659 | eassert (buf->overlays == NULL); |
| 3660 | eassert (buf->overlays_after == NULL); | ||
| 3661 | 3660 | ||
| 3662 | set_buffer_internal (buf); | 3661 | set_buffer_internal (buf); |
| 3663 | Ferase_buffer (); | 3662 | Ferase_buffer (); |
| @@ -2240,10 +2240,9 @@ internal_equal (Lisp_Object o1, Lisp_Object o2, enum equal_kind equal_kind, | |||
| 2240 | return false; | 2240 | return false; |
| 2241 | if (OVERLAYP (o1)) | 2241 | if (OVERLAYP (o1)) |
| 2242 | { | 2242 | { |
| 2243 | if (!internal_equal (OVERLAY_START (o1), OVERLAY_START (o2), | 2243 | if (OVERLAY_START (o1) != OVERLAY_START (o2) |
| 2244 | equal_kind, depth + 1, ht) | 2244 | || OVERLAY_END (o1) != OVERLAY_END (o2) |
| 2245 | || !internal_equal (OVERLAY_END (o1), OVERLAY_END (o2), | 2245 | || OVERLAY_BUFFER (o1) != OVERLAY_BUFFER (o2)) |
| 2246 | equal_kind, depth + 1, ht)) | ||
| 2247 | return false; | 2246 | return false; |
| 2248 | o1 = XOVERLAY (o1)->plist; | 2247 | o1 = XOVERLAY (o1)->plist; |
| 2249 | o2 = XOVERLAY (o2)->plist; | 2248 | o2 = XOVERLAY (o2)->plist; |
diff --git a/src/indent.c b/src/indent.c index 26507b5eb5b..8ac7c6ef109 100644 --- a/src/indent.c +++ b/src/indent.c | |||
| @@ -225,9 +225,6 @@ skip_invisible (ptrdiff_t pos, ptrdiff_t *next_boundary_p, ptrdiff_t to, Lisp_Ob | |||
| 225 | XSETFASTINT (position, pos); | 225 | XSETFASTINT (position, pos); |
| 226 | XSETBUFFER (buffer, current_buffer); | 226 | XSETBUFFER (buffer, current_buffer); |
| 227 | 227 | ||
| 228 | /* Give faster response for overlay lookup near POS. */ | ||
| 229 | recenter_overlay_lists (current_buffer, pos); | ||
| 230 | |||
| 231 | /* We must not advance farther than the next overlay change. | 228 | /* We must not advance farther than the next overlay change. |
| 232 | The overlay change might change the invisible property; | 229 | The overlay change might change the invisible property; |
| 233 | or there might be overlay strings to be displayed there. */ | 230 | or there might be overlay strings to be displayed there. */ |
| @@ -501,7 +498,7 @@ check_display_width (ptrdiff_t pos, ptrdiff_t col, ptrdiff_t *endpos) | |||
| 501 | { | 498 | { |
| 502 | ptrdiff_t start; | 499 | ptrdiff_t start; |
| 503 | if (OVERLAYP (overlay)) | 500 | if (OVERLAYP (overlay)) |
| 504 | *endpos = OVERLAY_POSITION (OVERLAY_END (overlay)); | 501 | *endpos = OVERLAY_END (overlay); |
| 505 | else | 502 | else |
| 506 | get_property_and_range (pos, Qdisplay, &val, &start, endpos, Qnil); | 503 | get_property_and_range (pos, Qdisplay, &val, &start, endpos, Qnil); |
| 507 | 504 | ||
diff --git a/src/insdel.c b/src/insdel.c index 5dfc62843a7..3e9f0c90e34 100644 --- a/src/insdel.c +++ b/src/insdel.c | |||
| @@ -276,7 +276,6 @@ adjust_markers_for_insert (ptrdiff_t from, ptrdiff_t from_byte, | |||
| 276 | ptrdiff_t to, ptrdiff_t to_byte, bool before_markers) | 276 | ptrdiff_t to, ptrdiff_t to_byte, bool before_markers) |
| 277 | { | 277 | { |
| 278 | struct Lisp_Marker *m; | 278 | struct Lisp_Marker *m; |
| 279 | bool adjusted = 0; | ||
| 280 | ptrdiff_t nchars = to - from; | 279 | ptrdiff_t nchars = to - from; |
| 281 | ptrdiff_t nbytes = to_byte - from_byte; | 280 | ptrdiff_t nbytes = to_byte - from_byte; |
| 282 | 281 | ||
| @@ -292,8 +291,6 @@ adjust_markers_for_insert (ptrdiff_t from, ptrdiff_t from_byte, | |||
| 292 | { | 291 | { |
| 293 | m->bytepos = to_byte; | 292 | m->bytepos = to_byte; |
| 294 | m->charpos = to; | 293 | m->charpos = to; |
| 295 | if (m->insertion_type) | ||
| 296 | adjusted = 1; | ||
| 297 | } | 294 | } |
| 298 | } | 295 | } |
| 299 | else if (m->bytepos > from_byte) | 296 | else if (m->bytepos > from_byte) |
| @@ -302,15 +299,6 @@ adjust_markers_for_insert (ptrdiff_t from, ptrdiff_t from_byte, | |||
| 302 | m->charpos += nchars; | 299 | m->charpos += nchars; |
| 303 | } | 300 | } |
| 304 | } | 301 | } |
| 305 | |||
| 306 | /* Adjusting only markers whose insertion-type is t may result in | ||
| 307 | - disordered start and end in overlays, and | ||
| 308 | - disordered overlays in the slot `overlays_before' of current_buffer. */ | ||
| 309 | if (adjusted) | ||
| 310 | { | ||
| 311 | fix_start_end_in_overlays (from, to); | ||
| 312 | fix_overlays_before (current_buffer, from, to); | ||
| 313 | } | ||
| 314 | } | 302 | } |
| 315 | 303 | ||
| 316 | /* Adjust point for an insertion of NBYTES bytes, which are NCHARS characters. | 304 | /* Adjust point for an insertion of NBYTES bytes, which are NCHARS characters. |
diff --git a/src/intervals.c b/src/intervals.c index e711212d744..3db80ebed4a 100644 --- a/src/intervals.c +++ b/src/intervals.c | |||
| @@ -1810,8 +1810,8 @@ adjust_for_invis_intang (ptrdiff_t pos, ptrdiff_t test_offs, ptrdiff_t adj, | |||
| 1810 | == (test_offs == 0 ? 1 : -1)) | 1810 | == (test_offs == 0 ? 1 : -1)) |
| 1811 | /* Invisible property is from an overlay. */ | 1811 | /* Invisible property is from an overlay. */ |
| 1812 | : (test_offs == 0 | 1812 | : (test_offs == 0 |
| 1813 | ? XMARKER (OVERLAY_START (invis_overlay))->insertion_type == 0 | 1813 | ? ! OVERLAY_FRONT_ADVANCE_P (invis_overlay) |
| 1814 | : XMARKER (OVERLAY_END (invis_overlay))->insertion_type == 1))) | 1814 | : OVERLAY_REAR_ADVANCE_P (invis_overlay)))) |
| 1815 | pos += adj; | 1815 | pos += adj; |
| 1816 | 1816 | ||
| 1817 | return pos; | 1817 | return pos; |
diff --git a/src/itree.c b/src/itree.c new file mode 100644 index 00000000000..0c10100eef7 --- /dev/null +++ b/src/itree.c | |||
| @@ -0,0 +1,1138 @@ | |||
| 1 | /* This file implements an efficient interval data-structure. | ||
| 2 | |||
| 3 | Copyright (C) 2017 Andreas Politz (politza@hochschule-trier.de) | ||
| 4 | |||
| 5 | This file is not part of GNU Emacs. | ||
| 6 | |||
| 7 | GNU Emacs is free software: you can redistribute it and/or modify | ||
| 8 | it under the terms of the GNU General Public License as published by | ||
| 9 | the Free Software Foundation, either version 3 of the License, or (at | ||
| 10 | your option) any later version. | ||
| 11 | |||
| 12 | GNU Emacs is distributed in the hope that it will be useful, | ||
| 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | GNU General Public License for more details. | ||
| 16 | |||
| 17 | You should have received a copy of the GNU General Public License | ||
| 18 | along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | ||
| 19 | |||
| 20 | #include <config.h> | ||
| 21 | #include <math.h> | ||
| 22 | #include "lisp.h" | ||
| 23 | #include "itree.h" | ||
| 24 | |||
| 25 | /* | ||
| 26 | Intervals of the form [BEGIN, END), are stored as nodes inside a RB | ||
| 27 | tree, sorted by BEGIN . The core operation of this tree (besides | ||
| 28 | insert, remove, etc.) is finding all intervals intersecting with | ||
| 29 | some given interval. In order to perform this operation | ||
| 30 | efficiently, every node stores a third value called LIMIT. (See | ||
| 31 | https://en.wikipedia.org/wiki/Interval_tree#Augmented_tree and its | ||
| 32 | source Introduction to Algorithms (Section 14.3), Cormen et al. .) | ||
| 33 | |||
| 34 | ==== Finding intervals ==== | ||
| 35 | |||
| 36 | If we search for all intervals intersecting with (X, Y], we look at | ||
| 37 | some node and test whether | ||
| 38 | |||
| 39 | NODE.BEGIN > Y | ||
| 40 | |||
| 41 | Due to the invariant of the search tree, we know, that we may | ||
| 42 | safely prune NODE's right subtree if this test succeeds, since all | ||
| 43 | intervals begin strictly after Y. | ||
| 44 | |||
| 45 | But we can not make such an assumptions about the left tree, since | ||
| 46 | all we know is that the intervals in this subtree must start before | ||
| 47 | or at NODE.BEGIN. So we can't tell, whether they end before X or | ||
| 48 | not. To solve this problem we add another attribute to each node, | ||
| 49 | called LIMIT. | ||
| 50 | |||
| 51 | The LIMIT of a node is the largest END value occurring in the nodes | ||
| 52 | subtree (including the node itself). Thus, we may look at the left | ||
| 53 | child of some NODE and test whether | ||
| 54 | |||
| 55 | NODE.left.LIMIT < X | ||
| 56 | |||
| 57 | and this tells us, if all intervals in the left subtree of NODE end | ||
| 58 | before X and if they can be pruned. | ||
| 59 | |||
| 60 | Conversely, if this inequality is false, the left subtree must | ||
| 61 | contain at least one intersecting interval, giving a resulting time | ||
| 62 | complexity of O(K*log(N)) for this operation, where K is the size | ||
| 63 | of the result set and N the size of the tree. | ||
| 64 | |||
| 65 | ==== Adjusting intervals ==== | ||
| 66 | |||
| 67 | Since this data-structure will be used for overlays in an Emacs | ||
| 68 | buffer, a second core operation implements the ability to insert or | ||
| 69 | delete gaps in resp. from the tree. This models the insertion | ||
| 70 | resp. deletion of text in a buffer and the effects it may have on | ||
| 71 | the positions of overlays. | ||
| 72 | |||
| 73 | Consider this: Something gets inserted at position P into a buffer | ||
| 74 | and assume that all overlays occur strictly after P. Ordinarily, | ||
| 75 | we would have to iterate all overlays and increment their BEGIN and | ||
| 76 | END values accordingly (the insertion of text pushes them back). | ||
| 77 | In order to avoid this, we introduce yet another node attribute, | ||
| 78 | called OFFSET. | ||
| 79 | |||
| 80 | The OFFSET of some some subtree, represented by its root, is the | ||
| 81 | amount of shift that needs to be applied to its BEGIN, END and | ||
| 82 | LIMIT values, in order to get to the real values. Coming back to | ||
| 83 | the example, all we would need to do in this case, is to increment | ||
| 84 | the OFFSET of the tree's root, without any traversal of the tree | ||
| 85 | itself. | ||
| 86 | |||
| 87 | As a consequence, the real values of BEGIN, END and LIMIT of some | ||
| 88 | NODE need to be computed by incrementing them by the sum of NODE's | ||
| 89 | OFFSET and all of its ancestors offsets. Therefore, we store a | ||
| 90 | counter (otick) inside every node and also the tree, by which we | ||
| 91 | remember the fact, that a node's path to the root has no offsets | ||
| 92 | applied (i.e. its values are up to date). This is the case if some | ||
| 93 | node's value differs from the tree's one, the later of which is | ||
| 94 | incremented whenever some node's offset has changed. | ||
| 95 | */ | ||
| 96 | |||
| 97 | static struct interval_node *interval_tree_validate(struct interval_tree *, struct interval_node *); | ||
| 98 | static void interval_generator_ensure_space(struct interval_generator *); | ||
| 99 | static bool interval_node_intersects(const struct interval_node *, ptrdiff_t, ptrdiff_t); | ||
| 100 | static int interval_tree_max_height(const struct interval_tree *); | ||
| 101 | static struct interval_stack *interval_stack_create(intmax_t); | ||
| 102 | static void interval_stack_destroy(struct interval_stack *); | ||
| 103 | static void interval_stack_clear(struct interval_stack *); | ||
| 104 | static void interval_stack_ensure_space(struct interval_stack *, intmax_t); | ||
| 105 | static void interval_stack_push(struct interval_stack *, struct interval_node *); | ||
| 106 | static void interval_stack_push_flagged(struct interval_stack *, struct interval_node *, bool); | ||
| 107 | static struct interval_node *interval_stack_pop(struct interval_stack *); | ||
| 108 | static void interval_tree_update_limit(const struct interval_tree *, struct interval_node *); | ||
| 109 | static void interval_tree_inherit_offset(const struct interval_tree *, struct interval_node *); | ||
| 110 | static void interval_tree_propagate_limit(const struct interval_tree *, struct interval_node *); | ||
| 111 | static void interval_tree_rotate_left(struct interval_tree *, struct interval_node *); | ||
| 112 | static void interval_tree_rotate_right(struct interval_tree *, struct interval_node *); | ||
| 113 | static void interval_tree_insert_fix(struct interval_tree *, struct interval_node *); | ||
| 114 | static void interval_tree_remove_fix(struct interval_tree *, struct interval_node *); | ||
| 115 | static void interval_tree_transplant(struct interval_tree *, struct interval_node *, struct interval_node *); | ||
| 116 | static struct interval_node *interval_tree_subtree_min(const struct interval_tree *, struct interval_node *); | ||
| 117 | static struct interval_generator* interval_generator_create (struct interval_tree *); | ||
| 118 | static void interval_generator_destroy (struct interval_generator *); | ||
| 119 | static void interval_generator_reset (struct interval_generator *, | ||
| 120 | ptrdiff_t, ptrdiff_t, | ||
| 121 | enum interval_tree_order); | ||
| 122 | static void | ||
| 123 | interval_generator_narrow (struct interval_generator *g, | ||
| 124 | ptrdiff_t begin, ptrdiff_t end); | ||
| 125 | static inline struct interval_node* | ||
| 126 | interval_generator_next (struct interval_generator *g); | ||
| 127 | static inline void interval_tree_iter_ensure_space(struct interval_tree *); | ||
| 128 | |||
| 129 | |||
| 130 | |||
| 131 | /* +------------------------------------------------------------------------------------+ */ | ||
| 132 | |||
| 133 | /* Simple dynamic array. */ | ||
| 134 | struct interval_stack | ||
| 135 | { | ||
| 136 | struct interval_node **nodes; | ||
| 137 | size_t size; | ||
| 138 | size_t length; | ||
| 139 | }; | ||
| 140 | |||
| 141 | /* State used when iterating interval. */ | ||
| 142 | struct interval_generator | ||
| 143 | { | ||
| 144 | struct interval_tree *tree; | ||
| 145 | struct interval_stack *stack; | ||
| 146 | ptrdiff_t begin; | ||
| 147 | ptrdiff_t end; | ||
| 148 | enum interval_tree_order order; | ||
| 149 | }; | ||
| 150 | |||
| 151 | |||
| 152 | |||
| 153 | /* +===================================================================================+ | ||
| 154 | * | Tree operations | ||
| 155 | * +===================================================================================+ */ | ||
| 156 | |||
| 157 | /* Initialize an allocated node. */ | ||
| 158 | |||
| 159 | void | ||
| 160 | interval_node_init (struct interval_node *node, | ||
| 161 | ptrdiff_t begin, ptrdiff_t end, | ||
| 162 | bool front_advance, bool rear_advance, | ||
| 163 | Lisp_Object data) | ||
| 164 | { | ||
| 165 | node->begin = begin; | ||
| 166 | node->end = max (begin, end); | ||
| 167 | node->front_advance = front_advance; | ||
| 168 | node->rear_advance = rear_advance; | ||
| 169 | node->data = data; | ||
| 170 | } | ||
| 171 | |||
| 172 | /* Return NODE's begin value, computing it if necessary. */ | ||
| 173 | |||
| 174 | ptrdiff_t | ||
| 175 | interval_node_begin (struct interval_tree *tree, | ||
| 176 | struct interval_node *node) | ||
| 177 | { | ||
| 178 | interval_tree_validate (tree, node); | ||
| 179 | return node->begin; | ||
| 180 | } | ||
| 181 | |||
| 182 | /* Return NODE's end value, computing it if necessary. */ | ||
| 183 | |||
| 184 | ptrdiff_t | ||
| 185 | interval_node_end (struct interval_tree *tree, | ||
| 186 | struct interval_node *node) | ||
| 187 | { | ||
| 188 | interval_tree_validate (tree, node); | ||
| 189 | return node->end; | ||
| 190 | } | ||
| 191 | |||
| 192 | /* Safely modify a node's interval. */ | ||
| 193 | |||
| 194 | void | ||
| 195 | interval_node_set_region (struct interval_tree *tree, | ||
| 196 | struct interval_node *node, | ||
| 197 | ptrdiff_t begin, ptrdiff_t end) | ||
| 198 | { | ||
| 199 | interval_tree_validate (tree, node); | ||
| 200 | if (begin != node->begin) | ||
| 201 | { | ||
| 202 | interval_tree_remove (tree, node); | ||
| 203 | node->begin = min (begin, PTRDIFF_MAX - 1); | ||
| 204 | node->end = max (node->begin, end); | ||
| 205 | interval_tree_insert (tree, node); | ||
| 206 | } | ||
| 207 | else if (end != node->end) | ||
| 208 | { | ||
| 209 | node->end = max (node->begin, end); | ||
| 210 | interval_tree_propagate_limit (tree, node); | ||
| 211 | } | ||
| 212 | } | ||
| 213 | |||
| 214 | /* Allocate an interval_tree. Free with interval_tree_destroy. */ | ||
| 215 | |||
| 216 | struct interval_tree* | ||
| 217 | interval_tree_create (void) | ||
| 218 | { | ||
| 219 | struct interval_tree *tree = xmalloc (sizeof (*tree)); | ||
| 220 | interval_tree_clear (tree); | ||
| 221 | tree->iter = interval_generator_create (tree); | ||
| 222 | return tree; | ||
| 223 | } | ||
| 224 | |||
| 225 | /* Reset the tree TREE to its empty state. */ | ||
| 226 | |||
| 227 | void | ||
| 228 | interval_tree_clear (struct interval_tree *tree) | ||
| 229 | { | ||
| 230 | struct interval_node *nil = &tree->nil; | ||
| 231 | nil->left = nil->right = nil->parent = nil; | ||
| 232 | nil->offset = nil->otick = 0; | ||
| 233 | nil->begin = PTRDIFF_MIN; | ||
| 234 | nil->end = PTRDIFF_MIN; | ||
| 235 | nil->limit = PTRDIFF_MIN; /* => max(x, nil.limit) = x */ | ||
| 236 | nil->color = ITREE_BLACK; | ||
| 237 | tree->root = nil; | ||
| 238 | tree->otick = 1; | ||
| 239 | tree->size = 0; | ||
| 240 | tree->iter_running = 0; | ||
| 241 | } | ||
| 242 | |||
| 243 | #ifdef ITREE_TESTING | ||
| 244 | /* Initialize a pre-allocated tree (presumably on the stack). */ | ||
| 245 | |||
| 246 | static void | ||
| 247 | interval_tree_init (struct interval_tree *tree) | ||
| 248 | { | ||
| 249 | interval_tree_clear (tree); | ||
| 250 | tree->iter = interval_generator_create (tree); | ||
| 251 | } | ||
| 252 | #endif | ||
| 253 | |||
| 254 | /* Release a tree, freeing its allocated memory. */ | ||
| 255 | void | ||
| 256 | interval_tree_destroy (struct interval_tree *tree) | ||
| 257 | { | ||
| 258 | if (! tree) | ||
| 259 | return; | ||
| 260 | if (tree->iter) | ||
| 261 | interval_generator_destroy (tree->iter); | ||
| 262 | xfree (tree); | ||
| 263 | } | ||
| 264 | |||
| 265 | /* Return the number of nodes in TREE. */ | ||
| 266 | |||
| 267 | intmax_t | ||
| 268 | interval_tree_size (struct interval_tree *tree) | ||
| 269 | { | ||
| 270 | return tree->size; | ||
| 271 | } | ||
| 272 | |||
| 273 | /* Insert a NODE into the TREE. | ||
| 274 | |||
| 275 | Note, that inserting a node twice results in undefined behaviour. | ||
| 276 | */ | ||
| 277 | |||
| 278 | void | ||
| 279 | interval_tree_insert (struct interval_tree *tree, struct interval_node *node) | ||
| 280 | { | ||
| 281 | eassert (node && node->begin <= node->end && node != &tree->nil); | ||
| 282 | |||
| 283 | struct interval_node *parent = &tree->nil; | ||
| 284 | struct interval_node *child = tree->root; | ||
| 285 | ptrdiff_t offset = 0; | ||
| 286 | |||
| 287 | /* Find the insertion point, accumulate node's offset and update | ||
| 288 | ancestors limit values. */ | ||
| 289 | while (child != &tree->nil) | ||
| 290 | { | ||
| 291 | parent = child; | ||
| 292 | offset += child->offset; | ||
| 293 | child->limit = max (child->limit, node->end - offset); | ||
| 294 | /* This suggests that nodes in the right subtree are strictly | ||
| 295 | greater. But this is not true due to later rotations. */ | ||
| 296 | child = node->begin <= child->begin ? child->left : child->right; | ||
| 297 | } | ||
| 298 | |||
| 299 | /* Insert the node */ | ||
| 300 | if (parent == &tree->nil) | ||
| 301 | tree->root = node; | ||
| 302 | else if (node->begin <= parent->begin) | ||
| 303 | parent->left = node; | ||
| 304 | else | ||
| 305 | parent->right = node; | ||
| 306 | |||
| 307 | /* Init the node */ | ||
| 308 | node->parent = parent; | ||
| 309 | node->left = &tree->nil; | ||
| 310 | node->right = &tree->nil; | ||
| 311 | node->color = ITREE_RED; | ||
| 312 | node->offset = offset; | ||
| 313 | node->limit = node->end; | ||
| 314 | node->otick = tree->otick - 1; | ||
| 315 | |||
| 316 | /* Fix/update the tree */ | ||
| 317 | ++tree->size; | ||
| 318 | interval_tree_insert_fix (tree, node); | ||
| 319 | interval_tree_iter_ensure_space (tree); | ||
| 320 | } | ||
| 321 | |||
| 322 | /* Return true, if NODE is a member of TREE. */ | ||
| 323 | |||
| 324 | bool | ||
| 325 | interval_tree_contains (struct interval_tree *tree, struct interval_node *node) | ||
| 326 | { | ||
| 327 | struct interval_node *other; | ||
| 328 | |||
| 329 | interval_tree_iter_start (tree, node->begin, PTRDIFF_MAX, ITREE_ASCENDING); | ||
| 330 | while ((other = interval_tree_iter_next (tree))) | ||
| 331 | if (other == node) | ||
| 332 | break; | ||
| 333 | |||
| 334 | interval_tree_iter_finish (tree); | ||
| 335 | return other == node; | ||
| 336 | } | ||
| 337 | |||
| 338 | /* Remove NODE from TREE and return it. NODE must exist in TREE.*/ | ||
| 339 | |||
| 340 | struct interval_node* | ||
| 341 | interval_tree_remove (struct interval_tree *tree, struct interval_node *node) | ||
| 342 | { | ||
| 343 | eassert (interval_tree_contains (tree, node)); | ||
| 344 | |||
| 345 | struct interval_node *broken = NULL; | ||
| 346 | |||
| 347 | interval_tree_inherit_offset (tree, node); | ||
| 348 | if (node->left == &tree->nil || node->right == &tree->nil) | ||
| 349 | { | ||
| 350 | struct interval_node *subst = | ||
| 351 | (node->right == &tree->nil) ? node->left : node->right; | ||
| 352 | if (node->color == ITREE_BLACK) | ||
| 353 | broken = subst; | ||
| 354 | interval_tree_transplant (tree, subst, node); | ||
| 355 | interval_tree_propagate_limit (tree, subst); | ||
| 356 | } | ||
| 357 | else | ||
| 358 | { | ||
| 359 | struct interval_node *min = interval_tree_subtree_min (tree, node->right); | ||
| 360 | struct interval_node *min_right = min->right; | ||
| 361 | |||
| 362 | if (min->color == ITREE_BLACK) | ||
| 363 | broken = min->right; | ||
| 364 | if (min->parent == node) | ||
| 365 | min_right->parent = min; /* set parent, if min_right = nil */ | ||
| 366 | else | ||
| 367 | { | ||
| 368 | interval_tree_transplant (tree, min->right, min); | ||
| 369 | min->right = node->right; | ||
| 370 | min->right->parent = min; | ||
| 371 | } | ||
| 372 | interval_tree_inherit_offset (tree, min); | ||
| 373 | interval_tree_transplant (tree, min, node); | ||
| 374 | min->left = node->left; | ||
| 375 | min->left->parent = min; | ||
| 376 | min->color = node->color; | ||
| 377 | interval_tree_propagate_limit (tree, min_right); | ||
| 378 | interval_tree_propagate_limit (tree, min); | ||
| 379 | } | ||
| 380 | |||
| 381 | if (broken) | ||
| 382 | interval_tree_remove_fix (tree, broken); | ||
| 383 | |||
| 384 | node->right = node->left = node->parent = NULL; | ||
| 385 | --tree->size; | ||
| 386 | |||
| 387 | eassert (tree->size == 0 || (tree->size > 0 && tree->root != &tree->nil)); | ||
| 388 | |||
| 389 | return node; | ||
| 390 | } | ||
| 391 | |||
| 392 | static struct interval_node* | ||
| 393 | interval_tree_validate (struct interval_tree *tree, struct interval_node *node) | ||
| 394 | { | ||
| 395 | |||
| 396 | if (tree->otick == node->otick || node == &tree->nil) | ||
| 397 | return node; | ||
| 398 | if (node != tree->root) | ||
| 399 | interval_tree_validate (tree, node->parent); | ||
| 400 | |||
| 401 | interval_tree_inherit_offset (tree, node); | ||
| 402 | return node; | ||
| 403 | } | ||
| 404 | |||
| 405 | /* Start a generator iterating all intervals in [BEGIN,END) in the | ||
| 406 | given ORDER. Only one iterator per tree can be running at any | ||
| 407 | time. | ||
| 408 | */ | ||
| 409 | |||
| 410 | void | ||
| 411 | interval_tree_iter_start (struct interval_tree *tree, | ||
| 412 | ptrdiff_t begin, ptrdiff_t end, | ||
| 413 | enum interval_tree_order order) | ||
| 414 | { | ||
| 415 | if (tree->iter_running) | ||
| 416 | emacs_abort (); | ||
| 417 | interval_generator_reset (tree->iter, begin, end, order); | ||
| 418 | tree->iter_running = 1; | ||
| 419 | } | ||
| 420 | |||
| 421 | /* Limit the search interval of the iterator to the given values. The | ||
| 422 | interval can only shrink, but never grow.*/ | ||
| 423 | |||
| 424 | inline void | ||
| 425 | interval_tree_iter_narrow(struct interval_tree *tree, | ||
| 426 | ptrdiff_t begin, ptrdiff_t end) | ||
| 427 | { | ||
| 428 | if (! tree->iter_running) | ||
| 429 | emacs_abort (); | ||
| 430 | interval_generator_narrow (tree->iter, begin, end); | ||
| 431 | } | ||
| 432 | |||
| 433 | /* Stop using the iterator. */ | ||
| 434 | |||
| 435 | void | ||
| 436 | interval_tree_iter_finish (struct interval_tree *tree) | ||
| 437 | { | ||
| 438 | if (! tree->iter_running) | ||
| 439 | emacs_abort (); | ||
| 440 | tree->iter_running = 0; | ||
| 441 | } | ||
| 442 | |||
| 443 | /* Return the next node of the iterator in the order given when it was | ||
| 444 | started; or NULL if there are no more nodes. */ | ||
| 445 | |||
| 446 | inline struct interval_node* | ||
| 447 | interval_tree_iter_next (struct interval_tree *tree) | ||
| 448 | { | ||
| 449 | if (! tree->iter_running) | ||
| 450 | emacs_abort (); | ||
| 451 | return interval_generator_next (tree->iter); | ||
| 452 | } | ||
| 453 | |||
| 454 | /* Ensure that the tree's iterator does not need to allocate space | ||
| 455 | until the tree grows in size. */ | ||
| 456 | |||
| 457 | static inline void | ||
| 458 | interval_tree_iter_ensure_space (struct interval_tree *tree) | ||
| 459 | { | ||
| 460 | interval_generator_ensure_space (tree->iter); | ||
| 461 | } | ||
| 462 | |||
| 463 | static int | ||
| 464 | interval_tree_max_height (const struct interval_tree *tree) | ||
| 465 | { | ||
| 466 | return 2 * log (tree->size + 1) / log (2) + 0.5; | ||
| 467 | } | ||
| 468 | |||
| 469 | |||
| 470 | /* +===================================================================================+ | ||
| 471 | * | Insert/Delete Gaps | ||
| 472 | * +===================================================================================+ */ | ||
| 473 | |||
| 474 | /* Insert a gap at POS of length LENGTH expanding all intervals | ||
| 475 | intersecting it, while respecting their rear_advance and | ||
| 476 | front_advance setting. */ | ||
| 477 | |||
| 478 | void | ||
| 479 | interval_tree_insert_gap (struct interval_tree *tree, ptrdiff_t pos, ptrdiff_t length) | ||
| 480 | { | ||
| 481 | if (length <= 0 || tree->size == 0) | ||
| 482 | return; | ||
| 483 | |||
| 484 | /* FIXME: Don't allocate generator/stack anew every time. */ | ||
| 485 | |||
| 486 | /* Nodes with front_advance starting at pos may mess up the tree | ||
| 487 | order, so we need to remove them first. */ | ||
| 488 | struct interval_stack *saved = interval_stack_create (0); | ||
| 489 | struct interval_node *node = NULL; | ||
| 490 | interval_tree_iter_start (tree, pos, pos + 1, ITREE_PRE_ORDER); | ||
| 491 | while ((node = interval_tree_iter_next (tree))) | ||
| 492 | { | ||
| 493 | if (node->begin == pos && node->front_advance | ||
| 494 | && (node->begin != node->end || node->rear_advance)) | ||
| 495 | interval_stack_push (saved, node); | ||
| 496 | } | ||
| 497 | interval_tree_iter_finish (tree); | ||
| 498 | for (int i = 0; i < saved->length; ++i) | ||
| 499 | interval_tree_remove (tree, saved->nodes[i]); | ||
| 500 | |||
| 501 | |||
| 502 | /* We can't use a generator here, because we can't effectively | ||
| 503 | narrow AND shift some subtree at the same time. */ | ||
| 504 | const int size = interval_tree_max_height (tree) + 1; | ||
| 505 | struct interval_stack *stack = interval_stack_create (size); | ||
| 506 | interval_stack_push (stack, tree->root); | ||
| 507 | while ((node = interval_stack_pop (stack))) | ||
| 508 | { | ||
| 509 | /* Process in pre-order. */ | ||
| 510 | interval_tree_inherit_offset (tree, node); | ||
| 511 | if (node->right != &tree->nil) | ||
| 512 | { | ||
| 513 | if (node->begin > pos) | ||
| 514 | { | ||
| 515 | /* All nodes in this subtree are shifted by length. */ | ||
| 516 | node->right->offset += length; | ||
| 517 | ++tree->otick; | ||
| 518 | } | ||
| 519 | else | ||
| 520 | interval_stack_push (stack, node->right); | ||
| 521 | } | ||
| 522 | if (node->left != &tree->nil && pos <= node->left->limit) | ||
| 523 | interval_stack_push (stack, node->left); | ||
| 524 | |||
| 525 | /* node->begin == pos implies no front-advance. */ | ||
| 526 | if (node->begin > pos) | ||
| 527 | node->begin += length; | ||
| 528 | if (node->end > pos || (node->end == pos && node->rear_advance)) | ||
| 529 | { | ||
| 530 | node->end += length; | ||
| 531 | interval_tree_propagate_limit (tree, node); | ||
| 532 | } | ||
| 533 | } | ||
| 534 | interval_stack_destroy (stack); | ||
| 535 | |||
| 536 | /* Reinsert nodes starting at POS having front-advance. */ | ||
| 537 | while ((node = interval_stack_pop (saved))) | ||
| 538 | { | ||
| 539 | node->begin += length; | ||
| 540 | if (node->end != pos || node->rear_advance) | ||
| 541 | node->end += length; | ||
| 542 | interval_tree_insert (tree, node); | ||
| 543 | } | ||
| 544 | |||
| 545 | interval_stack_destroy (saved); | ||
| 546 | } | ||
| 547 | |||
| 548 | /* Delete a gap at POS of length LENGTH, contracting all intervals | ||
| 549 | intersecting it. */ | ||
| 550 | |||
| 551 | void | ||
| 552 | interval_tree_delete_gap (struct interval_tree *tree, ptrdiff_t pos, ptrdiff_t length) | ||
| 553 | { | ||
| 554 | if (length <= 0 || tree->size == 0) | ||
| 555 | return; | ||
| 556 | |||
| 557 | /* FIXME: Don't allocate stack anew every time. */ | ||
| 558 | |||
| 559 | /* Can't use the generator here, because by decrementing begin, we | ||
| 560 | might unintentionally bring shifted nodes back into our search | ||
| 561 | space. */ | ||
| 562 | const int size = interval_tree_max_height (tree) + 1; | ||
| 563 | struct interval_stack *stack = interval_stack_create (size); | ||
| 564 | struct interval_node *node; | ||
| 565 | |||
| 566 | interval_stack_push (stack, tree->root); | ||
| 567 | while ((node = interval_stack_pop (stack))) | ||
| 568 | { | ||
| 569 | interval_tree_inherit_offset (tree, node); | ||
| 570 | if (node->right != &tree->nil) | ||
| 571 | { | ||
| 572 | if (node->begin > pos + length) | ||
| 573 | { | ||
| 574 | /* Shift right subtree to the left. */ | ||
| 575 | node->right->offset -= length; | ||
| 576 | ++tree->otick; | ||
| 577 | } | ||
| 578 | else | ||
| 579 | interval_stack_push (stack, node->right); | ||
| 580 | } | ||
| 581 | if (node->left != &tree->nil && pos <= node->left->limit) | ||
| 582 | interval_stack_push (stack, node->left); | ||
| 583 | |||
| 584 | if (pos < node->begin) | ||
| 585 | node->begin = max (pos, node->begin - length); | ||
| 586 | if (node->end > pos) | ||
| 587 | { | ||
| 588 | node->end = max (pos , node->end - length); | ||
| 589 | interval_tree_propagate_limit (tree, node); | ||
| 590 | } | ||
| 591 | } | ||
| 592 | interval_stack_destroy (stack); | ||
| 593 | } | ||
| 594 | |||
| 595 | |||
| 596 | |||
| 597 | /* +===================================================================================+ | ||
| 598 | * | Generator | ||
| 599 | * +===================================================================================+ */ | ||
| 600 | |||
| 601 | /* Allocate a new generator for TREE. */ | ||
| 602 | |||
| 603 | static struct interval_generator* | ||
| 604 | interval_generator_create (struct interval_tree *tree) | ||
| 605 | { | ||
| 606 | struct interval_generator *g = xmalloc (sizeof *g); | ||
| 607 | const int size = interval_tree_max_height (tree) + 1; | ||
| 608 | |||
| 609 | g->stack = interval_stack_create (size); | ||
| 610 | g->tree = tree; | ||
| 611 | interval_generator_reset (g, 1, 0, 0); | ||
| 612 | return g; | ||
| 613 | } | ||
| 614 | |||
| 615 | /* Reset generator G such that it iterates over intervals intersecting | ||
| 616 | with [BEGIN, END) in the given ORDER. */ | ||
| 617 | |||
| 618 | void | ||
| 619 | interval_generator_reset (struct interval_generator *g, | ||
| 620 | ptrdiff_t begin, ptrdiff_t end, | ||
| 621 | enum interval_tree_order order) | ||
| 622 | { | ||
| 623 | if (! g) return; | ||
| 624 | |||
| 625 | g->begin = begin; | ||
| 626 | g->end = end; | ||
| 627 | g->order = order; | ||
| 628 | interval_stack_clear (g->stack); | ||
| 629 | if (begin <= end && g->tree->size > 0) | ||
| 630 | interval_stack_push_flagged (g->stack, g->tree->root, false); | ||
| 631 | } | ||
| 632 | |||
| 633 | /* Allocate enough space for the tree of G in its current shape. */ | ||
| 634 | |||
| 635 | static inline void | ||
| 636 | interval_generator_ensure_space (struct interval_generator *g) | ||
| 637 | { | ||
| 638 | interval_stack_ensure_space (g->stack, interval_tree_max_height (g->tree) + 1); | ||
| 639 | } | ||
| 640 | |||
| 641 | /* Return true, if NODE's interval intersects with [BEGIN, END). */ | ||
| 642 | |||
| 643 | static inline bool | ||
| 644 | interval_node_intersects (const struct interval_node *node, | ||
| 645 | ptrdiff_t begin, ptrdiff_t end) | ||
| 646 | { | ||
| 647 | return (begin < node->end && node->begin < end) | ||
| 648 | || (node->begin == node->end && begin == node->begin); | ||
| 649 | } | ||
| 650 | |||
| 651 | /* Return the next node of G, or NULL if there is none. */ | ||
| 652 | |||
| 653 | inline struct interval_node* | ||
| 654 | interval_generator_next (struct interval_generator *g) | ||
| 655 | { | ||
| 656 | if (! g) return NULL; | ||
| 657 | |||
| 658 | struct interval_node * const nil = &g->tree->nil; | ||
| 659 | struct interval_node *node; | ||
| 660 | |||
| 661 | do { | ||
| 662 | node = interval_stack_pop (g->stack); | ||
| 663 | |||
| 664 | while (node && ! node->visited) | ||
| 665 | { | ||
| 666 | struct interval_node * const left = node->left; | ||
| 667 | struct interval_node * const right = node->right; | ||
| 668 | |||
| 669 | interval_tree_inherit_offset (g->tree, node); | ||
| 670 | switch (g->order) | ||
| 671 | { | ||
| 672 | case ITREE_ASCENDING: | ||
| 673 | if (right != nil && node->begin <= g->end) | ||
| 674 | interval_stack_push_flagged (g->stack, right, false); | ||
| 675 | if (interval_node_intersects (node, g->begin, g->end)) | ||
| 676 | interval_stack_push_flagged (g->stack, node, true); | ||
| 677 | /* Node's children may still be off-set and we need to add it. */ | ||
| 678 | if (left != nil && g->begin <= left->limit + left->offset) | ||
| 679 | interval_stack_push_flagged (g->stack, left, false); | ||
| 680 | break; | ||
| 681 | case ITREE_DESCENDING: | ||
| 682 | if (left != nil && g->begin <= left->limit + left->offset) | ||
| 683 | interval_stack_push_flagged (g->stack, left, false); | ||
| 684 | if (interval_node_intersects (node, g->begin, g->end)) | ||
| 685 | interval_stack_push_flagged (g->stack, node, true); | ||
| 686 | if (right != nil && node->begin <= g->end) | ||
| 687 | interval_stack_push_flagged (g->stack, right, false); | ||
| 688 | break; | ||
| 689 | case ITREE_PRE_ORDER: | ||
| 690 | if (right != nil && node->begin <= g->end) | ||
| 691 | interval_stack_push_flagged (g->stack, right, false); | ||
| 692 | if (left != nil && g->begin <= left->limit + left->offset) | ||
| 693 | interval_stack_push_flagged (g->stack, left, false); | ||
| 694 | if (interval_node_intersects (node, g->begin, g->end)) | ||
| 695 | interval_stack_push_flagged (g->stack, node, true); | ||
| 696 | break; | ||
| 697 | } | ||
| 698 | node = interval_stack_pop (g->stack); | ||
| 699 | } | ||
| 700 | /* Node may have been invalidated by interval_generator_narrow | ||
| 701 | after it was pushed: Check if it still intersects. */ | ||
| 702 | } while (node && ! interval_node_intersects (node, g->begin, g->end)); | ||
| 703 | |||
| 704 | return node; | ||
| 705 | } | ||
| 706 | |||
| 707 | /* Limit G to the new interval [BEGIN, END), which must be a subset of | ||
| 708 | the current one. I.E. it can't grow on either side. */ | ||
| 709 | |||
| 710 | static inline void | ||
| 711 | interval_generator_narrow (struct interval_generator *g, | ||
| 712 | ptrdiff_t begin, ptrdiff_t end) | ||
| 713 | { | ||
| 714 | g->begin = max (begin, g->begin); | ||
| 715 | g->end = min (end, g->end); | ||
| 716 | } | ||
| 717 | |||
| 718 | /* Free the memory allocated for G. */ | ||
| 719 | |||
| 720 | void | ||
| 721 | interval_generator_destroy (struct interval_generator *g) | ||
| 722 | { | ||
| 723 | if (! g) return; | ||
| 724 | if (g->stack) | ||
| 725 | interval_stack_destroy (g->stack); | ||
| 726 | xfree (g); | ||
| 727 | } | ||
| 728 | |||
| 729 | |||
| 730 | /* +===================================================================================+ | ||
| 731 | * | Stack | ||
| 732 | * +===================================================================================+ */ | ||
| 733 | |||
| 734 | /* This is just a simple dynamic array with stack semantics. */ | ||
| 735 | |||
| 736 | static struct interval_stack* | ||
| 737 | interval_stack_create (intmax_t initial_size) | ||
| 738 | { | ||
| 739 | struct interval_stack *stack = xmalloc (sizeof (struct interval_stack)); | ||
| 740 | stack->size = max (0, initial_size); | ||
| 741 | stack->nodes = xmalloc (stack->size * sizeof (struct interval_node*)); | ||
| 742 | stack->length = 0; | ||
| 743 | return stack; | ||
| 744 | } | ||
| 745 | |||
| 746 | static void | ||
| 747 | interval_stack_destroy (struct interval_stack *stack) | ||
| 748 | { | ||
| 749 | if (! stack) | ||
| 750 | return; | ||
| 751 | if (stack->nodes) | ||
| 752 | xfree (stack->nodes); | ||
| 753 | xfree (stack); | ||
| 754 | } | ||
| 755 | |||
| 756 | static void | ||
| 757 | interval_stack_clear (struct interval_stack *stack) | ||
| 758 | { | ||
| 759 | stack->length = 0; | ||
| 760 | } | ||
| 761 | |||
| 762 | static inline void | ||
| 763 | interval_stack_ensure_space (struct interval_stack *stack, intmax_t nelements) | ||
| 764 | { | ||
| 765 | if (nelements > stack->size) | ||
| 766 | { | ||
| 767 | stack->size = (nelements + 1) * 2; | ||
| 768 | stack->nodes = xrealloc (stack->nodes, stack->size * sizeof (*stack->nodes)); | ||
| 769 | } | ||
| 770 | } | ||
| 771 | |||
| 772 | static inline void | ||
| 773 | interval_stack_push (struct interval_stack *stack, struct interval_node *node) | ||
| 774 | { | ||
| 775 | interval_stack_ensure_space (stack, stack->length + 1); | ||
| 776 | stack->nodes[stack->length] = node; | ||
| 777 | stack->length++; | ||
| 778 | } | ||
| 779 | |||
| 780 | /* Push NODE on the STACK, while settings its visited flag to FLAG. */ | ||
| 781 | |||
| 782 | static inline void | ||
| 783 | interval_stack_push_flagged (struct interval_stack *stack, | ||
| 784 | struct interval_node *node, bool flag) | ||
| 785 | { | ||
| 786 | interval_stack_push (stack, node); | ||
| 787 | node->visited = flag; | ||
| 788 | } | ||
| 789 | |||
| 790 | static inline struct interval_node* | ||
| 791 | interval_stack_pop (struct interval_stack *stack) | ||
| 792 | { | ||
| 793 | if (stack->length == 0) | ||
| 794 | return NULL; | ||
| 795 | return stack->nodes[--stack->length]; | ||
| 796 | } | ||
| 797 | |||
| 798 | |||
| 799 | /* +===================================================================================+ | ||
| 800 | * | Internal Functions | ||
| 801 | * +===================================================================================+ */ | ||
| 802 | |||
| 803 | /* Update NODE's limit attribute according to its children. */ | ||
| 804 | |||
| 805 | static void | ||
| 806 | interval_tree_update_limit (const struct interval_tree *tree, | ||
| 807 | struct interval_node *node) | ||
| 808 | { | ||
| 809 | if (node == &tree->nil) | ||
| 810 | return; | ||
| 811 | |||
| 812 | node->limit = max (node->end, max (node->left->limit + node->left->offset, | ||
| 813 | node->right->limit + node->right->offset)); | ||
| 814 | } | ||
| 815 | |||
| 816 | /* Apply NODE's offset to its begin, end and limit values and | ||
| 817 | propagate it to its children. | ||
| 818 | |||
| 819 | Does nothing, if NODE is clean, i.e. NODE.otick = tree.otick . | ||
| 820 | */ | ||
| 821 | |||
| 822 | static void | ||
| 823 | interval_tree_inherit_offset (const struct interval_tree *tree, | ||
| 824 | struct interval_node *node) | ||
| 825 | { | ||
| 826 | |||
| 827 | if (node->otick == tree->otick) | ||
| 828 | return; | ||
| 829 | |||
| 830 | node->begin += node->offset; | ||
| 831 | node->end += node->offset; | ||
| 832 | node->limit += node->offset; | ||
| 833 | if (node->left != &tree->nil) | ||
| 834 | node->left->offset += node->offset; | ||
| 835 | if (node->right != &tree->nil) | ||
| 836 | node->right->offset += node->offset; | ||
| 837 | node->offset = 0; | ||
| 838 | if (node == tree->root || node->parent->otick == tree->otick) | ||
| 839 | node->otick = tree->otick; | ||
| 840 | } | ||
| 841 | |||
| 842 | /* Update limit of NODE and its ancestors. Stop when it becomes | ||
| 843 | stable, i.e. new_limit = old_limit. | ||
| 844 | |||
| 845 | NODE may also be the nil node, in which case its parent is | ||
| 846 | used. (This feature is due to the RB algorithm.) | ||
| 847 | */ | ||
| 848 | |||
| 849 | static void | ||
| 850 | interval_tree_propagate_limit (const struct interval_tree *tree, | ||
| 851 | struct interval_node *node) | ||
| 852 | { | ||
| 853 | if (node == &tree->nil) | ||
| 854 | node = node->parent; | ||
| 855 | if (node == &tree->nil) | ||
| 856 | return; | ||
| 857 | |||
| 858 | while (1) { | ||
| 859 | ptrdiff_t newlimit = max (node->end, max (node->left->limit + node->left->offset, | ||
| 860 | node->right->limit + node->right->offset)); | ||
| 861 | if (newlimit == node->limit) | ||
| 862 | break; | ||
| 863 | node->limit = newlimit; | ||
| 864 | if (node == tree->root) | ||
| 865 | break; | ||
| 866 | node = node->parent; | ||
| 867 | } | ||
| 868 | } | ||
| 869 | |||
| 870 | /* Perform the familiar left-rotation on node NODE. */ | ||
| 871 | |||
| 872 | static void | ||
| 873 | interval_tree_rotate_left (struct interval_tree *tree, struct interval_node *node) | ||
| 874 | { | ||
| 875 | eassert (node->right != &tree->nil); | ||
| 876 | |||
| 877 | struct interval_node *right = node->right; | ||
| 878 | |||
| 879 | interval_tree_inherit_offset (tree, node); | ||
| 880 | interval_tree_inherit_offset (tree, right); | ||
| 881 | |||
| 882 | /* Turn right's left subtree into node's right subtree. */ | ||
| 883 | node->right = right->left; | ||
| 884 | if (right->left != &tree->nil) | ||
| 885 | right->left->parent = node; | ||
| 886 | |||
| 887 | /* right's parent was node's parent. */ | ||
| 888 | if (right != &tree->nil) | ||
| 889 | right->parent = node->parent; | ||
| 890 | |||
| 891 | /* Get the parent to point to right instead of node. */ | ||
| 892 | if (node != tree->root) | ||
| 893 | { | ||
| 894 | if (node == node->parent->left) | ||
| 895 | node->parent->left = right; | ||
| 896 | else | ||
| 897 | node->parent->right = right; | ||
| 898 | } | ||
| 899 | else | ||
| 900 | tree->root = right; | ||
| 901 | |||
| 902 | /* Put node on right's left. */ | ||
| 903 | right->left = node; | ||
| 904 | if (node != &tree->nil) | ||
| 905 | node->parent = right; | ||
| 906 | |||
| 907 | /* Order matters here. */ | ||
| 908 | interval_tree_update_limit (tree, node); | ||
| 909 | interval_tree_update_limit (tree, right); | ||
| 910 | } | ||
| 911 | |||
| 912 | /* Perform the familiar right-rotation on node NODE. */ | ||
| 913 | |||
| 914 | static void | ||
| 915 | interval_tree_rotate_right (struct interval_tree *tree, struct interval_node *node) | ||
| 916 | { | ||
| 917 | eassert (tree && node && node->left != &tree->nil); | ||
| 918 | |||
| 919 | struct interval_node *left = node->left; | ||
| 920 | |||
| 921 | interval_tree_inherit_offset (tree, node); | ||
| 922 | interval_tree_inherit_offset (tree, left); | ||
| 923 | |||
| 924 | node->left = left->right; | ||
| 925 | if (left->right != &tree->nil) | ||
| 926 | left->right->parent = node; | ||
| 927 | |||
| 928 | if (left != &tree->nil) | ||
| 929 | left->parent = node->parent; | ||
| 930 | if (node != tree->root) | ||
| 931 | { | ||
| 932 | if (node == node->parent->right) | ||
| 933 | node->parent->right = left; | ||
| 934 | else | ||
| 935 | node->parent->left = left; | ||
| 936 | } | ||
| 937 | else | ||
| 938 | tree->root = left; | ||
| 939 | |||
| 940 | left->right = node; | ||
| 941 | if (node != &tree->nil) | ||
| 942 | node->parent = left; | ||
| 943 | |||
| 944 | interval_tree_update_limit (tree, left); | ||
| 945 | interval_tree_update_limit (tree, node); | ||
| 946 | } | ||
| 947 | |||
| 948 | /* Repair the tree after an insertion. Part of the RB-Tree | ||
| 949 | algorithm. */ | ||
| 950 | |||
| 951 | static void | ||
| 952 | interval_tree_insert_fix (struct interval_tree *tree, struct interval_node *node) | ||
| 953 | { | ||
| 954 | while (node->parent->color == ITREE_RED) | ||
| 955 | { | ||
| 956 | /* NODE is red and its parent is red. This is a violation of | ||
| 957 | red-black tree property #3. */ | ||
| 958 | |||
| 959 | if (node->parent == node->parent->parent->left) | ||
| 960 | { | ||
| 961 | /* We're on the left side of our grandparent, and OTHER is | ||
| 962 | our "uncle". */ | ||
| 963 | struct interval_node *uncle = node->parent->parent->right; | ||
| 964 | |||
| 965 | if (uncle->color == ITREE_RED) /* case 1.a */ | ||
| 966 | { | ||
| 967 | /* Uncle and parent are red but should be black because | ||
| 968 | NODE is red. Change the colors accordingly and | ||
| 969 | proceed with the grandparent. */ | ||
| 970 | node->parent->color = ITREE_BLACK; | ||
| 971 | uncle->color = ITREE_BLACK; | ||
| 972 | node->parent->parent->color = ITREE_RED; | ||
| 973 | node = node->parent->parent; | ||
| 974 | } | ||
| 975 | else | ||
| 976 | { | ||
| 977 | /* Parent and uncle have different colors; parent is | ||
| 978 | red, uncle is black. */ | ||
| 979 | if (node == node->parent->right) /* case 2.a */ | ||
| 980 | { | ||
| 981 | node = node->parent; | ||
| 982 | interval_tree_rotate_left (tree, node); | ||
| 983 | } | ||
| 984 | /* case 3.a */ | ||
| 985 | node->parent->color = ITREE_BLACK; | ||
| 986 | node->parent->parent->color = ITREE_RED; | ||
| 987 | interval_tree_rotate_right (tree, node->parent->parent); | ||
| 988 | } | ||
| 989 | } | ||
| 990 | else | ||
| 991 | { | ||
| 992 | /* This is the symmetrical case of above. */ | ||
| 993 | struct interval_node *uncle = node->parent->parent->left; | ||
| 994 | |||
| 995 | if (uncle->color == ITREE_RED) /* case 1.b */ | ||
| 996 | { | ||
| 997 | node->parent->color = ITREE_BLACK; | ||
| 998 | uncle->color = ITREE_BLACK; | ||
| 999 | node->parent->parent->color = ITREE_RED; | ||
| 1000 | node = node->parent->parent; | ||
| 1001 | } | ||
| 1002 | else | ||
| 1003 | { | ||
| 1004 | if (node == node->parent->left) /* case 2.b */ | ||
| 1005 | { | ||
| 1006 | node = node->parent; | ||
| 1007 | interval_tree_rotate_right (tree, node); | ||
| 1008 | } | ||
| 1009 | /* case 3.b */ | ||
| 1010 | node->parent->color = ITREE_BLACK; | ||
| 1011 | node->parent->parent->color = ITREE_RED; | ||
| 1012 | interval_tree_rotate_left (tree, node->parent->parent); | ||
| 1013 | } | ||
| 1014 | } | ||
| 1015 | } | ||
| 1016 | |||
| 1017 | /* The root may have been changed to red due to the algorithm. Set | ||
| 1018 | it to black so that property #5 is satisfied. */ | ||
| 1019 | tree->root->color = ITREE_BLACK; | ||
| 1020 | } | ||
| 1021 | |||
| 1022 | /* Repair the tree after a deletion. Part of the RB-Tree | ||
| 1023 | algorithm. */ | ||
| 1024 | |||
| 1025 | static void | ||
| 1026 | interval_tree_remove_fix (struct interval_tree *tree, struct interval_node *node) | ||
| 1027 | { | ||
| 1028 | while (node != tree->root && node->color == ITREE_BLACK) | ||
| 1029 | { | ||
| 1030 | if (node == node->parent->left) | ||
| 1031 | { | ||
| 1032 | struct interval_node *other = node->parent->right; | ||
| 1033 | |||
| 1034 | if (other->color == ITREE_RED) /* case 1.a */ | ||
| 1035 | { | ||
| 1036 | other->color = ITREE_BLACK; | ||
| 1037 | node->parent->color = ITREE_RED; | ||
| 1038 | interval_tree_rotate_left (tree, node->parent); | ||
| 1039 | other = node->parent->right; | ||
| 1040 | } | ||
| 1041 | |||
| 1042 | if (other->left->color == ITREE_BLACK /* 2.a */ | ||
| 1043 | && other->right->color == ITREE_BLACK) | ||
| 1044 | { | ||
| 1045 | other->color = ITREE_RED; | ||
| 1046 | node = node->parent; | ||
| 1047 | } | ||
| 1048 | else | ||
| 1049 | { | ||
| 1050 | if (other->right->color == ITREE_BLACK) /* 3.a */ | ||
| 1051 | { | ||
| 1052 | other->left->color = ITREE_BLACK; | ||
| 1053 | other->color = ITREE_RED; | ||
| 1054 | interval_tree_rotate_right (tree, other); | ||
| 1055 | other = node->parent->right; | ||
| 1056 | } | ||
| 1057 | other->color = node->parent->color; /* 4.a */ | ||
| 1058 | node->parent->color = ITREE_BLACK; | ||
| 1059 | other->right->color = ITREE_BLACK; | ||
| 1060 | interval_tree_rotate_left (tree, node->parent); | ||
| 1061 | node = tree->root; | ||
| 1062 | } | ||
| 1063 | } | ||
| 1064 | else | ||
| 1065 | { | ||
| 1066 | struct interval_node *other = node->parent->left; | ||
| 1067 | |||
| 1068 | if (other->color == ITREE_RED) /* 1.b */ | ||
| 1069 | { | ||
| 1070 | other->color = ITREE_BLACK; | ||
| 1071 | node->parent->color = ITREE_RED; | ||
| 1072 | interval_tree_rotate_right (tree, node->parent); | ||
| 1073 | other = node->parent->left; | ||
| 1074 | } | ||
| 1075 | |||
| 1076 | if (other->right->color == ITREE_BLACK /* 2.b */ | ||
| 1077 | && other->left->color == ITREE_BLACK) | ||
| 1078 | { | ||
| 1079 | other->color = ITREE_RED; | ||
| 1080 | node = node->parent; | ||
| 1081 | } | ||
| 1082 | else | ||
| 1083 | { | ||
| 1084 | if (other->left->color == ITREE_BLACK) /* 3.b */ | ||
| 1085 | { | ||
| 1086 | other->right->color = ITREE_BLACK; | ||
| 1087 | other->color = ITREE_RED; | ||
| 1088 | interval_tree_rotate_left (tree, other); | ||
| 1089 | other = node->parent->left; | ||
| 1090 | } | ||
| 1091 | |||
| 1092 | other->color = node->parent->color; /* 4.b */ | ||
| 1093 | node->parent->color = ITREE_BLACK; | ||
| 1094 | other->left->color = ITREE_BLACK; | ||
| 1095 | interval_tree_rotate_right (tree, node->parent); | ||
| 1096 | node = tree->root; | ||
| 1097 | } | ||
| 1098 | } | ||
| 1099 | } | ||
| 1100 | |||
| 1101 | node->color = ITREE_BLACK; | ||
| 1102 | } | ||
| 1103 | |||
| 1104 | /* Link node SOURCE in DEST's place. */ | ||
| 1105 | |||
| 1106 | static void | ||
| 1107 | interval_tree_transplant (struct interval_tree *tree, struct interval_node *source, | ||
| 1108 | struct interval_node *dest) | ||
| 1109 | { | ||
| 1110 | eassert (tree && source && dest && dest != &tree->nil); | ||
| 1111 | |||
| 1112 | if (dest == tree->root) | ||
| 1113 | tree->root = source; | ||
| 1114 | else if (dest == dest->parent->left) | ||
| 1115 | dest->parent->left = source; | ||
| 1116 | else | ||
| 1117 | dest->parent->right = source; | ||
| 1118 | |||
| 1119 | source->parent = dest->parent; | ||
| 1120 | } | ||
| 1121 | |||
| 1122 | |||
| 1123 | static struct interval_node* | ||
| 1124 | interval_tree_subtree_min (const struct interval_tree *tree, struct interval_node *node) | ||
| 1125 | { | ||
| 1126 | if (node == &tree->nil) | ||
| 1127 | return node; | ||
| 1128 | while (node->left != &tree->nil) | ||
| 1129 | node = node->left; | ||
| 1130 | return node; | ||
| 1131 | } | ||
| 1132 | |||
| 1133 | |||
| 1134 | /* +===================================================================================+ | ||
| 1135 | * | Debugging | ||
| 1136 | * +===================================================================================+ */ | ||
| 1137 | |||
| 1138 | /* See Foverlay_tree in buffer.c */ | ||
diff --git a/src/itree.h b/src/itree.h new file mode 100644 index 00000000000..d35c5afc24c --- /dev/null +++ b/src/itree.h | |||
| @@ -0,0 +1,88 @@ | |||
| 1 | /* This file implements an efficient interval data-structure. | ||
| 2 | |||
| 3 | Copyright (C) 2017 Andreas Politz (politza@hochschule-trier.de) | ||
| 4 | |||
| 5 | This file is not part of GNU Emacs. | ||
| 6 | |||
| 7 | GNU Emacs is free software: you can redistribute it and/or modify | ||
| 8 | it under the terms of the GNU General Public License as published by | ||
| 9 | the Free Software Foundation, either version 3 of the License, or (at | ||
| 10 | your option) any later version. | ||
| 11 | |||
| 12 | GNU Emacs is distributed in the hope that it will be useful, | ||
| 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | GNU General Public License for more details. | ||
| 16 | |||
| 17 | You should have received a copy of the GNU General Public License | ||
| 18 | along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | ||
| 19 | |||
| 20 | #ifndef ITREE_H | ||
| 21 | #define ITREE_H | ||
| 22 | #include <config.h> | ||
| 23 | #include <stddef.h> | ||
| 24 | #include <inttypes.h> | ||
| 25 | |||
| 26 | /* The tree and node structs are mainly here, so they can be allocated. | ||
| 27 | |||
| 28 | NOTE: The only time where it is safe to modify node.begin and | ||
| 29 | node.end directly, is while the node is not part of any tree. | ||
| 30 | |||
| 31 | NOTE: It is safe to read node.begin and node.end directly, if the | ||
| 32 | node came from a generator, because it validates the nodes it | ||
| 33 | returns as a side-effect. | ||
| 34 | */ | ||
| 35 | |||
| 36 | struct interval_node; | ||
| 37 | struct interval_node | ||
| 38 | { | ||
| 39 | enum { ITREE_RED, ITREE_BLACK } color; | ||
| 40 | struct interval_node *parent; | ||
| 41 | struct interval_node *left; | ||
| 42 | struct interval_node *right; | ||
| 43 | ptrdiff_t begin; /* The beginning of this interval. */ | ||
| 44 | ptrdiff_t end; /* The end of the interval. */ | ||
| 45 | ptrdiff_t limit; /* The maximum end in this subtree. */ | ||
| 46 | ptrdiff_t offset; /* The amount of shift to apply to this subtree. */ | ||
| 47 | uintmax_t otick; /* offset modified tick */ | ||
| 48 | Lisp_Object data; /* Exclusively used by the client. */ | ||
| 49 | bool_bf visited; /* For traversal via generator. */ | ||
| 50 | bool_bf rear_advance : 1; /* Same as for marker and overlays. */ | ||
| 51 | bool_bf front_advance : 1; /* Same as for marker and overlays. */ | ||
| 52 | }; | ||
| 53 | |||
| 54 | struct interval_tree | ||
| 55 | { | ||
| 56 | struct interval_node *root; | ||
| 57 | struct interval_node nil; /* The tree's version of NULL. */ | ||
| 58 | uintmax_t otick; /* offset tick, compared with node's otick. */ | ||
| 59 | intmax_t size; /* Number of nodes in the tree. */ | ||
| 60 | struct interval_generator *iter; | ||
| 61 | bool_bf iter_running; | ||
| 62 | }; | ||
| 63 | |||
| 64 | enum interval_tree_order { | ||
| 65 | ITREE_ASCENDING = 0, | ||
| 66 | ITREE_DEFLT_ORDER = 0, | ||
| 67 | ITREE_DESCENDING, | ||
| 68 | ITREE_PRE_ORDER, | ||
| 69 | }; | ||
| 70 | |||
| 71 | void interval_node_init(struct interval_node *, ptrdiff_t, ptrdiff_t, bool, bool, Lisp_Object); | ||
| 72 | ptrdiff_t interval_node_begin(struct interval_tree *, struct interval_node *); | ||
| 73 | ptrdiff_t interval_node_end(struct interval_tree *, struct interval_node *); | ||
| 74 | void interval_node_set_region(struct interval_tree *, struct interval_node *, ptrdiff_t, ptrdiff_t); | ||
| 75 | struct interval_tree *interval_tree_create(void); | ||
| 76 | void interval_tree_destroy(struct interval_tree *); | ||
| 77 | intmax_t interval_tree_size(struct interval_tree *); | ||
| 78 | void interval_tree_clear(struct interval_tree *); | ||
| 79 | void interval_tree_insert(struct interval_tree *, struct interval_node *); | ||
| 80 | bool interval_tree_contains(struct interval_tree *, struct interval_node *); | ||
| 81 | struct interval_node *interval_tree_remove(struct interval_tree *, struct interval_node *); | ||
| 82 | void interval_tree_iter_start(struct interval_tree *, ptrdiff_t, ptrdiff_t, enum interval_tree_order); | ||
| 83 | void interval_tree_iter_narrow(struct interval_tree *, ptrdiff_t, ptrdiff_t); | ||
| 84 | void interval_tree_iter_finish(struct interval_tree *); | ||
| 85 | struct interval_node *interval_tree_iter_next(struct interval_tree *); | ||
| 86 | void interval_tree_insert_gap(struct interval_tree *, ptrdiff_t, ptrdiff_t); | ||
| 87 | void interval_tree_delete_gap(struct interval_tree *, ptrdiff_t, ptrdiff_t); | ||
| 88 | #endif | ||
diff --git a/src/keyboard.c b/src/keyboard.c index e8701b88708..60cdaba9f0b 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -1668,8 +1668,8 @@ adjust_point_for_property (ptrdiff_t last_pt, bool modified) | |||
| 1668 | && display_prop_intangible_p (val, overlay, PT, PT_BYTE) | 1668 | && display_prop_intangible_p (val, overlay, PT, PT_BYTE) |
| 1669 | && (!OVERLAYP (overlay) | 1669 | && (!OVERLAYP (overlay) |
| 1670 | ? get_property_and_range (PT, Qdisplay, &val, &beg, &end, Qnil) | 1670 | ? get_property_and_range (PT, Qdisplay, &val, &beg, &end, Qnil) |
| 1671 | : (beg = OVERLAY_POSITION (OVERLAY_START (overlay)), | 1671 | : (beg = OVERLAY_START (overlay), |
| 1672 | end = OVERLAY_POSITION (OVERLAY_END (overlay)))) | 1672 | end = OVERLAY_END (overlay))) |
| 1673 | && (beg < PT /* && end > PT <- It's always the case. */ | 1673 | && (beg < PT /* && end > PT <- It's always the case. */ |
| 1674 | || (beg <= PT && STRINGP (val) && SCHARS (val) == 0))) | 1674 | || (beg <= PT && STRINGP (val) && SCHARS (val) == 0))) |
| 1675 | { | 1675 | { |
diff --git a/src/lisp.h b/src/lisp.h index 680c25d4c49..222a99950a8 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -2217,15 +2217,14 @@ struct Lisp_Overlay | |||
| 2217 | - next fields of start and end markers (singly linked list of markers). | 2217 | - next fields of start and end markers (singly linked list of markers). |
| 2218 | I.e. 9words plus 2 bits, 3words of which are for external linked lists. | 2218 | I.e. 9words plus 2 bits, 3words of which are for external linked lists. |
| 2219 | */ | 2219 | */ |
| 2220 | { | 2220 | { |
| 2221 | ENUM_BF (Lisp_Misc_Type) type : 16; /* = Lisp_Misc_Overlay */ | 2221 | ENUM_BF (Lisp_Misc_Type) type : 16; /* = Lisp_Misc_Overlay */ |
| 2222 | bool_bf gcmarkbit : 1; | 2222 | bool_bf gcmarkbit : 1; |
| 2223 | unsigned spacer : 15; | 2223 | unsigned spacer : 15; |
| 2224 | struct Lisp_Overlay *next; | 2224 | Lisp_Object plist; |
| 2225 | Lisp_Object start; | 2225 | struct buffer *buffer; /* eassert (live buffer || NULL). */ |
| 2226 | Lisp_Object end; | 2226 | struct interval_node *interval; |
| 2227 | Lisp_Object plist; | 2227 | }; |
| 2228 | }; | ||
| 2229 | 2228 | ||
| 2230 | /* Number of bits needed to store one of the values | 2229 | /* Number of bits needed to store one of the values |
| 2231 | SAVE_UNUSED..SAVE_OBJECT. */ | 2230 | SAVE_UNUSED..SAVE_OBJECT. */ |
| @@ -3704,7 +3703,7 @@ extern Lisp_Object make_save_funcptr_ptr_obj (void (*) (void), void *, | |||
| 3704 | Lisp_Object); | 3703 | Lisp_Object); |
| 3705 | extern Lisp_Object make_save_memory (Lisp_Object *, ptrdiff_t); | 3704 | extern Lisp_Object make_save_memory (Lisp_Object *, ptrdiff_t); |
| 3706 | extern void free_save_value (Lisp_Object); | 3705 | extern void free_save_value (Lisp_Object); |
| 3707 | extern Lisp_Object build_overlay (Lisp_Object, Lisp_Object, Lisp_Object); | 3706 | extern Lisp_Object build_overlay (ptrdiff_t, ptrdiff_t, bool, bool, Lisp_Object); |
| 3708 | extern void free_marker (Lisp_Object); | 3707 | extern void free_marker (Lisp_Object); |
| 3709 | extern void free_cons (struct Lisp_Cons *); | 3708 | extern void free_cons (struct Lisp_Cons *); |
| 3710 | extern void init_alloc_once (void); | 3709 | extern void init_alloc_once (void); |
diff --git a/src/print.c b/src/print.c index f280616af8a..a07baa3067a 100644 --- a/src/print.c +++ b/src/print.c | |||
| @@ -548,8 +548,7 @@ temp_output_buffer_setup (const char *bufname) | |||
| 548 | bset_read_only (current_buffer, Qnil); | 548 | bset_read_only (current_buffer, Qnil); |
| 549 | bset_filename (current_buffer, Qnil); | 549 | bset_filename (current_buffer, Qnil); |
| 550 | bset_undo_list (current_buffer, Qt); | 550 | bset_undo_list (current_buffer, Qt); |
| 551 | eassert (current_buffer->overlays_before == NULL); | 551 | eassert (current_buffer->overlays == NULL); |
| 552 | eassert (current_buffer->overlays_after == NULL); | ||
| 553 | bset_enable_multibyte_characters | 552 | bset_enable_multibyte_characters |
| 554 | (current_buffer, BVAR (&buffer_defaults, enable_multibyte_characters)); | 553 | (current_buffer, BVAR (&buffer_defaults, enable_multibyte_characters)); |
| 555 | specbind (Qinhibit_read_only, Qt); | 554 | specbind (Qinhibit_read_only, Qt); |
| @@ -2074,7 +2073,7 @@ print_object (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag) | |||
| 2074 | obj = XCDR (obj); | 2073 | obj = XCDR (obj); |
| 2075 | if (!(i & 1)) | 2074 | if (!(i & 1)) |
| 2076 | halftail = XCDR (halftail); | 2075 | halftail = XCDR (halftail); |
| 2077 | } | 2076 | } |
| 2078 | 2077 | ||
| 2079 | /* OBJ non-nil here means it's the end of a dotted list. */ | 2078 | /* OBJ non-nil here means it's the end of a dotted list. */ |
| 2080 | if (!NILP (obj)) | 2079 | if (!NILP (obj)) |
| @@ -2114,15 +2113,14 @@ print_object (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag) | |||
| 2114 | 2113 | ||
| 2115 | case Lisp_Misc_Overlay: | 2114 | case Lisp_Misc_Overlay: |
| 2116 | print_c_string ("#<overlay ", printcharfun); | 2115 | print_c_string ("#<overlay ", printcharfun); |
| 2117 | if (! XMARKER (OVERLAY_START (obj))->buffer) | 2116 | if (! OVERLAY_BUFFER (obj)) |
| 2118 | print_c_string ("in no buffer", printcharfun); | 2117 | print_c_string ("in no buffer", printcharfun); |
| 2119 | else | 2118 | else |
| 2120 | { | 2119 | { |
| 2121 | int len = sprintf (buf, "from %"pD"d to %"pD"d in ", | 2120 | int len = sprintf (buf, "from %"pD"d to %"pD"d in ", |
| 2122 | marker_position (OVERLAY_START (obj)), | 2121 | OVERLAY_START (obj), OVERLAY_END (obj)); |
| 2123 | marker_position (OVERLAY_END (obj))); | ||
| 2124 | strout (buf, len, len, printcharfun); | 2122 | strout (buf, len, len, printcharfun); |
| 2125 | print_string (BVAR (XMARKER (OVERLAY_START (obj))->buffer, name), | 2123 | print_string (BVAR (OVERLAY_BUFFER (obj), name), |
| 2126 | printcharfun); | 2124 | printcharfun); |
| 2127 | } | 2125 | } |
| 2128 | printchar ('>', printcharfun); | 2126 | printchar ('>', printcharfun); |
diff --git a/src/textprop.c b/src/textprop.c index 513780c3009..aebb6524e68 100644 --- a/src/textprop.c +++ b/src/textprop.c | |||
| @@ -617,36 +617,42 @@ get_char_property_and_overlay (Lisp_Object position, register Lisp_Object prop, | |||
| 617 | } | 617 | } |
| 618 | if (BUFFERP (object)) | 618 | if (BUFFERP (object)) |
| 619 | { | 619 | { |
| 620 | ptrdiff_t noverlays; | 620 | struct buffer *b = XBUFFER (object); |
| 621 | Lisp_Object *overlay_vec; | 621 | struct interval_node *node; |
| 622 | struct buffer *obuf = current_buffer; | 622 | struct sortvec items[2]; |
| 623 | struct sortvec *result = NULL; | ||
| 624 | Lisp_Object result_tem = Qnil; | ||
| 623 | 625 | ||
| 624 | if (XINT (position) < BUF_BEGV (XBUFFER (object)) | 626 | if (XINT (position) < BUF_BEGV (b) || XINT (position) > BUF_ZV (b)) |
| 625 | || XINT (position) > BUF_ZV (XBUFFER (object))) | ||
| 626 | xsignal1 (Qargs_out_of_range, position); | 627 | xsignal1 (Qargs_out_of_range, position); |
| 627 | 628 | ||
| 628 | set_buffer_temp (XBUFFER (object)); | 629 | buffer_overlay_iter_start(b, XINT (position), XINT (position) + 1, |
| 629 | 630 | ITREE_ASCENDING); | |
| 630 | USE_SAFE_ALLOCA; | ||
| 631 | GET_OVERLAYS_AT (XINT (position), overlay_vec, noverlays, NULL, false); | ||
| 632 | noverlays = sort_overlays (overlay_vec, noverlays, w); | ||
| 633 | |||
| 634 | set_buffer_temp (obuf); | ||
| 635 | 631 | ||
| 636 | /* Now check the overlays in order of decreasing priority. */ | 632 | /* Now check the overlays in order of decreasing priority. */ |
| 637 | while (--noverlays >= 0) | 633 | while ((node = buffer_overlay_iter_next (b))) |
| 638 | { | 634 | { |
| 639 | Lisp_Object tem = Foverlay_get (overlay_vec[noverlays], prop); | 635 | Lisp_Object tem = Foverlay_get (node->data, prop); |
| 640 | if (!NILP (tem)) | 636 | struct sortvec *this; |
| 641 | { | 637 | |
| 642 | if (overlay) | 638 | if (NILP (tem) || (w && ! overlay_matches_window (w, node->data))) |
| 643 | /* Return the overlay we got the property from. */ | 639 | continue; |
| 644 | *overlay = overlay_vec[noverlays]; | 640 | |
| 645 | SAFE_FREE (); | 641 | this = (result == items ? items + 1 : items); |
| 646 | return tem; | 642 | make_sortvec_item (this, node->data); |
| 647 | } | 643 | if (! result || (compare_overlays (result, this) < 0)) |
| 644 | { | ||
| 645 | result = this; | ||
| 646 | result_tem = tem; | ||
| 647 | } | ||
| 648 | } | 648 | } |
| 649 | SAFE_FREE (); | 649 | buffer_overlay_iter_finish (b); |
| 650 | if (result) | ||
| 651 | { | ||
| 652 | if (overlay) | ||
| 653 | *overlay = result->overlay; | ||
| 654 | return result_tem; | ||
| 655 | } | ||
| 650 | } | 656 | } |
| 651 | 657 | ||
| 652 | if (overlay) | 658 | if (overlay) |
diff --git a/src/window.h b/src/window.h index df7c23f824b..324d30b57f9 100644 --- a/src/window.h +++ b/src/window.h | |||
| @@ -1128,6 +1128,16 @@ output_cursor_to (struct window *w, int vpos, int hpos, int y, int x) | |||
| 1128 | w->output_cursor.y = y; | 1128 | w->output_cursor.y = y; |
| 1129 | } | 1129 | } |
| 1130 | 1130 | ||
| 1131 | /* Return true, if overlay OV's properties should have an effect in | ||
| 1132 | window W. */ | ||
| 1133 | INLINE bool | ||
| 1134 | overlay_matches_window (const struct window *w, Lisp_Object ov) | ||
| 1135 | { | ||
| 1136 | eassert (OVERLAYP (ov)); | ||
| 1137 | Lisp_Object window = Foverlay_get (ov, Qwindow); | ||
| 1138 | return (! WINDOWP (window) || XWINDOW (window) == w); | ||
| 1139 | } | ||
| 1140 | |||
| 1131 | INLINE_HEADER_END | 1141 | INLINE_HEADER_END |
| 1132 | 1142 | ||
| 1133 | #endif /* not WINDOW_H_INCLUDED */ | 1143 | #endif /* not WINDOW_H_INCLUDED */ |
diff --git a/src/xdisp.c b/src/xdisp.c index 86164eb9f6f..b3b9ecae377 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -873,7 +873,6 @@ static enum move_it_result | |||
| 873 | static void get_visually_first_element (struct it *); | 873 | static void get_visually_first_element (struct it *); |
| 874 | static void compute_stop_pos (struct it *); | 874 | static void compute_stop_pos (struct it *); |
| 875 | static int face_before_or_after_it_pos (struct it *, bool); | 875 | static int face_before_or_after_it_pos (struct it *, bool); |
| 876 | static ptrdiff_t next_overlay_change (ptrdiff_t); | ||
| 877 | static int handle_display_spec (struct it *, Lisp_Object, Lisp_Object, | 876 | static int handle_display_spec (struct it *, Lisp_Object, Lisp_Object, |
| 878 | Lisp_Object, struct text_pos *, ptrdiff_t, bool); | 877 | Lisp_Object, struct text_pos *, ptrdiff_t, bool); |
| 879 | static int handle_single_display_spec (struct it *, Lisp_Object, Lisp_Object, | 878 | static int handle_single_display_spec (struct it *, Lisp_Object, Lisp_Object, |
| @@ -3606,39 +3605,6 @@ compute_stop_pos (struct it *it) | |||
| 3606 | && it->stop_charpos >= IT_CHARPOS (*it))); | 3605 | && it->stop_charpos >= IT_CHARPOS (*it))); |
| 3607 | } | 3606 | } |
| 3608 | 3607 | ||
| 3609 | |||
| 3610 | /* Return the position of the next overlay change after POS in | ||
| 3611 | current_buffer. Value is point-max if no overlay change | ||
| 3612 | follows. This is like `next-overlay-change' but doesn't use | ||
| 3613 | xmalloc. */ | ||
| 3614 | |||
| 3615 | static ptrdiff_t | ||
| 3616 | next_overlay_change (ptrdiff_t pos) | ||
| 3617 | { | ||
| 3618 | ptrdiff_t i, noverlays; | ||
| 3619 | ptrdiff_t endpos; | ||
| 3620 | Lisp_Object *overlays; | ||
| 3621 | USE_SAFE_ALLOCA; | ||
| 3622 | |||
| 3623 | /* Get all overlays at the given position. */ | ||
| 3624 | GET_OVERLAYS_AT (pos, overlays, noverlays, &endpos, true); | ||
| 3625 | |||
| 3626 | /* If any of these overlays ends before endpos, | ||
| 3627 | use its ending point instead. */ | ||
| 3628 | for (i = 0; i < noverlays; ++i) | ||
| 3629 | { | ||
| 3630 | Lisp_Object oend; | ||
| 3631 | ptrdiff_t oendpos; | ||
| 3632 | |||
| 3633 | oend = OVERLAY_END (overlays[i]); | ||
| 3634 | oendpos = OVERLAY_POSITION (oend); | ||
| 3635 | endpos = min (endpos, oendpos); | ||
| 3636 | } | ||
| 3637 | |||
| 3638 | SAFE_FREE (); | ||
| 3639 | return endpos; | ||
| 3640 | } | ||
| 3641 | |||
| 3642 | /* How many characters forward to search for a display property or | 3608 | /* How many characters forward to search for a display property or |
| 3643 | display string. Searching too far forward makes the bidi display | 3609 | display string. Searching too far forward makes the bidi display |
| 3644 | sluggish, especially in small windows. */ | 3610 | sluggish, especially in small windows. */ |
| @@ -5071,7 +5037,7 @@ handle_single_display_spec (struct it *it, Lisp_Object spec, Lisp_Object object, | |||
| 5071 | overlay's display string/image twice. */ | 5037 | overlay's display string/image twice. */ |
| 5072 | if (!NILP (overlay)) | 5038 | if (!NILP (overlay)) |
| 5073 | { | 5039 | { |
| 5074 | ptrdiff_t ovendpos = OVERLAY_POSITION (OVERLAY_END (overlay)); | 5040 | ptrdiff_t ovendpos = OVERLAY_END (overlay); |
| 5075 | 5041 | ||
| 5076 | /* Some borderline-sane Lisp might call us with the current | 5042 | /* Some borderline-sane Lisp might call us with the current |
| 5077 | buffer narrowed so that overlay-end is outside the | 5043 | buffer narrowed so that overlay-end is outside the |
| @@ -5785,13 +5751,14 @@ static void | |||
| 5785 | load_overlay_strings (struct it *it, ptrdiff_t charpos) | 5751 | load_overlay_strings (struct it *it, ptrdiff_t charpos) |
| 5786 | { | 5752 | { |
| 5787 | Lisp_Object overlay, window, str, invisible; | 5753 | Lisp_Object overlay, window, str, invisible; |
| 5788 | struct Lisp_Overlay *ov; | ||
| 5789 | ptrdiff_t start, end; | 5754 | ptrdiff_t start, end; |
| 5790 | ptrdiff_t n = 0, i, j; | 5755 | ptrdiff_t n = 0, i, j; |
| 5791 | int invis; | 5756 | int invis; |
| 5792 | struct overlay_entry entriesbuf[20]; | 5757 | struct overlay_entry entriesbuf[20]; |
| 5793 | ptrdiff_t size = ARRAYELTS (entriesbuf); | 5758 | ptrdiff_t size = ARRAYELTS (entriesbuf); |
| 5794 | struct overlay_entry *entries = entriesbuf; | 5759 | struct overlay_entry *entries = entriesbuf; |
| 5760 | struct interval_node *node; | ||
| 5761 | |||
| 5795 | USE_SAFE_ALLOCA; | 5762 | USE_SAFE_ALLOCA; |
| 5796 | 5763 | ||
| 5797 | if (charpos <= 0) | 5764 | if (charpos <= 0) |
| @@ -5823,83 +5790,47 @@ load_overlay_strings (struct it *it, ptrdiff_t charpos) | |||
| 5823 | } \ | 5790 | } \ |
| 5824 | while (false) | 5791 | while (false) |
| 5825 | 5792 | ||
| 5826 | /* Process overlay before the overlay center. */ | 5793 | if (current_buffer->overlays) |
| 5827 | for (ov = current_buffer->overlays_before; ov; ov = ov->next) | ||
| 5828 | { | 5794 | { |
| 5829 | XSETMISC (overlay, ov); | 5795 | buffer_overlay_iter_start (current_buffer, |
| 5830 | eassert (OVERLAYP (overlay)); | 5796 | charpos - 1, charpos + 1, ITREE_DESCENDING); |
| 5831 | start = OVERLAY_POSITION (OVERLAY_START (overlay)); | 5797 | /* Process overlays. */ |
| 5832 | end = OVERLAY_POSITION (OVERLAY_END (overlay)); | 5798 | while ((node = buffer_overlay_iter_next (current_buffer))) |
| 5833 | 5799 | { | |
| 5834 | if (end < charpos) | 5800 | overlay = node->data; |
| 5835 | break; | 5801 | eassert (OVERLAYP (overlay)); |
| 5836 | 5802 | start = node->begin; | |
| 5837 | /* Skip this overlay if it doesn't start or end at IT's current | 5803 | end = node->end; |
| 5838 | position. */ | 5804 | |
| 5839 | if (end != charpos && start != charpos) | 5805 | /* Skip this overlay if it doesn't start or end at IT's current |
| 5840 | continue; | 5806 | position. */ |
| 5841 | 5807 | if (end != charpos && start != charpos) | |
| 5842 | /* Skip this overlay if it doesn't apply to IT->w. */ | 5808 | continue; |
| 5843 | window = Foverlay_get (overlay, Qwindow); | 5809 | |
| 5844 | if (WINDOWP (window) && XWINDOW (window) != it->w) | 5810 | /* Skip this overlay if it doesn't apply to IT->w. */ |
| 5845 | continue; | 5811 | window = Foverlay_get (overlay, Qwindow); |
| 5846 | 5812 | if (WINDOWP (window) && XWINDOW (window) != it->w) | |
| 5847 | /* If the text ``under'' the overlay is invisible, both before- | 5813 | continue; |
| 5848 | and after-strings from this overlay are visible; start and | 5814 | |
| 5849 | end position are indistinguishable. */ | 5815 | /* If the text ``under'' the overlay is invisible, both before- |
| 5850 | invisible = Foverlay_get (overlay, Qinvisible); | 5816 | and after-strings from this overlay are visible; start and |
| 5851 | invis = TEXT_PROP_MEANS_INVISIBLE (invisible); | 5817 | end position are indistinguishable. */ |
| 5852 | 5818 | invisible = Foverlay_get (overlay, Qinvisible); | |
| 5853 | /* If overlay has a non-empty before-string, record it. */ | 5819 | invis = TEXT_PROP_MEANS_INVISIBLE (invisible); |
| 5854 | if ((start == charpos || (end == charpos && invis != 0)) | 5820 | |
| 5855 | && (str = Foverlay_get (overlay, Qbefore_string), STRINGP (str)) | 5821 | /* If overlay has a non-empty before-string, record it. */ |
| 5856 | && SCHARS (str)) | 5822 | if ((start == charpos || (end == charpos && invis != 0)) |
| 5857 | RECORD_OVERLAY_STRING (overlay, str, false); | 5823 | && (str = Foverlay_get (overlay, Qbefore_string), STRINGP (str)) |
| 5858 | 5824 | && SCHARS (str)) | |
| 5859 | /* If overlay has a non-empty after-string, record it. */ | 5825 | RECORD_OVERLAY_STRING (overlay, str, false); |
| 5860 | if ((end == charpos || (start == charpos && invis != 0)) | 5826 | |
| 5861 | && (str = Foverlay_get (overlay, Qafter_string), STRINGP (str)) | 5827 | /* If overlay has a non-empty after-string, record it. */ |
| 5862 | && SCHARS (str)) | 5828 | if ((end == charpos || (start == charpos && invis != 0)) |
| 5863 | RECORD_OVERLAY_STRING (overlay, str, true); | 5829 | && (str = Foverlay_get (overlay, Qafter_string), STRINGP (str)) |
| 5864 | } | 5830 | && SCHARS (str)) |
| 5865 | 5831 | RECORD_OVERLAY_STRING (overlay, str, true); | |
| 5866 | /* Process overlays after the overlay center. */ | 5832 | } |
| 5867 | for (ov = current_buffer->overlays_after; ov; ov = ov->next) | 5833 | buffer_overlay_iter_finish (current_buffer); |
| 5868 | { | ||
| 5869 | XSETMISC (overlay, ov); | ||
| 5870 | eassert (OVERLAYP (overlay)); | ||
| 5871 | start = OVERLAY_POSITION (OVERLAY_START (overlay)); | ||
| 5872 | end = OVERLAY_POSITION (OVERLAY_END (overlay)); | ||
| 5873 | |||
| 5874 | if (start > charpos) | ||
| 5875 | break; | ||
| 5876 | |||
| 5877 | /* Skip this overlay if it doesn't start or end at IT's current | ||
| 5878 | position. */ | ||
| 5879 | if (end != charpos && start != charpos) | ||
| 5880 | continue; | ||
| 5881 | |||
| 5882 | /* Skip this overlay if it doesn't apply to IT->w. */ | ||
| 5883 | window = Foverlay_get (overlay, Qwindow); | ||
| 5884 | if (WINDOWP (window) && XWINDOW (window) != it->w) | ||
| 5885 | continue; | ||
| 5886 | |||
| 5887 | /* If the text ``under'' the overlay is invisible, it has a zero | ||
| 5888 | dimension, and both before- and after-strings apply. */ | ||
| 5889 | invisible = Foverlay_get (overlay, Qinvisible); | ||
| 5890 | invis = TEXT_PROP_MEANS_INVISIBLE (invisible); | ||
| 5891 | |||
| 5892 | /* If overlay has a non-empty before-string, record it. */ | ||
| 5893 | if ((start == charpos || (end == charpos && invis != 0)) | ||
| 5894 | && (str = Foverlay_get (overlay, Qbefore_string), STRINGP (str)) | ||
| 5895 | && SCHARS (str)) | ||
| 5896 | RECORD_OVERLAY_STRING (overlay, str, false); | ||
| 5897 | |||
| 5898 | /* If overlay has a non-empty after-string, record it. */ | ||
| 5899 | if ((end == charpos || (start == charpos && invis != 0)) | ||
| 5900 | && (str = Foverlay_get (overlay, Qafter_string), STRINGP (str)) | ||
| 5901 | && SCHARS (str)) | ||
| 5902 | RECORD_OVERLAY_STRING (overlay, str, true); | ||
| 5903 | } | 5834 | } |
| 5904 | 5835 | ||
| 5905 | #undef RECORD_OVERLAY_STRING | 5836 | #undef RECORD_OVERLAY_STRING |
| @@ -6463,7 +6394,7 @@ back_to_previous_visible_line_start (struct it *it) | |||
| 6463 | && !NILP (val = get_char_property_and_overlay | 6394 | && !NILP (val = get_char_property_and_overlay |
| 6464 | (make_number (pos), Qdisplay, Qnil, &overlay)) | 6395 | (make_number (pos), Qdisplay, Qnil, &overlay)) |
| 6465 | && (OVERLAYP (overlay) | 6396 | && (OVERLAYP (overlay) |
| 6466 | ? (beg = OVERLAY_POSITION (OVERLAY_START (overlay))) | 6397 | ? (beg = OVERLAY_START (overlay)) |
| 6467 | : get_property_and_range (pos, Qdisplay, &val, &beg, &end, Qnil))) | 6398 | : get_property_and_range (pos, Qdisplay, &val, &beg, &end, Qnil))) |
| 6468 | { | 6399 | { |
| 6469 | RESTORE_IT (it, it, it2data); | 6400 | RESTORE_IT (it, it, it2data); |
| @@ -9568,7 +9499,6 @@ move_it_to (struct it *it, ptrdiff_t to_charpos, int to_x, int to_y, int to_vpos | |||
| 9568 | } | 9499 | } |
| 9569 | 9500 | ||
| 9570 | /* Reset/increment for the next run. */ | 9501 | /* Reset/increment for the next run. */ |
| 9571 | recenter_overlay_lists (current_buffer, IT_CHARPOS (*it)); | ||
| 9572 | it->current_x = line_start_x; | 9502 | it->current_x = line_start_x; |
| 9573 | line_start_x = 0; | 9503 | line_start_x = 0; |
| 9574 | it->hpos = 0; | 9504 | it->hpos = 0; |
| @@ -21212,13 +21142,6 @@ display_line (struct it *it, int cursor_vpos) | |||
| 21212 | row->starts_in_middle_of_char_p = it->starts_in_middle_of_char_p; | 21142 | row->starts_in_middle_of_char_p = it->starts_in_middle_of_char_p; |
| 21213 | it->starts_in_middle_of_char_p = false; | 21143 | it->starts_in_middle_of_char_p = false; |
| 21214 | 21144 | ||
| 21215 | /* Arrange the overlays nicely for our purposes. Usually, we call | ||
| 21216 | display_line on only one line at a time, in which case this | ||
| 21217 | can't really hurt too much, or we call it on lines which appear | ||
| 21218 | one after another in the buffer, in which case all calls to | ||
| 21219 | recenter_overlay_lists but the first will be pretty cheap. */ | ||
| 21220 | recenter_overlay_lists (current_buffer, IT_CHARPOS (*it)); | ||
| 21221 | |||
| 21222 | /* If we are going to display the cursor's line, account for the | 21145 | /* If we are going to display the cursor's line, account for the |
| 21223 | hscroll of that line. We subtract the window's min_hscroll, | 21146 | hscroll of that line. We subtract the window's min_hscroll, |
| 21224 | because that was already accounted for in init_iterator. */ | 21147 | because that was already accounted for in init_iterator. */ |
| @@ -31212,7 +31135,7 @@ note_mouse_highlight (struct frame *f, int x, int y) | |||
| 31212 | if (BUFFERP (object)) | 31135 | if (BUFFERP (object)) |
| 31213 | { | 31136 | { |
| 31214 | /* Put all the overlays we want in a vector in overlay_vec. */ | 31137 | /* Put all the overlays we want in a vector in overlay_vec. */ |
| 31215 | GET_OVERLAYS_AT (pos, overlay_vec, noverlays, NULL, false); | 31138 | GET_OVERLAYS_AT (pos, overlay_vec, noverlays, NULL); |
| 31216 | /* Sort overlays into increasing priority order. */ | 31139 | /* Sort overlays into increasing priority order. */ |
| 31217 | noverlays = sort_overlays (overlay_vec, noverlays, w); | 31140 | noverlays = sort_overlays (overlay_vec, noverlays, w); |
| 31218 | } | 31141 | } |
diff --git a/src/xfaces.c b/src/xfaces.c index b309c161278..b1788725eb7 100644 --- a/src/xfaces.c +++ b/src/xfaces.c | |||
| @@ -5931,8 +5931,7 @@ face_at_buffer_position (struct window *w, ptrdiff_t pos, | |||
| 5931 | USE_SAFE_ALLOCA; | 5931 | USE_SAFE_ALLOCA; |
| 5932 | { | 5932 | { |
| 5933 | ptrdiff_t next_overlay; | 5933 | ptrdiff_t next_overlay; |
| 5934 | 5934 | GET_OVERLAYS_AT (pos, overlay_vec, noverlays, &next_overlay); | |
| 5935 | GET_OVERLAYS_AT (pos, overlay_vec, noverlays, &next_overlay, false); | ||
| 5936 | if (next_overlay < endpos) | 5935 | if (next_overlay < endpos) |
| 5937 | endpos = next_overlay; | 5936 | endpos = next_overlay; |
| 5938 | } | 5937 | } |
| @@ -5975,7 +5974,6 @@ face_at_buffer_position (struct window *w, ptrdiff_t pos, | |||
| 5975 | { | 5974 | { |
| 5976 | for (prop = Qnil, i = noverlays - 1; i >= 0 && NILP (prop); --i) | 5975 | for (prop = Qnil, i = noverlays - 1; i >= 0 && NILP (prop); --i) |
| 5977 | { | 5976 | { |
| 5978 | Lisp_Object oend; | ||
| 5979 | ptrdiff_t oendpos; | 5977 | ptrdiff_t oendpos; |
| 5980 | 5978 | ||
| 5981 | prop = Foverlay_get (overlay_vec[i], propname); | 5979 | prop = Foverlay_get (overlay_vec[i], propname); |
| @@ -5988,8 +5986,7 @@ face_at_buffer_position (struct window *w, ptrdiff_t pos, | |||
| 5988 | merge_face_ref (f, prop, attrs, true, 0); | 5986 | merge_face_ref (f, prop, attrs, true, 0); |
| 5989 | } | 5987 | } |
| 5990 | 5988 | ||
| 5991 | oend = OVERLAY_END (overlay_vec[i]); | 5989 | oendpos = OVERLAY_END (overlay_vec[i]); |
| 5992 | oendpos = OVERLAY_POSITION (oend); | ||
| 5993 | if (oendpos < endpos) | 5990 | if (oendpos < endpos) |
| 5994 | endpos = oendpos; | 5991 | endpos = oendpos; |
| 5995 | } | 5992 | } |
| @@ -5998,18 +5995,16 @@ face_at_buffer_position (struct window *w, ptrdiff_t pos, | |||
| 5998 | { | 5995 | { |
| 5999 | for (i = 0; i < noverlays; i++) | 5996 | for (i = 0; i < noverlays; i++) |
| 6000 | { | 5997 | { |
| 6001 | Lisp_Object oend; | ||
| 6002 | ptrdiff_t oendpos; | 5998 | ptrdiff_t oendpos; |
| 6003 | 5999 | ||
| 6004 | prop = Foverlay_get (overlay_vec[i], propname); | 6000 | prop = Foverlay_get (overlay_vec[i], propname); |
| 6005 | if (!NILP (prop)) | 6001 | if (!NILP (prop)) |
| 6006 | merge_face_ref (f, prop, attrs, true, 0); | 6002 | merge_face_ref (f, prop, attrs, true, 0); |
| 6007 | 6003 | ||
| 6008 | oend = OVERLAY_END (overlay_vec[i]); | 6004 | oendpos = OVERLAY_END (overlay_vec[i]); |
| 6009 | oendpos = OVERLAY_POSITION (oend); | 6005 | if (oendpos < endpos) |
| 6010 | if (oendpos < endpos) | 6006 | endpos = oendpos; |
| 6011 | endpos = oendpos; | 6007 | } |
| 6012 | } | ||
| 6013 | } | 6008 | } |
| 6014 | 6009 | ||
| 6015 | *endptr = endpos; | 6010 | *endptr = endpos; |
diff --git a/test/manual/noverlay/.gitignore b/test/manual/noverlay/.gitignore new file mode 100644 index 00000000000..ca7fc452b84 --- /dev/null +++ b/test/manual/noverlay/.gitignore | |||
| @@ -0,0 +1 @@ | |||
| itree-tests | |||
diff --git a/test/manual/noverlay/Makefile.in b/test/manual/noverlay/Makefile.in new file mode 100644 index 00000000000..beef1dbc097 --- /dev/null +++ b/test/manual/noverlay/Makefile.in | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | PROGRAM = itree-tests | ||
| 2 | LIBS = check | ||
| 3 | top_srcdir = @top_srcdir@ | ||
| 4 | CFLAGS += -O0 -g3 $(shell pkg-config --cflags $(LIBS)) -I $(top_srcdir)/src | ||
| 5 | LDFLAGS += $(shell pkg-config --libs $(LIBS)) -lm | ||
| 6 | OBJECTS = itree-tests.o | ||
| 7 | CC = gcc | ||
| 8 | EMACS ?= ../../../src/emacs | ||
| 9 | |||
| 10 | .PHONY: all check have-libcheck | ||
| 11 | |||
| 12 | all: check | ||
| 13 | |||
| 14 | have-libcheck: | ||
| 15 | pkg-config --cflags $(LIBS) | ||
| 16 | |||
| 17 | check: have-libcheck $(PROGRAM) | ||
| 18 | ./check-sanitize.sh ./$(PROGRAM) | ||
| 19 | |||
| 20 | itree-tests.o: emacs-compat.h itree-tests.c $(top_srcdir)/src/itree.c $(top_srcdir)/src/itree.h | ||
| 21 | |||
| 22 | $(PROGRAM): $(OBJECTS) | ||
| 23 | $(CC) $(CFLAGS) $(LDFLAGS) $(OBJECTS) -o $(PROGRAM) | ||
| 24 | |||
| 25 | perf: | ||
| 26 | -$(EMACS) -Q -l ./overlay-perf.el -f perf-run-batch | ||
| 27 | |||
| 28 | clean: | ||
| 29 | rm -f -- $(OBJECTS) $(PROGRAM) | ||
| 30 | |||
| 31 | distclean: clean | ||
| 32 | rm -f -- Makefile | ||
diff --git a/test/manual/noverlay/check-sanitize.sh b/test/manual/noverlay/check-sanitize.sh new file mode 100755 index 00000000000..03eedce8a67 --- /dev/null +++ b/test/manual/noverlay/check-sanitize.sh | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | prog=$1 | ||
| 4 | shift | ||
| 5 | |||
| 6 | [ -z "$prog" ] && { | ||
| 7 | echo "usage:$(basename $0) CHECK_PRGOGRAM"; | ||
| 8 | exit 1; | ||
| 9 | } | ||
| 10 | |||
| 11 | "$prog" "$@" | sed -e 's/^\([^:]\+\):\([0-9]\+\):[PFE]:[^:]*:\([^:]*\):[^:]*: *\(.*\)/\1:\2:\3:\4/' | ||
diff --git a/test/manual/noverlay/emacs-compat.h b/test/manual/noverlay/emacs-compat.h new file mode 100644 index 00000000000..812f8e48a36 --- /dev/null +++ b/test/manual/noverlay/emacs-compat.h | |||
| @@ -0,0 +1,52 @@ | |||
| 1 | #ifndef TEST_COMPAT_H | ||
| 2 | #define TEST_COMPAT_H | ||
| 3 | |||
| 4 | #include <stdio.h> | ||
| 5 | #include <limits.h> | ||
| 6 | |||
| 7 | typedef int Lisp_Object; | ||
| 8 | |||
| 9 | void * | ||
| 10 | xmalloc (size_t size) | ||
| 11 | { | ||
| 12 | return malloc (size); | ||
| 13 | } | ||
| 14 | |||
| 15 | void | ||
| 16 | xfree (void *ptr) | ||
| 17 | { | ||
| 18 | free (ptr); | ||
| 19 | } | ||
| 20 | |||
| 21 | void * | ||
| 22 | xrealloc (void *block, size_t size) | ||
| 23 | { | ||
| 24 | return realloc (block, size); | ||
| 25 | } | ||
| 26 | |||
| 27 | void | ||
| 28 | emacs_abort () | ||
| 29 | { | ||
| 30 | fprintf (stderr, "Aborting...\n"); | ||
| 31 | exit (1); | ||
| 32 | } | ||
| 33 | |||
| 34 | #ifndef eassert | ||
| 35 | #define eassert(cond) \ | ||
| 36 | do { \ | ||
| 37 | if (! (cond)) { \ | ||
| 38 | fprintf (stderr, "\n%s:%d:eassert condition failed: %s\n", \ | ||
| 39 | __FILE__, __LINE__ ,#cond); \ | ||
| 40 | exit (1); \ | ||
| 41 | } \ | ||
| 42 | } while (0) | ||
| 43 | #endif | ||
| 44 | |||
| 45 | #ifndef max | ||
| 46 | #define max(x,y) ((x) >= (y) ? (x) : (y)) | ||
| 47 | #endif | ||
| 48 | #ifndef min | ||
| 49 | #define min(x,y) ((x) <= (y) ? (x) : (y)) | ||
| 50 | #endif | ||
| 51 | |||
| 52 | #endif | ||
diff --git a/test/manual/noverlay/itree-tests.c b/test/manual/noverlay/itree-tests.c new file mode 100644 index 00000000000..a3183892132 --- /dev/null +++ b/test/manual/noverlay/itree-tests.c | |||
| @@ -0,0 +1,1381 @@ | |||
| 1 | #include <config.h> | ||
| 2 | #include <check.h> | ||
| 3 | #include <stdlib.h> | ||
| 4 | #include <stdarg.h> | ||
| 5 | #include "emacs-compat.h" | ||
| 6 | |||
| 7 | #define EMACS_LISP_H /* lisp.h inclusion guard */ | ||
| 8 | #define ITREE_DEBUG 1 | ||
| 9 | #define ITREE_TESTING | ||
| 10 | #include "itree.c" | ||
| 11 | |||
| 12 | /* Basic tests of the interval_tree data-structure. */ | ||
| 13 | |||
| 14 | /* +===================================================================================+ | ||
| 15 | * | Insert | ||
| 16 | * +===================================================================================+ */ | ||
| 17 | |||
| 18 | /* The graphs below display the trees after each insertion (as they | ||
| 19 | should be). See the source code for the different cases | ||
| 20 | applied. */ | ||
| 21 | |||
| 22 | #define N_50 (n[0]) | ||
| 23 | #define N_30 (n[1]) | ||
| 24 | #define N_20 (n[2]) | ||
| 25 | #define N_10 (n[3]) | ||
| 26 | #define N_15 (n[4]) | ||
| 27 | #define N_05 (n[5]) | ||
| 28 | |||
| 29 | #define DEF_TEST_SETUP() \ | ||
| 30 | struct interval_tree tree; \ | ||
| 31 | struct interval_node n[6]; \ | ||
| 32 | interval_tree_init (&tree); \ | ||
| 33 | const int values[] = {50, 30, 20, 10, 15, 5}; \ | ||
| 34 | for (int i = 0; i < 6; ++i) \ | ||
| 35 | { \ | ||
| 36 | n[i].begin = values[i]; \ | ||
| 37 | n[i].end = values[i]; \ | ||
| 38 | } | ||
| 39 | |||
| 40 | START_TEST (test_insert_1) | ||
| 41 | { | ||
| 42 | /* | ||
| 43 | * [50] | ||
| 44 | */ | ||
| 45 | |||
| 46 | DEF_TEST_SETUP (); | ||
| 47 | interval_tree_insert (&tree, &N_50); | ||
| 48 | ck_assert (N_50.color == ITREE_BLACK); | ||
| 49 | ck_assert (&N_50 == tree.root); | ||
| 50 | } | ||
| 51 | END_TEST | ||
| 52 | |||
| 53 | START_TEST (test_insert_2) | ||
| 54 | { | ||
| 55 | /* | ||
| 56 | * [50] | ||
| 57 | * / | ||
| 58 | * (30) | ||
| 59 | */ | ||
| 60 | |||
| 61 | DEF_TEST_SETUP (); | ||
| 62 | interval_tree_insert (&tree, &N_50); | ||
| 63 | interval_tree_insert (&tree, &N_30); | ||
| 64 | ck_assert (N_50.color == ITREE_BLACK); | ||
| 65 | ck_assert (N_30.color == ITREE_RED); | ||
| 66 | ck_assert (&N_50 == tree.root); | ||
| 67 | ck_assert (N_30.parent == &N_50); | ||
| 68 | ck_assert (N_50.left == &N_30); | ||
| 69 | ck_assert (N_50.right == &tree.nil); | ||
| 70 | ck_assert (N_30.left == &tree.nil); | ||
| 71 | ck_assert (N_30.right == &tree.nil); | ||
| 72 | } | ||
| 73 | END_TEST | ||
| 74 | |||
| 75 | START_TEST (test_insert_3) | ||
| 76 | { | ||
| 77 | /* case 3.a | ||
| 78 | * [30] | ||
| 79 | * / \ | ||
| 80 | * (20) (50) | ||
| 81 | */ | ||
| 82 | |||
| 83 | DEF_TEST_SETUP (); | ||
| 84 | interval_tree_insert (&tree, &N_50); | ||
| 85 | interval_tree_insert (&tree, &N_30); | ||
| 86 | interval_tree_insert (&tree, &N_20); | ||
| 87 | ck_assert (N_50.color == ITREE_RED); | ||
| 88 | ck_assert (N_30.color == ITREE_BLACK); | ||
| 89 | ck_assert (N_20.color == ITREE_RED); | ||
| 90 | ck_assert (&N_30 == tree.root); | ||
| 91 | ck_assert (N_50.parent == &N_30); | ||
| 92 | ck_assert (N_30.right == &N_50); | ||
| 93 | ck_assert (N_30.left == &N_20); | ||
| 94 | ck_assert (N_20.left == &tree.nil); | ||
| 95 | ck_assert (N_20.right == &tree.nil); | ||
| 96 | ck_assert (N_20.parent == &N_30); | ||
| 97 | } | ||
| 98 | END_TEST | ||
| 99 | |||
| 100 | START_TEST (test_insert_4) | ||
| 101 | { | ||
| 102 | /* 1.a | ||
| 103 | * [30] | ||
| 104 | * / \ | ||
| 105 | * [20] [50] | ||
| 106 | * / | ||
| 107 | * (10) | ||
| 108 | */ | ||
| 109 | |||
| 110 | DEF_TEST_SETUP (); | ||
| 111 | interval_tree_insert (&tree, &N_50); | ||
| 112 | interval_tree_insert (&tree, &N_30); | ||
| 113 | interval_tree_insert (&tree, &N_20); | ||
| 114 | interval_tree_insert (&tree, &N_10); | ||
| 115 | ck_assert (N_50.color == ITREE_BLACK); | ||
| 116 | ck_assert (N_30.color == ITREE_BLACK); | ||
| 117 | ck_assert (N_20.color == ITREE_BLACK); | ||
| 118 | ck_assert (N_10.color == ITREE_RED); | ||
| 119 | ck_assert (&N_30 == tree.root); | ||
| 120 | ck_assert (N_50.parent == &N_30); | ||
| 121 | ck_assert (N_30.right == &N_50); | ||
| 122 | ck_assert (N_30.left == &N_20); | ||
| 123 | ck_assert (N_20.left == &N_10); | ||
| 124 | ck_assert (N_20.right == &tree.nil); | ||
| 125 | ck_assert (N_20.parent == &N_30); | ||
| 126 | ck_assert (N_10.parent == &N_20); | ||
| 127 | ck_assert (N_20.left == &N_10); | ||
| 128 | ck_assert (N_10.right == &tree.nil); | ||
| 129 | } | ||
| 130 | END_TEST | ||
| 131 | |||
| 132 | START_TEST (test_insert_5) | ||
| 133 | { | ||
| 134 | /* 2.a | ||
| 135 | * [30] | ||
| 136 | * / \ | ||
| 137 | * [15] [50] | ||
| 138 | * / \ | ||
| 139 | * (10) (20) | ||
| 140 | */ | ||
| 141 | |||
| 142 | DEF_TEST_SETUP (); | ||
| 143 | interval_tree_insert (&tree, &N_50); | ||
| 144 | interval_tree_insert (&tree, &N_30); | ||
| 145 | interval_tree_insert (&tree, &N_20); | ||
| 146 | interval_tree_insert (&tree, &N_10); | ||
| 147 | interval_tree_insert (&tree, &N_15); | ||
| 148 | ck_assert (N_50.color == ITREE_BLACK); | ||
| 149 | ck_assert (N_30.color == ITREE_BLACK); | ||
| 150 | ck_assert (N_20.color == ITREE_RED); | ||
| 151 | ck_assert (N_10.color == ITREE_RED); | ||
| 152 | ck_assert (N_15.color == ITREE_BLACK); | ||
| 153 | ck_assert (&N_30 == tree.root); | ||
| 154 | ck_assert (N_50.parent == &N_30); | ||
| 155 | ck_assert (N_30.right == &N_50); | ||
| 156 | ck_assert (N_30.left == &N_15); | ||
| 157 | ck_assert (N_20.left == &tree.nil); | ||
| 158 | ck_assert (N_20.right == &tree.nil); | ||
| 159 | ck_assert (N_20.parent == &N_15); | ||
| 160 | ck_assert (N_10.parent == &N_15); | ||
| 161 | ck_assert (N_20.left == &tree.nil); | ||
| 162 | ck_assert (N_10.right == &tree.nil); | ||
| 163 | ck_assert (N_15.right == &N_20); | ||
| 164 | ck_assert (N_15.left == &N_10); | ||
| 165 | ck_assert (N_15.parent == &N_30); | ||
| 166 | |||
| 167 | } | ||
| 168 | END_TEST | ||
| 169 | |||
| 170 | START_TEST (test_insert_6) | ||
| 171 | { | ||
| 172 | /* 1.a | ||
| 173 | * [30] | ||
| 174 | * / \ | ||
| 175 | * (15) [50] | ||
| 176 | * / \ | ||
| 177 | * [10] [20] | ||
| 178 | * / | ||
| 179 | * (5) | ||
| 180 | */ | ||
| 181 | |||
| 182 | DEF_TEST_SETUP (); | ||
| 183 | interval_tree_insert (&tree, &N_50); | ||
| 184 | interval_tree_insert (&tree, &N_30); | ||
| 185 | interval_tree_insert (&tree, &N_20); | ||
| 186 | interval_tree_insert (&tree, &N_10); | ||
| 187 | interval_tree_insert (&tree, &N_15); | ||
| 188 | interval_tree_insert (&tree, &N_05); | ||
| 189 | ck_assert (N_50.color == ITREE_BLACK); | ||
| 190 | ck_assert (N_30.color == ITREE_BLACK); | ||
| 191 | ck_assert (N_20.color == ITREE_BLACK); | ||
| 192 | ck_assert (N_10.color == ITREE_BLACK); | ||
| 193 | ck_assert (N_15.color == ITREE_RED); | ||
| 194 | ck_assert (N_05.color == ITREE_RED); | ||
| 195 | ck_assert (&N_30 == tree.root); | ||
| 196 | ck_assert (N_50.parent == &N_30); | ||
| 197 | ck_assert (N_30.right == &N_50); | ||
| 198 | ck_assert (N_30.left == &N_15); | ||
| 199 | ck_assert (N_20.left == &tree.nil); | ||
| 200 | ck_assert (N_20.right == &tree.nil); | ||
| 201 | ck_assert (N_20.parent == &N_15); | ||
| 202 | ck_assert (N_10.parent == &N_15); | ||
| 203 | ck_assert (N_20.left == &tree.nil); | ||
| 204 | ck_assert (N_10.right == &tree.nil); | ||
| 205 | ck_assert (N_15.right == &N_20); | ||
| 206 | ck_assert (N_15.left == &N_10); | ||
| 207 | ck_assert (N_15.parent == &N_30); | ||
| 208 | ck_assert (N_05.parent == &N_10); | ||
| 209 | ck_assert (N_10.left == &N_05); | ||
| 210 | ck_assert (N_05.right == &tree.nil); | ||
| 211 | } | ||
| 212 | END_TEST | ||
| 213 | |||
| 214 | #undef N_50 | ||
| 215 | #undef N_30 | ||
| 216 | #undef N_20 | ||
| 217 | #undef N_10 | ||
| 218 | #undef N_15 | ||
| 219 | #undef N_05 | ||
| 220 | #undef DEF_TEST_SETUP | ||
| 221 | |||
| 222 | |||
| 223 | |||
| 224 | /* These are the mirror cases to the above ones. */ | ||
| 225 | |||
| 226 | #define N_50 (n[0]) | ||
| 227 | #define N_70 (n[1]) | ||
| 228 | #define N_80 (n[2]) | ||
| 229 | #define N_90 (n[3]) | ||
| 230 | #define N_85 (n[4]) | ||
| 231 | #define N_95 (n[5]) | ||
| 232 | |||
| 233 | #define DEF_TEST_SETUP() \ | ||
| 234 | struct interval_tree tree; \ | ||
| 235 | struct interval_node n[6]; \ | ||
| 236 | interval_tree_init (&tree); \ | ||
| 237 | const int values[] = {50, 70, 80, 90, 85, 95}; \ | ||
| 238 | for (int i = 0; i < 6; ++i) \ | ||
| 239 | { \ | ||
| 240 | n[i].begin = values[i]; \ | ||
| 241 | n[i].end = values[i]; \ | ||
| 242 | } | ||
| 243 | |||
| 244 | START_TEST (test_insert_7) | ||
| 245 | { | ||
| 246 | /* | ||
| 247 | * [50] | ||
| 248 | */ | ||
| 249 | |||
| 250 | DEF_TEST_SETUP (); | ||
| 251 | interval_tree_insert (&tree, &N_50); | ||
| 252 | ck_assert (N_50.color == ITREE_BLACK); | ||
| 253 | ck_assert (&N_50 == tree.root); | ||
| 254 | } | ||
| 255 | END_TEST | ||
| 256 | |||
| 257 | START_TEST (test_insert_8) | ||
| 258 | { | ||
| 259 | /* | ||
| 260 | * [50] | ||
| 261 | * \ | ||
| 262 | * (70) | ||
| 263 | */ | ||
| 264 | |||
| 265 | DEF_TEST_SETUP (); | ||
| 266 | interval_tree_insert (&tree, &N_50); | ||
| 267 | interval_tree_insert (&tree, &N_70); | ||
| 268 | ck_assert (N_50.color == ITREE_BLACK); | ||
| 269 | ck_assert (N_70.color == ITREE_RED); | ||
| 270 | ck_assert (&N_50 == tree.root); | ||
| 271 | ck_assert (N_70.parent == &N_50); | ||
| 272 | ck_assert (N_50.right == &N_70); | ||
| 273 | ck_assert (N_50.left == &tree.nil); | ||
| 274 | ck_assert (N_70.right == &tree.nil); | ||
| 275 | ck_assert (N_70.left == &tree.nil); | ||
| 276 | } | ||
| 277 | END_TEST | ||
| 278 | |||
| 279 | START_TEST (test_insert_9) | ||
| 280 | { | ||
| 281 | /* 3.a | ||
| 282 | * [70] | ||
| 283 | * / \ | ||
| 284 | * (50) (80) | ||
| 285 | */ | ||
| 286 | |||
| 287 | DEF_TEST_SETUP (); | ||
| 288 | interval_tree_insert (&tree, &N_50); | ||
| 289 | interval_tree_insert (&tree, &N_70); | ||
| 290 | interval_tree_insert (&tree, &N_80); | ||
| 291 | ck_assert (N_50.color == ITREE_RED); | ||
| 292 | ck_assert (N_70.color == ITREE_BLACK); | ||
| 293 | ck_assert (N_80.color == ITREE_RED); | ||
| 294 | ck_assert (&N_70 == tree.root); | ||
| 295 | ck_assert (N_50.parent == &N_70); | ||
| 296 | ck_assert (N_70.right == &N_80); | ||
| 297 | ck_assert (N_70.left == &N_50); | ||
| 298 | ck_assert (N_80.right == &tree.nil); | ||
| 299 | ck_assert (N_80.left == &tree.nil); | ||
| 300 | ck_assert (N_80.parent == &N_70); | ||
| 301 | } | ||
| 302 | END_TEST | ||
| 303 | |||
| 304 | START_TEST (test_insert_10) | ||
| 305 | { | ||
| 306 | /* 1.b | ||
| 307 | * [70] | ||
| 308 | * / \ | ||
| 309 | * [50] [80] | ||
| 310 | * \ | ||
| 311 | * (90) | ||
| 312 | */ | ||
| 313 | |||
| 314 | DEF_TEST_SETUP (); | ||
| 315 | interval_tree_insert (&tree, &N_50); | ||
| 316 | interval_tree_insert (&tree, &N_70); | ||
| 317 | interval_tree_insert (&tree, &N_80); | ||
| 318 | interval_tree_insert (&tree, &N_90); | ||
| 319 | ck_assert (N_50.color == ITREE_BLACK); | ||
| 320 | ck_assert (N_70.color == ITREE_BLACK); | ||
| 321 | ck_assert (N_80.color == ITREE_BLACK); | ||
| 322 | ck_assert (N_90.color == ITREE_RED); | ||
| 323 | ck_assert (&N_70 == tree.root); | ||
| 324 | ck_assert (N_50.parent == &N_70); | ||
| 325 | ck_assert (N_70.right == &N_80); | ||
| 326 | ck_assert (N_70.left == &N_50); | ||
| 327 | ck_assert (N_80.right == &N_90); | ||
| 328 | ck_assert (N_80.left == &tree.nil); | ||
| 329 | ck_assert (N_80.parent == &N_70); | ||
| 330 | ck_assert (N_90.parent == &N_80); | ||
| 331 | ck_assert (N_80.right == &N_90); | ||
| 332 | ck_assert (N_90.left == &tree.nil); | ||
| 333 | } | ||
| 334 | END_TEST | ||
| 335 | |||
| 336 | START_TEST (test_insert_11) | ||
| 337 | { | ||
| 338 | /* 2.b | ||
| 339 | * [70] | ||
| 340 | * / \ | ||
| 341 | * [50] [85] | ||
| 342 | * / \ | ||
| 343 | * (80) (90) | ||
| 344 | */ | ||
| 345 | |||
| 346 | DEF_TEST_SETUP (); | ||
| 347 | interval_tree_insert (&tree, &N_50); | ||
| 348 | interval_tree_insert (&tree, &N_70); | ||
| 349 | interval_tree_insert (&tree, &N_80); | ||
| 350 | interval_tree_insert (&tree, &N_90); | ||
| 351 | interval_tree_insert (&tree, &N_85); | ||
| 352 | ck_assert (N_50.color == ITREE_BLACK); | ||
| 353 | ck_assert (N_70.color == ITREE_BLACK); | ||
| 354 | ck_assert (N_80.color == ITREE_RED); | ||
| 355 | ck_assert (N_90.color == ITREE_RED); | ||
| 356 | ck_assert (N_85.color == ITREE_BLACK); | ||
| 357 | ck_assert (&N_70 == tree.root); | ||
| 358 | ck_assert (N_50.parent == &N_70); | ||
| 359 | ck_assert (N_70.right == &N_85); | ||
| 360 | ck_assert (N_70.left == &N_50); | ||
| 361 | ck_assert (N_80.right == &tree.nil); | ||
| 362 | ck_assert (N_80.left == &tree.nil); | ||
| 363 | ck_assert (N_80.parent == &N_85); | ||
| 364 | ck_assert (N_90.parent == &N_85); | ||
| 365 | ck_assert (N_80.right == &tree.nil); | ||
| 366 | ck_assert (N_90.left == &tree.nil); | ||
| 367 | ck_assert (N_85.right == &N_90); | ||
| 368 | ck_assert (N_85.left == &N_80); | ||
| 369 | ck_assert (N_85.parent == &N_70); | ||
| 370 | |||
| 371 | } | ||
| 372 | END_TEST | ||
| 373 | |||
| 374 | START_TEST (test_insert_12) | ||
| 375 | { | ||
| 376 | /* 1.b | ||
| 377 | * [70] | ||
| 378 | * / \ | ||
| 379 | * [50] (85) | ||
| 380 | * / \ | ||
| 381 | * [80] [90] | ||
| 382 | * \ | ||
| 383 | * (95) | ||
| 384 | */ | ||
| 385 | |||
| 386 | DEF_TEST_SETUP (); | ||
| 387 | interval_tree_insert (&tree, &N_50); | ||
| 388 | interval_tree_insert (&tree, &N_70); | ||
| 389 | interval_tree_insert (&tree, &N_80); | ||
| 390 | interval_tree_insert (&tree, &N_90); | ||
| 391 | interval_tree_insert (&tree, &N_85); | ||
| 392 | interval_tree_insert (&tree, &N_95); | ||
| 393 | ck_assert (N_50.color == ITREE_BLACK); | ||
| 394 | ck_assert (N_70.color == ITREE_BLACK); | ||
| 395 | ck_assert (N_80.color == ITREE_BLACK); | ||
| 396 | ck_assert (N_90.color == ITREE_BLACK); | ||
| 397 | ck_assert (N_85.color == ITREE_RED); | ||
| 398 | ck_assert (N_95.color == ITREE_RED); | ||
| 399 | ck_assert (&N_70 == tree.root); | ||
| 400 | ck_assert (N_50.parent == &N_70); | ||
| 401 | ck_assert (N_70.right == &N_85); | ||
| 402 | ck_assert (N_70.left == &N_50); | ||
| 403 | ck_assert (N_80.right == &tree.nil); | ||
| 404 | ck_assert (N_80.left == &tree.nil); | ||
| 405 | ck_assert (N_80.parent == &N_85); | ||
| 406 | ck_assert (N_90.parent == &N_85); | ||
| 407 | ck_assert (N_80.right == &tree.nil); | ||
| 408 | ck_assert (N_90.left == &tree.nil); | ||
| 409 | ck_assert (N_85.right == &N_90); | ||
| 410 | ck_assert (N_85.left == &N_80); | ||
| 411 | ck_assert (N_85.parent == &N_70); | ||
| 412 | ck_assert (N_95.parent == &N_90); | ||
| 413 | ck_assert (N_90.right == &N_95); | ||
| 414 | ck_assert (N_95.left == &tree.nil); | ||
| 415 | } | ||
| 416 | END_TEST | ||
| 417 | |||
| 418 | #undef N_50 | ||
| 419 | #undef N_70 | ||
| 420 | #undef N_80 | ||
| 421 | #undef N_90 | ||
| 422 | #undef N_85 | ||
| 423 | #undef N_95 | ||
| 424 | #undef DEF_TEST_SETUP | ||
| 425 | |||
| 426 | struct interval_tree* | ||
| 427 | test_get_tree4 (struct interval_node **n) | ||
| 428 | { | ||
| 429 | static struct interval_tree tree; | ||
| 430 | static struct interval_node nodes[4]; | ||
| 431 | memset (&tree, 0, sizeof (struct interval_tree)); | ||
| 432 | memset (&nodes, 0, 4 * sizeof (struct interval_node)); | ||
| 433 | interval_tree_init (&tree); | ||
| 434 | for (int i = 0; i < 4; ++i) | ||
| 435 | { | ||
| 436 | nodes[i].begin = 10 * (i + 1); | ||
| 437 | nodes[i].end = nodes[i].begin; | ||
| 438 | interval_tree_insert (&tree, &nodes[i]); | ||
| 439 | } | ||
| 440 | *n = nodes; | ||
| 441 | return &tree; | ||
| 442 | } | ||
| 443 | |||
| 444 | static void | ||
| 445 | shuffle (int *index, int n) | ||
| 446 | { | ||
| 447 | for (int i = n - 1; i >= 0; --i) | ||
| 448 | { | ||
| 449 | int j = random () % (i + 1); | ||
| 450 | int h = index[j]; | ||
| 451 | index[j] = index[i]; | ||
| 452 | index[i] = h; | ||
| 453 | } | ||
| 454 | } | ||
| 455 | |||
| 456 | #define N_10 (nodes[0]) | ||
| 457 | #define N_20 (nodes[1]) | ||
| 458 | #define N_30 (nodes[2]) | ||
| 459 | #define N_40 (nodes[3]) | ||
| 460 | |||
| 461 | START_TEST (test_insert_13) | ||
| 462 | { | ||
| 463 | struct interval_node *nodes = NULL; | ||
| 464 | struct interval_tree *tree = test_get_tree4 (&nodes); | ||
| 465 | |||
| 466 | |||
| 467 | ck_assert (tree->root == &N_20); | ||
| 468 | ck_assert (N_20.left == &N_10); | ||
| 469 | ck_assert (N_20.right == &N_30); | ||
| 470 | ck_assert (N_30.right == &N_40); | ||
| 471 | ck_assert (N_10.color == ITREE_BLACK); | ||
| 472 | ck_assert (N_20.color == ITREE_BLACK); | ||
| 473 | ck_assert (N_30.color == ITREE_BLACK); | ||
| 474 | ck_assert (N_40.color == ITREE_RED); | ||
| 475 | } | ||
| 476 | END_TEST | ||
| 477 | |||
| 478 | START_TEST (test_insert_14) | ||
| 479 | { | ||
| 480 | struct interval_tree tree; | ||
| 481 | struct interval_node nodes[3]; | ||
| 482 | |||
| 483 | nodes[0].begin = nodes[1].begin = nodes[2].begin = 10; | ||
| 484 | nodes[0].end = nodes[1].end = nodes[2].end = 10; | ||
| 485 | |||
| 486 | for (int i = 0; i < 3; ++i) | ||
| 487 | interval_tree_insert (&tree, &nodes[i]); | ||
| 488 | for (int i = 0; i < 3; ++i) | ||
| 489 | ck_assert (interval_tree_contains (&tree, &nodes[i])); | ||
| 490 | } | ||
| 491 | END_TEST | ||
| 492 | |||
| 493 | |||
| 494 | |||
| 495 | |||
| 496 | /* +===================================================================================+ | ||
| 497 | * | Remove | ||
| 498 | * +===================================================================================+ */ | ||
| 499 | |||
| 500 | #define A (nodes[0]) | ||
| 501 | #define B (nodes[1]) | ||
| 502 | #define C (nodes[2]) | ||
| 503 | #define D (nodes[3]) | ||
| 504 | #define E (nodes[4]) | ||
| 505 | |||
| 506 | /* Creating proper test trees for the formal tests via insertions is | ||
| 507 | way to tedious, so we just fake it and only test the | ||
| 508 | fix-routine. */ | ||
| 509 | #define DEF_TEST_SETUP() \ | ||
| 510 | struct interval_tree tree; \ | ||
| 511 | struct interval_node nodes[5]; \ | ||
| 512 | interval_tree_init (&tree); \ | ||
| 513 | tree.root = &B; \ | ||
| 514 | A.parent = &B; B.parent = &tree.nil; C.parent = &D; \ | ||
| 515 | D.parent = &B; E.parent = &D; \ | ||
| 516 | A.left = A.right = C.left = C.right = &tree.nil; \ | ||
| 517 | E.left = E.right = &tree.nil; \ | ||
| 518 | B.left = &A; B.right = &D; D.left = &C; D.right = &E \ | ||
| 519 | |||
| 520 | /* 1.a -> 2.a | ||
| 521 | * [B] | ||
| 522 | * / \ | ||
| 523 | * [A] (D) | ||
| 524 | * / \ | ||
| 525 | * [C] [E] | ||
| 526 | */ | ||
| 527 | |||
| 528 | |||
| 529 | START_TEST (test_remove_1) | ||
| 530 | { | ||
| 531 | DEF_TEST_SETUP (); | ||
| 532 | B.color = A.color = C.color = E.color = ITREE_BLACK; | ||
| 533 | D.color = ITREE_RED; | ||
| 534 | interval_tree_remove_fix (&tree, &A); | ||
| 535 | |||
| 536 | ck_assert (A.color == ITREE_BLACK); | ||
| 537 | ck_assert (B.color == ITREE_BLACK); | ||
| 538 | ck_assert (C.color == ITREE_RED); | ||
| 539 | ck_assert (D.color == ITREE_BLACK); | ||
| 540 | ck_assert (E.color == ITREE_BLACK); | ||
| 541 | ck_assert (A.parent == &B); | ||
| 542 | ck_assert (B.left == &A); | ||
| 543 | ck_assert (B.right == &C); | ||
| 544 | ck_assert (C.parent == &B); | ||
| 545 | ck_assert (E.parent == &D); | ||
| 546 | ck_assert (D.right == &E); | ||
| 547 | ck_assert (D.left == &B); | ||
| 548 | ck_assert (tree.root == &D); | ||
| 549 | } | ||
| 550 | END_TEST | ||
| 551 | |||
| 552 | /* 2.a */ | ||
| 553 | START_TEST (test_remove_2) | ||
| 554 | { | ||
| 555 | DEF_TEST_SETUP (); | ||
| 556 | B.color = D.color = A.color = C.color = E.color = ITREE_BLACK; | ||
| 557 | interval_tree_remove_fix (&tree, &A); | ||
| 558 | |||
| 559 | ck_assert (A.color == ITREE_BLACK); | ||
| 560 | ck_assert (B.color == ITREE_BLACK); | ||
| 561 | ck_assert (C.color == ITREE_BLACK); | ||
| 562 | ck_assert (D.color == ITREE_RED); | ||
| 563 | ck_assert (E.color == ITREE_BLACK); | ||
| 564 | ck_assert (A.parent == &B); | ||
| 565 | ck_assert (B.left == &A); | ||
| 566 | ck_assert (B.right == &D); | ||
| 567 | ck_assert (C.parent == &D); | ||
| 568 | ck_assert (E.parent == &D); | ||
| 569 | ck_assert (tree.root == &B); | ||
| 570 | } | ||
| 571 | END_TEST | ||
| 572 | |||
| 573 | /* 3.a -> 4.a*/ | ||
| 574 | START_TEST (test_remove_3) | ||
| 575 | { | ||
| 576 | DEF_TEST_SETUP (); | ||
| 577 | D.color = A.color = E.color = ITREE_BLACK; | ||
| 578 | B.color = C.color = ITREE_RED; | ||
| 579 | interval_tree_remove_fix (&tree, &A); | ||
| 580 | |||
| 581 | ck_assert (A.color == ITREE_BLACK); | ||
| 582 | ck_assert (B.color == ITREE_BLACK); | ||
| 583 | ck_assert (C.color == ITREE_BLACK); | ||
| 584 | ck_assert (D.color == ITREE_BLACK); | ||
| 585 | ck_assert (E.color == ITREE_BLACK); | ||
| 586 | ck_assert (A.parent == &B); | ||
| 587 | ck_assert (B.left == &A); | ||
| 588 | ck_assert (B.right == &tree.nil); | ||
| 589 | ck_assert (&C == tree.root); | ||
| 590 | ck_assert (C.left == &B); | ||
| 591 | ck_assert (C.right == &D); | ||
| 592 | ck_assert (E.parent == &D); | ||
| 593 | ck_assert (D.left == &tree.nil); | ||
| 594 | |||
| 595 | } | ||
| 596 | END_TEST | ||
| 597 | |||
| 598 | /* 4.a */ | ||
| 599 | START_TEST (test_remove_4) | ||
| 600 | { | ||
| 601 | DEF_TEST_SETUP (); | ||
| 602 | B.color = C.color = E.color = ITREE_RED; | ||
| 603 | A.color = D.color = ITREE_BLACK; | ||
| 604 | interval_tree_remove_fix (&tree, &A); | ||
| 605 | |||
| 606 | ck_assert (A.color == ITREE_BLACK); | ||
| 607 | ck_assert (B.color == ITREE_BLACK); | ||
| 608 | ck_assert (C.color == ITREE_RED); | ||
| 609 | ck_assert (D.color == ITREE_BLACK); | ||
| 610 | ck_assert (E.color == ITREE_BLACK); | ||
| 611 | ck_assert (A.parent == &B); | ||
| 612 | ck_assert (B.left == &A); | ||
| 613 | ck_assert (B.right == &C); | ||
| 614 | ck_assert (C.parent == &B); | ||
| 615 | ck_assert (E.parent == &D); | ||
| 616 | ck_assert (tree.root == &D); | ||
| 617 | } | ||
| 618 | END_TEST | ||
| 619 | |||
| 620 | |||
| 621 | #undef A | ||
| 622 | #undef B | ||
| 623 | #undef C | ||
| 624 | #undef D | ||
| 625 | #undef E | ||
| 626 | #undef DEF_TEST_SETUP | ||
| 627 | |||
| 628 | |||
| 629 | |||
| 630 | /* These are the mirrored cases. */ | ||
| 631 | |||
| 632 | #define A (nodes[0]) | ||
| 633 | #define B (nodes[1]) | ||
| 634 | #define C (nodes[2]) | ||
| 635 | #define D (nodes[3]) | ||
| 636 | #define E (nodes[4]) | ||
| 637 | |||
| 638 | #define DEF_TEST_SETUP() \ | ||
| 639 | struct interval_tree tree; \ | ||
| 640 | struct interval_node nodes[5]; \ | ||
| 641 | interval_tree_init (&tree); \ | ||
| 642 | tree.root = &B; \ | ||
| 643 | A.parent = &B; B.parent = &tree.nil; C.parent = &D; \ | ||
| 644 | D.parent = &B; E.parent = &D; \ | ||
| 645 | A.right = A.left = C.right = C.left = &tree.nil; \ | ||
| 646 | E.right = E.left = &tree.nil; \ | ||
| 647 | B.right = &A; B.left = &D; D.right = &C; D.left = &E \ | ||
| 648 | |||
| 649 | /* 1.b -> 2.b | ||
| 650 | * [B] | ||
| 651 | * / \ | ||
| 652 | * [A] (D) | ||
| 653 | * / \ | ||
| 654 | * [C] [E] | ||
| 655 | */ | ||
| 656 | |||
| 657 | |||
| 658 | START_TEST (test_remove_5) | ||
| 659 | { | ||
| 660 | DEF_TEST_SETUP (); | ||
| 661 | B.color = A.color = C.color = E.color = ITREE_BLACK; | ||
| 662 | D.color = ITREE_RED; | ||
| 663 | interval_tree_remove_fix (&tree, &A); | ||
| 664 | |||
| 665 | ck_assert (A.color == ITREE_BLACK); | ||
| 666 | ck_assert (B.color == ITREE_BLACK); | ||
| 667 | ck_assert (C.color == ITREE_RED); | ||
| 668 | ck_assert (D.color == ITREE_BLACK); | ||
| 669 | ck_assert (E.color == ITREE_BLACK); | ||
| 670 | ck_assert (A.parent == &B); | ||
| 671 | ck_assert (B.right == &A); | ||
| 672 | ck_assert (B.left == &C); | ||
| 673 | ck_assert (C.parent == &B); | ||
| 674 | ck_assert (E.parent == &D); | ||
| 675 | ck_assert (D.left == &E); | ||
| 676 | ck_assert (D.right == &B); | ||
| 677 | ck_assert (tree.root == &D); | ||
| 678 | } | ||
| 679 | END_TEST | ||
| 680 | |||
| 681 | /* 2.b */ | ||
| 682 | START_TEST (test_remove_6) | ||
| 683 | { | ||
| 684 | DEF_TEST_SETUP (); | ||
| 685 | B.color = D.color = A.color = C.color = E.color = ITREE_BLACK; | ||
| 686 | interval_tree_remove_fix (&tree, &A); | ||
| 687 | |||
| 688 | ck_assert (A.color == ITREE_BLACK); | ||
| 689 | ck_assert (B.color == ITREE_BLACK); | ||
| 690 | ck_assert (C.color == ITREE_BLACK); | ||
| 691 | ck_assert (D.color == ITREE_RED); | ||
| 692 | ck_assert (E.color == ITREE_BLACK); | ||
| 693 | ck_assert (A.parent == &B); | ||
| 694 | ck_assert (B.right == &A); | ||
| 695 | ck_assert (B.left == &D); | ||
| 696 | ck_assert (C.parent == &D); | ||
| 697 | ck_assert (E.parent == &D); | ||
| 698 | ck_assert (tree.root == &B); | ||
| 699 | } | ||
| 700 | END_TEST | ||
| 701 | |||
| 702 | /* 3.b -> 4.b*/ | ||
| 703 | START_TEST (test_remove_7) | ||
| 704 | { | ||
| 705 | DEF_TEST_SETUP (); | ||
| 706 | D.color = A.color = E.color = ITREE_BLACK; | ||
| 707 | B.color = C.color = ITREE_RED; | ||
| 708 | interval_tree_remove_fix (&tree, &A); | ||
| 709 | |||
| 710 | ck_assert (A.color == ITREE_BLACK); | ||
| 711 | ck_assert (B.color == ITREE_BLACK); | ||
| 712 | ck_assert (C.color == ITREE_BLACK); | ||
| 713 | ck_assert (D.color == ITREE_BLACK); | ||
| 714 | ck_assert (E.color == ITREE_BLACK); | ||
| 715 | ck_assert (A.parent == &B); | ||
| 716 | ck_assert (B.right == &A); | ||
| 717 | ck_assert (B.left == &tree.nil); | ||
| 718 | ck_assert (&C == tree.root); | ||
| 719 | ck_assert (C.right == &B); | ||
| 720 | ck_assert (C.left == &D); | ||
| 721 | ck_assert (E.parent == &D); | ||
| 722 | ck_assert (D.right == &tree.nil); | ||
| 723 | |||
| 724 | } | ||
| 725 | END_TEST | ||
| 726 | |||
| 727 | /* 4.b */ | ||
| 728 | START_TEST (test_remove_8) | ||
| 729 | { | ||
| 730 | DEF_TEST_SETUP (); | ||
| 731 | B.color = C.color = E.color = ITREE_RED; | ||
| 732 | A.color = D.color = ITREE_BLACK; | ||
| 733 | interval_tree_remove_fix (&tree, &A); | ||
| 734 | |||
| 735 | ck_assert (A.color == ITREE_BLACK); | ||
| 736 | ck_assert (B.color == ITREE_BLACK); | ||
| 737 | ck_assert (C.color == ITREE_RED); | ||
| 738 | ck_assert (D.color == ITREE_BLACK); | ||
| 739 | ck_assert (E.color == ITREE_BLACK); | ||
| 740 | ck_assert (A.parent == &B); | ||
| 741 | ck_assert (B.right == &A); | ||
| 742 | ck_assert (B.left == &C); | ||
| 743 | ck_assert (C.parent == &B); | ||
| 744 | ck_assert (E.parent == &D); | ||
| 745 | ck_assert (tree.root == &D); | ||
| 746 | } | ||
| 747 | END_TEST | ||
| 748 | |||
| 749 | |||
| 750 | #undef A | ||
| 751 | #undef B | ||
| 752 | #undef C | ||
| 753 | #undef D | ||
| 754 | #undef E | ||
| 755 | #undef DEF_TEST_SETUP | ||
| 756 | |||
| 757 | |||
| 758 | START_TEST (test_remove_9) | ||
| 759 | { | ||
| 760 | struct interval_node *nodes = NULL; | ||
| 761 | struct interval_tree *tree = test_get_tree4 (&nodes); | ||
| 762 | |||
| 763 | ck_assert (tree->root == &N_20); | ||
| 764 | ck_assert (N_20.left == &N_10); | ||
| 765 | ck_assert (N_20.right == &N_30); | ||
| 766 | ck_assert (N_30.right == &N_40); | ||
| 767 | ck_assert (N_20.color == ITREE_BLACK); | ||
| 768 | ck_assert (N_10.color == ITREE_BLACK); | ||
| 769 | ck_assert (N_30.color == ITREE_BLACK); | ||
| 770 | ck_assert (N_40.color == ITREE_RED); | ||
| 771 | |||
| 772 | interval_tree_remove (tree, &N_10); | ||
| 773 | |||
| 774 | ck_assert (tree->root == &N_30); | ||
| 775 | ck_assert (N_30.parent == &tree->nil); | ||
| 776 | ck_assert (N_30.left == &N_20); | ||
| 777 | ck_assert (N_30.right == &N_40); | ||
| 778 | ck_assert (N_20.color == ITREE_BLACK); | ||
| 779 | ck_assert (N_30.color == ITREE_BLACK); | ||
| 780 | ck_assert (N_40.color == ITREE_BLACK); | ||
| 781 | } | ||
| 782 | END_TEST | ||
| 783 | |||
| 784 | #define N 3 | ||
| 785 | |||
| 786 | START_TEST (test_remove_10) | ||
| 787 | { | ||
| 788 | struct interval_tree tree; | ||
| 789 | struct interval_node nodes[N]; | ||
| 790 | int index[N]; | ||
| 791 | |||
| 792 | srand (42); | ||
| 793 | interval_tree_init (&tree); | ||
| 794 | for (int i = 0; i < N; ++i) | ||
| 795 | { | ||
| 796 | nodes[i].begin = (i + 1) * 10; | ||
| 797 | nodes[i].end = nodes[i].begin + 1; | ||
| 798 | index[i] = i; | ||
| 799 | } | ||
| 800 | shuffle (index, N); | ||
| 801 | for (int i = 0; i < N; ++i) | ||
| 802 | interval_tree_insert (&tree, &nodes[index[i]]); | ||
| 803 | |||
| 804 | shuffle (index, N); | ||
| 805 | for (int i = 0; i < N; ++i) | ||
| 806 | { | ||
| 807 | ck_assert (interval_tree_contains (&tree, &nodes[index[i]])); | ||
| 808 | interval_tree_remove (&tree, &nodes[index[i]]); | ||
| 809 | } | ||
| 810 | ck_assert (tree.root == &tree.nil); | ||
| 811 | ck_assert (tree.size == 0); | ||
| 812 | } | ||
| 813 | END_TEST | ||
| 814 | |||
| 815 | |||
| 816 | /* +===================================================================================+ | ||
| 817 | * | Generator | ||
| 818 | * +===================================================================================+ */ | ||
| 819 | |||
| 820 | START_TEST (test_generator_1) | ||
| 821 | { | ||
| 822 | struct interval_tree tree; | ||
| 823 | struct interval_node node, *n; | ||
| 824 | struct interval_generator *g; | ||
| 825 | interval_tree_init (&tree); | ||
| 826 | node.begin = 10; | ||
| 827 | node.end = 20; | ||
| 828 | interval_tree_insert (&tree, &node); | ||
| 829 | g = interval_generator_create (&tree); | ||
| 830 | interval_generator_reset (g, 0, 30, ITREE_ASCENDING); | ||
| 831 | n = interval_generator_next (g); | ||
| 832 | ck_assert (n == &node); | ||
| 833 | ck_assert (n->begin == 10 && n->end == 20); | ||
| 834 | ck_assert (interval_generator_next (g) == NULL); | ||
| 835 | ck_assert (interval_generator_next (g) == NULL); | ||
| 836 | ck_assert (interval_generator_next (g) == NULL); | ||
| 837 | interval_generator_destroy (g); | ||
| 838 | |||
| 839 | g = interval_generator_create (&tree); | ||
| 840 | interval_generator_reset (g, 30, 50, ITREE_ASCENDING); | ||
| 841 | ck_assert (interval_generator_next (g) == NULL); | ||
| 842 | ck_assert (interval_generator_next (g) == NULL); | ||
| 843 | ck_assert (interval_generator_next (g) == NULL); | ||
| 844 | interval_generator_destroy (g); | ||
| 845 | } | ||
| 846 | END_TEST | ||
| 847 | |||
| 848 | void | ||
| 849 | test_check_generator (struct interval_tree *tree, | ||
| 850 | ptrdiff_t begin, ptrdiff_t end, | ||
| 851 | int n, ...) | ||
| 852 | { | ||
| 853 | va_list ap; | ||
| 854 | struct interval_generator *g = interval_generator_create (tree); | ||
| 855 | interval_generator_reset (g, begin, end, ITREE_ASCENDING); | ||
| 856 | |||
| 857 | va_start (ap, n); | ||
| 858 | for (int i = 0; i < n; ++i) | ||
| 859 | { | ||
| 860 | ptrdiff_t begin = va_arg (ap, ptrdiff_t); | ||
| 861 | struct interval_node *node = interval_generator_next (g); | ||
| 862 | ck_assert (node); | ||
| 863 | ck_assert_int_eq (node->begin, begin); | ||
| 864 | } | ||
| 865 | va_end (ap); | ||
| 866 | ck_assert (! interval_generator_next (g)); | ||
| 867 | ck_assert (! interval_generator_next (g)); | ||
| 868 | interval_generator_destroy (g); | ||
| 869 | } | ||
| 870 | |||
| 871 | #define DEF_TEST_SETUP() \ | ||
| 872 | |||
| 873 | |||
| 874 | START_TEST (test_generator_2) | ||
| 875 | { | ||
| 876 | struct interval_tree tree; | ||
| 877 | struct interval_node nodes[3]; | ||
| 878 | |||
| 879 | interval_tree_init (&tree); | ||
| 880 | |||
| 881 | for (int i = 0; i < 3; ++i) { | ||
| 882 | nodes[i].begin = 10 * (i + 1); | ||
| 883 | nodes[i].end = 10 * (i + 2); | ||
| 884 | interval_tree_insert (&tree, &nodes[i]); | ||
| 885 | } | ||
| 886 | |||
| 887 | test_check_generator (&tree, 0, 50, 3, | ||
| 888 | 10, 20, 30); | ||
| 889 | test_check_generator (&tree, 0, 10, 0); | ||
| 890 | test_check_generator (&tree, 40, 50, 0); | ||
| 891 | test_check_generator (&tree, 15, 35, 3, | ||
| 892 | 10, 20, 30); | ||
| 893 | test_check_generator (&tree, -100, -50, 0); | ||
| 894 | test_check_generator (&tree, -100, -50, 0); | ||
| 895 | test_check_generator (&tree, 100, 50, 0); | ||
| 896 | test_check_generator (&tree, 100, 150, 0); | ||
| 897 | test_check_generator (&tree, 0, 0, 0); | ||
| 898 | test_check_generator (&tree, 40, 40, 0); | ||
| 899 | test_check_generator (&tree, 30, 30, 0); | ||
| 900 | test_check_generator (&tree, 35, 35, 1, | ||
| 901 | 30); | ||
| 902 | } | ||
| 903 | END_TEST | ||
| 904 | |||
| 905 | |||
| 906 | struct interval_node* | ||
| 907 | test_create_tree (struct interval_tree *tree, int n, | ||
| 908 | bool doshuffle, ...) | ||
| 909 | { | ||
| 910 | va_list ap; | ||
| 911 | struct interval_node *nodes = calloc (n, sizeof (struct interval_node)); | ||
| 912 | int *index = calloc (n, sizeof (int)); | ||
| 913 | |||
| 914 | interval_tree_init (tree); | ||
| 915 | va_start (ap, doshuffle); | ||
| 916 | for (int i = 0; i < n; ++i) | ||
| 917 | { | ||
| 918 | ptrdiff_t begin = va_arg (ap, ptrdiff_t); | ||
| 919 | ptrdiff_t end = va_arg (ap, ptrdiff_t); | ||
| 920 | nodes[i].begin = begin; | ||
| 921 | nodes[i].end = end; | ||
| 922 | index[i] = i; | ||
| 923 | } | ||
| 924 | va_end (ap); | ||
| 925 | srand (42); | ||
| 926 | if (doshuffle) | ||
| 927 | shuffle (index, n); | ||
| 928 | for (int i = 0; i < n; ++i) | ||
| 929 | interval_tree_insert (tree, &nodes[index[i]]); | ||
| 930 | free (index); | ||
| 931 | |||
| 932 | return nodes; | ||
| 933 | } | ||
| 934 | |||
| 935 | START_TEST (test_generator_3) | ||
| 936 | { | ||
| 937 | struct interval_tree tree; | ||
| 938 | struct interval_node *nodes = NULL; | ||
| 939 | |||
| 940 | nodes = test_create_tree (&tree, 3, true, | ||
| 941 | 10, 10, | ||
| 942 | 10, 10, | ||
| 943 | 10, 10); | ||
| 944 | test_check_generator (&tree, 0, 10, 0); | ||
| 945 | test_check_generator (&tree, 10, 10, 3, 10, 10, 10); | ||
| 946 | test_check_generator (&tree, 10, 20, 3, 10, 10, 10); | ||
| 947 | free (nodes); | ||
| 948 | } | ||
| 949 | END_TEST | ||
| 950 | |||
| 951 | #define FOREACH(n, g) \ | ||
| 952 | for ((n) = interval_generator_next (g); (n) != NULL; \ | ||
| 953 | (n) = interval_generator_next (g)) | ||
| 954 | |||
| 955 | START_TEST (test_generator_5) | ||
| 956 | { | ||
| 957 | struct interval_tree tree; | ||
| 958 | struct interval_node *nodes; | ||
| 959 | struct interval_generator *g; | ||
| 960 | nodes = test_create_tree (&tree, 4, false, | ||
| 961 | 10, 30, | ||
| 962 | 20, 40, | ||
| 963 | 30, 50, | ||
| 964 | 40, 60); | ||
| 965 | g = interval_generator_create (&tree); | ||
| 966 | interval_generator_reset (g, 0, 100, ITREE_PRE_ORDER); | ||
| 967 | for (int i = 0; i < 4; ++i) | ||
| 968 | { | ||
| 969 | struct interval_node *n = interval_generator_next (g); | ||
| 970 | ck_assert (n); | ||
| 971 | switch (i) | ||
| 972 | { | ||
| 973 | case 0: ck_assert_int_eq (20, n->begin); break; | ||
| 974 | case 1: ck_assert_int_eq (10, n->begin); break; | ||
| 975 | case 2: ck_assert_int_eq (30, n->begin); break; | ||
| 976 | case 3: ck_assert_int_eq (40, n->begin); break; | ||
| 977 | } | ||
| 978 | } | ||
| 979 | interval_generator_destroy (g); | ||
| 980 | free (nodes); | ||
| 981 | |||
| 982 | } | ||
| 983 | END_TEST | ||
| 984 | |||
| 985 | START_TEST (test_generator_6) | ||
| 986 | { | ||
| 987 | struct interval_tree tree; | ||
| 988 | struct interval_node *nodes; | ||
| 989 | struct interval_generator *g; | ||
| 990 | nodes = test_create_tree (&tree, 4, true, | ||
| 991 | 10, 30, | ||
| 992 | 20, 40, | ||
| 993 | 30, 50, | ||
| 994 | 40, 60); | ||
| 995 | g = interval_generator_create (&tree); | ||
| 996 | interval_generator_reset (g, 0, 100, ITREE_ASCENDING); | ||
| 997 | for (int i = 0; i < 4; ++i) | ||
| 998 | { | ||
| 999 | struct interval_node *n = interval_generator_next (g); | ||
| 1000 | ck_assert (n); | ||
| 1001 | switch (i) | ||
| 1002 | { | ||
| 1003 | case 0: ck_assert_int_eq (10, n->begin); break; | ||
| 1004 | case 1: ck_assert_int_eq (20, n->begin); break; | ||
| 1005 | case 2: ck_assert_int_eq (30, n->begin); break; | ||
| 1006 | case 3: ck_assert_int_eq (40, n->begin); break; | ||
| 1007 | } | ||
| 1008 | } | ||
| 1009 | interval_generator_destroy (g); | ||
| 1010 | free (nodes); | ||
| 1011 | |||
| 1012 | } | ||
| 1013 | END_TEST | ||
| 1014 | |||
| 1015 | START_TEST (test_generator_7) | ||
| 1016 | { | ||
| 1017 | struct interval_tree tree; | ||
| 1018 | struct interval_node *nodes; | ||
| 1019 | struct interval_generator *g; | ||
| 1020 | nodes = test_create_tree (&tree, 4, true, | ||
| 1021 | 10, 30, | ||
| 1022 | 20, 40, | ||
| 1023 | 30, 50, | ||
| 1024 | 40, 60); | ||
| 1025 | g = interval_generator_create (&tree); | ||
| 1026 | interval_generator_reset (g, 0, 100, ITREE_DESCENDING); | ||
| 1027 | for (int i = 0; i < 4; ++i) | ||
| 1028 | { | ||
| 1029 | struct interval_node *n = interval_generator_next (g); | ||
| 1030 | ck_assert (n); | ||
| 1031 | switch (i) | ||
| 1032 | { | ||
| 1033 | case 0: ck_assert_int_eq (40, n->begin); break; | ||
| 1034 | case 1: ck_assert_int_eq (30, n->begin); break; | ||
| 1035 | case 2: ck_assert_int_eq (20, n->begin); break; | ||
| 1036 | case 3: ck_assert_int_eq (10, n->begin); break; | ||
| 1037 | } | ||
| 1038 | } | ||
| 1039 | interval_generator_destroy (g); | ||
| 1040 | free (nodes); | ||
| 1041 | |||
| 1042 | } | ||
| 1043 | END_TEST | ||
| 1044 | |||
| 1045 | START_TEST (test_generator_8) | ||
| 1046 | { | ||
| 1047 | struct interval_tree tree; | ||
| 1048 | struct interval_node *nodes, *n; | ||
| 1049 | struct interval_generator *g; | ||
| 1050 | nodes = test_create_tree (&tree, 2, false, | ||
| 1051 | 20, 30, | ||
| 1052 | 40, 50); | ||
| 1053 | g = interval_generator_create (&tree); | ||
| 1054 | interval_generator_reset (g, 1, 60, ITREE_DESCENDING); | ||
| 1055 | n = interval_generator_next (g); | ||
| 1056 | ck_assert_int_eq (n->begin, 40); | ||
| 1057 | interval_generator_narrow (g, 50, 60); | ||
| 1058 | n = interval_generator_next (g); | ||
| 1059 | ck_assert (n == NULL); | ||
| 1060 | free (nodes); | ||
| 1061 | } | ||
| 1062 | END_TEST | ||
| 1063 | |||
| 1064 | |||
| 1065 | START_TEST (test_generator_9) | ||
| 1066 | { | ||
| 1067 | struct interval_tree tree; | ||
| 1068 | struct interval_node *nodes, *n; | ||
| 1069 | struct interval_generator *g; | ||
| 1070 | nodes = test_create_tree (&tree, 2, false, | ||
| 1071 | 25, 25, | ||
| 1072 | 20, 30); | ||
| 1073 | g = interval_generator_create (&tree); | ||
| 1074 | interval_generator_reset (g, 1, 30, ITREE_DESCENDING); | ||
| 1075 | n = interval_generator_next (g); | ||
| 1076 | ck_assert_int_eq (n->begin, 25); | ||
| 1077 | interval_generator_narrow (g, 25, 35); | ||
| 1078 | n = interval_generator_next (g); | ||
| 1079 | ck_assert_int_eq (n->begin, 20); | ||
| 1080 | free (nodes); | ||
| 1081 | } | ||
| 1082 | END_TEST | ||
| 1083 | |||
| 1084 | |||
| 1085 | /* +===================================================================================+ | ||
| 1086 | * | Insert Gap | ||
| 1087 | * +===================================================================================+ */ | ||
| 1088 | |||
| 1089 | static struct interval_tree gap_tree; | ||
| 1090 | static struct interval_node gap_node; | ||
| 1091 | |||
| 1092 | #define N_BEG (interval_tree_validate (&gap_tree, &gap_node)->begin) | ||
| 1093 | #define N_END (interval_tree_validate (&gap_tree, &gap_node)->end) | ||
| 1094 | |||
| 1095 | static void | ||
| 1096 | test_setup_gap_node (ptrdiff_t begin, ptrdiff_t end, | ||
| 1097 | bool front_advance, bool rear_advance) | ||
| 1098 | { | ||
| 1099 | interval_tree_init (&gap_tree); | ||
| 1100 | gap_node.begin = begin; | ||
| 1101 | gap_node.end = end; | ||
| 1102 | gap_node.front_advance = front_advance; | ||
| 1103 | gap_node.rear_advance = rear_advance; | ||
| 1104 | interval_tree_insert (&gap_tree, &gap_node); | ||
| 1105 | } | ||
| 1106 | |||
| 1107 | static void | ||
| 1108 | test_setup_gap_node_noadvance (ptrdiff_t begin, ptrdiff_t end) | ||
| 1109 | { | ||
| 1110 | test_setup_gap_node (begin, end, false, false); | ||
| 1111 | } | ||
| 1112 | |||
| 1113 | START_TEST (test_gap_insert_1) | ||
| 1114 | { | ||
| 1115 | test_setup_gap_node (100, 200, false, false); | ||
| 1116 | interval_tree_insert_gap (&gap_tree, 100 + 10, 20); | ||
| 1117 | ck_assert_int_eq (N_BEG, 100); | ||
| 1118 | ck_assert_int_eq (N_END, 200 + 20); | ||
| 1119 | } | ||
| 1120 | END_TEST | ||
| 1121 | |||
| 1122 | START_TEST (test_gap_insert_2) | ||
| 1123 | { | ||
| 1124 | test_setup_gap_node (100, 200, false, false); | ||
| 1125 | interval_tree_insert_gap (&gap_tree, 300, 10); | ||
| 1126 | ck_assert_int_eq (N_BEG, 100); | ||
| 1127 | ck_assert_int_eq (N_END, 200); | ||
| 1128 | } | ||
| 1129 | END_TEST | ||
| 1130 | |||
| 1131 | START_TEST (test_gap_insert_3) | ||
| 1132 | { | ||
| 1133 | test_setup_gap_node (100, 200, false, false); | ||
| 1134 | interval_tree_insert_gap (&gap_tree, 0, 15); | ||
| 1135 | ck_assert_int_eq (N_BEG, 100 + 15); | ||
| 1136 | ck_assert_int_eq (N_END, 200 + 15); | ||
| 1137 | } | ||
| 1138 | END_TEST | ||
| 1139 | |||
| 1140 | START_TEST (test_gap_insert_4) | ||
| 1141 | { | ||
| 1142 | test_setup_gap_node (100, 200, true, false); | ||
| 1143 | interval_tree_insert_gap (&gap_tree, 100, 20); | ||
| 1144 | ck_assert_int_eq (N_BEG, 100 + 20); | ||
| 1145 | ck_assert_int_eq (N_END, 200 + 20); | ||
| 1146 | |||
| 1147 | } | ||
| 1148 | END_TEST | ||
| 1149 | |||
| 1150 | START_TEST (test_gap_insert_5) | ||
| 1151 | { | ||
| 1152 | test_setup_gap_node (100, 200, false, false); | ||
| 1153 | interval_tree_insert_gap (&gap_tree, 100, 20); | ||
| 1154 | ck_assert_int_eq (N_BEG, 100); | ||
| 1155 | ck_assert_int_eq (N_END, 200 + 20); | ||
| 1156 | |||
| 1157 | } | ||
| 1158 | END_TEST | ||
| 1159 | |||
| 1160 | START_TEST (test_gap_insert_6) | ||
| 1161 | { | ||
| 1162 | test_setup_gap_node (100, 200, false, true); | ||
| 1163 | interval_tree_insert_gap (&gap_tree, 200, 20); | ||
| 1164 | ck_assert_int_eq (N_BEG, 100); | ||
| 1165 | ck_assert_int_eq (N_END, 200 + 20); | ||
| 1166 | |||
| 1167 | } | ||
| 1168 | END_TEST | ||
| 1169 | |||
| 1170 | START_TEST (test_gap_insert_7) | ||
| 1171 | { | ||
| 1172 | test_setup_gap_node (100, 200, false, false); | ||
| 1173 | interval_tree_insert_gap (&gap_tree, 200, 20); | ||
| 1174 | ck_assert_int_eq (N_BEG, 100); | ||
| 1175 | ck_assert_int_eq (N_END, 200); | ||
| 1176 | |||
| 1177 | } | ||
| 1178 | END_TEST | ||
| 1179 | |||
| 1180 | START_TEST (test_gap_insert_8) | ||
| 1181 | { | ||
| 1182 | test_setup_gap_node (100, 100, true, true); | ||
| 1183 | interval_tree_insert_gap (&gap_tree, 100, 20); | ||
| 1184 | ck_assert_int_eq (N_BEG, 100 + 20); | ||
| 1185 | ck_assert_int_eq (N_END, 100 + 20); | ||
| 1186 | |||
| 1187 | } | ||
| 1188 | END_TEST | ||
| 1189 | |||
| 1190 | START_TEST (test_gap_insert_9) | ||
| 1191 | { | ||
| 1192 | test_setup_gap_node (100, 100, false, true); | ||
| 1193 | interval_tree_insert_gap (&gap_tree, 100, 20); | ||
| 1194 | ck_assert_int_eq (N_BEG, 100); | ||
| 1195 | ck_assert_int_eq (N_END, 100 + 20); | ||
| 1196 | |||
| 1197 | } | ||
| 1198 | END_TEST | ||
| 1199 | |||
| 1200 | START_TEST (test_gap_insert_10) | ||
| 1201 | { | ||
| 1202 | test_setup_gap_node (100, 100, true, false); | ||
| 1203 | interval_tree_insert_gap (&gap_tree, 100, 20); | ||
| 1204 | ck_assert_int_eq (N_BEG, 100); | ||
| 1205 | ck_assert_int_eq (N_END, 100); | ||
| 1206 | |||
| 1207 | } | ||
| 1208 | END_TEST | ||
| 1209 | |||
| 1210 | START_TEST (test_gap_insert_11) | ||
| 1211 | { | ||
| 1212 | test_setup_gap_node (100, 100, false, false); | ||
| 1213 | interval_tree_insert_gap (&gap_tree, 100, 20); | ||
| 1214 | ck_assert_int_eq (N_BEG, 100); | ||
| 1215 | ck_assert_int_eq (N_END, 100); | ||
| 1216 | |||
| 1217 | } | ||
| 1218 | END_TEST | ||
| 1219 | |||
| 1220 | |||
| 1221 | /* +===================================================================================+ | ||
| 1222 | * | Delete Gap | ||
| 1223 | * +===================================================================================+ */ | ||
| 1224 | |||
| 1225 | START_TEST (test_gap_delete_1) | ||
| 1226 | { | ||
| 1227 | test_setup_gap_node_noadvance (100, 200); | ||
| 1228 | interval_tree_delete_gap (&gap_tree, 100 + 10, 20); | ||
| 1229 | ck_assert_int_eq (N_BEG, 100); | ||
| 1230 | ck_assert_int_eq (N_END, 200 - 20); | ||
| 1231 | |||
| 1232 | } | ||
| 1233 | END_TEST | ||
| 1234 | |||
| 1235 | START_TEST (test_gap_delete_2) | ||
| 1236 | { | ||
| 1237 | test_setup_gap_node_noadvance (100, 200); | ||
| 1238 | interval_tree_delete_gap (&gap_tree, 200 + 10, 20); | ||
| 1239 | ck_assert_int_eq (N_BEG, 100); | ||
| 1240 | ck_assert_int_eq (N_END, 200); | ||
| 1241 | |||
| 1242 | } | ||
| 1243 | END_TEST | ||
| 1244 | |||
| 1245 | START_TEST (test_gap_delete_3) | ||
| 1246 | { | ||
| 1247 | test_setup_gap_node_noadvance (100, 200); | ||
| 1248 | interval_tree_delete_gap (&gap_tree, 200, 20); | ||
| 1249 | ck_assert_int_eq (N_BEG, 100); | ||
| 1250 | ck_assert_int_eq (N_END, 200); | ||
| 1251 | |||
| 1252 | } | ||
| 1253 | END_TEST | ||
| 1254 | |||
| 1255 | START_TEST (test_gap_delete_4) | ||
| 1256 | { | ||
| 1257 | test_setup_gap_node_noadvance (100, 200); | ||
| 1258 | interval_tree_delete_gap (&gap_tree, 100 - 20, 20); | ||
| 1259 | ck_assert_int_eq (N_BEG, 100 - 20); | ||
| 1260 | ck_assert_int_eq (N_END, 200 - 20); | ||
| 1261 | |||
| 1262 | } | ||
| 1263 | END_TEST | ||
| 1264 | |||
| 1265 | START_TEST (test_gap_delete_5) | ||
| 1266 | { | ||
| 1267 | test_setup_gap_node_noadvance (100, 200); | ||
| 1268 | interval_tree_delete_gap (&gap_tree, 70, 20); | ||
| 1269 | ck_assert_int_eq (N_BEG, 100 - 20); | ||
| 1270 | ck_assert_int_eq (N_END, 200 - 20); | ||
| 1271 | |||
| 1272 | } | ||
| 1273 | END_TEST | ||
| 1274 | |||
| 1275 | START_TEST (test_gap_delete_6) | ||
| 1276 | { | ||
| 1277 | test_setup_gap_node_noadvance (100, 200); | ||
| 1278 | interval_tree_delete_gap (&gap_tree, 80, 100); | ||
| 1279 | ck_assert_int_eq (N_BEG, 80); | ||
| 1280 | ck_assert_int_eq (N_END, 100); | ||
| 1281 | } | ||
| 1282 | END_TEST | ||
| 1283 | |||
| 1284 | START_TEST (test_gap_delete_7) | ||
| 1285 | { | ||
| 1286 | test_setup_gap_node_noadvance (100, 200); | ||
| 1287 | interval_tree_delete_gap (&gap_tree, 120, 100); | ||
| 1288 | ck_assert_int_eq (N_BEG, 100); | ||
| 1289 | ck_assert_int_eq (N_END, 120); | ||
| 1290 | } | ||
| 1291 | END_TEST | ||
| 1292 | |||
| 1293 | START_TEST (test_gap_delete_8) | ||
| 1294 | { | ||
| 1295 | test_setup_gap_node_noadvance (100, 200); | ||
| 1296 | interval_tree_delete_gap (&gap_tree, 100 - 20, 200 + 20); | ||
| 1297 | ck_assert_int_eq (N_BEG, 100 - 20); | ||
| 1298 | ck_assert_int_eq (N_END, 100 - 20); | ||
| 1299 | |||
| 1300 | } | ||
| 1301 | END_TEST | ||
| 1302 | |||
| 1303 | |||
| 1304 | |||
| 1305 | Suite * basic_suite () | ||
| 1306 | { | ||
| 1307 | Suite *s = suite_create ("basic_suite"); | ||
| 1308 | TCase *tc = tcase_create ("basic_test"); | ||
| 1309 | |||
| 1310 | tcase_add_test (tc, test_insert_1); | ||
| 1311 | tcase_add_test (tc, test_insert_2); | ||
| 1312 | tcase_add_test (tc, test_insert_3); | ||
| 1313 | tcase_add_test (tc, test_insert_4); | ||
| 1314 | tcase_add_test (tc, test_insert_5); | ||
| 1315 | tcase_add_test (tc, test_insert_6); | ||
| 1316 | tcase_add_test (tc, test_insert_7); | ||
| 1317 | tcase_add_test (tc, test_insert_8); | ||
| 1318 | tcase_add_test (tc, test_insert_9); | ||
| 1319 | tcase_add_test (tc, test_insert_10); | ||
| 1320 | tcase_add_test (tc, test_insert_11); | ||
| 1321 | tcase_add_test (tc, test_insert_12); | ||
| 1322 | tcase_add_test (tc, test_insert_13); | ||
| 1323 | |||
| 1324 | tcase_add_test (tc, test_remove_1); | ||
| 1325 | tcase_add_test (tc, test_remove_2); | ||
| 1326 | tcase_add_test (tc, test_remove_3); | ||
| 1327 | tcase_add_test (tc, test_remove_4); | ||
| 1328 | tcase_add_test (tc, test_remove_5); | ||
| 1329 | tcase_add_test (tc, test_remove_6); | ||
| 1330 | tcase_add_test (tc, test_remove_7); | ||
| 1331 | tcase_add_test (tc, test_remove_8); | ||
| 1332 | tcase_add_test (tc, test_remove_9); | ||
| 1333 | tcase_add_test (tc, test_remove_10); | ||
| 1334 | |||
| 1335 | tcase_add_test (tc, test_generator_1); | ||
| 1336 | tcase_add_test (tc, test_generator_2); | ||
| 1337 | tcase_add_test (tc, test_generator_3); | ||
| 1338 | tcase_add_test (tc, test_generator_5); | ||
| 1339 | tcase_add_test (tc, test_generator_6); | ||
| 1340 | tcase_add_test (tc, test_generator_7); | ||
| 1341 | tcase_add_test (tc, test_generator_8); | ||
| 1342 | tcase_add_test (tc, test_generator_9); | ||
| 1343 | |||
| 1344 | tcase_add_test (tc, test_gap_insert_1); | ||
| 1345 | tcase_add_test (tc, test_gap_insert_2); | ||
| 1346 | tcase_add_test (tc, test_gap_insert_3); | ||
| 1347 | tcase_add_test (tc, test_gap_insert_4); | ||
| 1348 | tcase_add_test (tc, test_gap_insert_5); | ||
| 1349 | tcase_add_test (tc, test_gap_insert_6); | ||
| 1350 | tcase_add_test (tc, test_gap_insert_7); | ||
| 1351 | tcase_add_test (tc, test_gap_insert_8); | ||
| 1352 | tcase_add_test (tc, test_gap_insert_9); | ||
| 1353 | tcase_add_test (tc, test_gap_insert_10); | ||
| 1354 | tcase_add_test (tc, test_gap_insert_11); | ||
| 1355 | |||
| 1356 | tcase_add_test (tc, test_gap_delete_1); | ||
| 1357 | tcase_add_test (tc, test_gap_delete_2); | ||
| 1358 | tcase_add_test (tc, test_gap_delete_3); | ||
| 1359 | tcase_add_test (tc, test_gap_delete_4); | ||
| 1360 | tcase_add_test (tc, test_gap_delete_5); | ||
| 1361 | tcase_add_test (tc, test_gap_delete_6); | ||
| 1362 | tcase_add_test (tc, test_gap_delete_7); | ||
| 1363 | tcase_add_test (tc, test_gap_delete_8); | ||
| 1364 | |||
| 1365 | /* tcase_set_timeout (tc, 120); */ | ||
| 1366 | suite_add_tcase (s, tc); | ||
| 1367 | return s; | ||
| 1368 | } | ||
| 1369 | |||
| 1370 | int | ||
| 1371 | main (void) | ||
| 1372 | { | ||
| 1373 | int nfailed; | ||
| 1374 | Suite *s = basic_suite (); | ||
| 1375 | SRunner *sr = srunner_create (s); | ||
| 1376 | |||
| 1377 | srunner_run_all (sr, CK_NORMAL); | ||
| 1378 | nfailed = srunner_ntests_failed (sr); | ||
| 1379 | srunner_free (sr); | ||
| 1380 | return (nfailed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; | ||
| 1381 | } | ||
diff --git a/test/manual/noverlay/many-errors.py b/test/manual/noverlay/many-errors.py new file mode 100644 index 00000000000..fa4ef5f98d1 --- /dev/null +++ b/test/manual/noverlay/many-errors.py | |||
| @@ -0,0 +1,2480 @@ | |||
| 1 | def a(x, y, y): | ||
| 2 | return t; pass | ||
| 3 | def a(x, y, y): | ||
| 4 | return t; pass | ||
| 5 | def a(x, y, y): | ||
| 6 | return t; pass | ||
| 7 | def a(x, y, y): | ||
| 8 | return t; pass | ||
| 9 | def a(x, y, y): | ||
| 10 | return t; pass | ||
| 11 | def a(x, y, y): | ||
| 12 | return t; pass | ||
| 13 | def a(x, y, y): | ||
| 14 | return t; pass | ||
| 15 | def a(x, y, y): | ||
| 16 | return t; pass | ||
| 17 | def a(x, y, y): | ||
| 18 | return t; pass | ||
| 19 | def a(x, y, y): | ||
| 20 | return t; pass | ||
| 21 | def a(x, y, y): | ||
| 22 | return t; pass | ||
| 23 | def a(x, y, y): | ||
| 24 | return t; pass | ||
| 25 | def a(x, y, y): | ||
| 26 | return t; pass | ||
| 27 | def a(x, y, y): | ||
| 28 | return t; pass | ||
| 29 | def a(x, y, y): | ||
| 30 | return t; pass | ||
| 31 | def a(x, y, y): | ||
| 32 | return t; pass | ||
| 33 | def a(x, y, y): | ||
| 34 | return t; pass | ||
| 35 | def a(x, y, y): | ||
| 36 | return t; pass | ||
| 37 | def a(x, y, y): | ||
| 38 | return t; pass | ||
| 39 | def a(x, y, y): | ||
| 40 | return t; pass | ||
| 41 | def a(x, y, y): | ||
| 42 | return t; pass | ||
| 43 | def a(x, y, y): | ||
| 44 | return t; pass | ||
| 45 | def a(x, y, y): | ||
| 46 | return t; pass | ||
| 47 | def a(x, y, y): | ||
| 48 | return t; pass | ||
| 49 | def a(x, y, y): | ||
| 50 | return t; pass | ||
| 51 | def a(x, y, y): | ||
| 52 | return t; pass | ||
| 53 | def a(x, y, y): | ||
| 54 | return t; pass | ||
| 55 | def a(x, y, y): | ||
| 56 | return t; pass | ||
| 57 | def a(x, y, y): | ||
| 58 | return t; pass | ||
| 59 | def a(x, y, y): | ||
| 60 | return t; pass | ||
| 61 | def a(x, y, y): | ||
| 62 | return t; pass | ||
| 63 | def a(x, y, y): | ||
| 64 | return t; pass | ||
| 65 | def a(x, y, y): | ||
| 66 | return t; pass | ||
| 67 | def a(x, y, y): | ||
| 68 | return t; pass | ||
| 69 | def a(x, y, y): | ||
| 70 | return t; pass | ||
| 71 | def a(x, y, y): | ||
| 72 | return t; pass | ||
| 73 | def a(x, y, y): | ||
| 74 | return t; pass | ||
| 75 | def a(x, y, y): | ||
| 76 | return t; pass | ||
| 77 | def a(x, y, y): | ||
| 78 | return t; pass | ||
| 79 | def a(x, y, y): | ||
| 80 | return t; pass | ||
| 81 | def a(x, y, y): | ||
| 82 | return t; pass | ||
| 83 | def a(x, y, y): | ||
| 84 | return t; pass | ||
| 85 | def a(x, y, y): | ||
| 86 | return t; pass | ||
| 87 | def a(x, y, y): | ||
| 88 | return t; pass | ||
| 89 | def a(x, y, y): | ||
| 90 | return t; pass | ||
| 91 | def a(x, y, y): | ||
| 92 | return t; pass | ||
| 93 | def a(x, y, y): | ||
| 94 | return t; pass | ||
| 95 | def a(x, y, y): | ||
| 96 | return t; pass | ||
| 97 | def a(x, y, y): | ||
| 98 | return t; pass | ||
| 99 | def a(x, y, y): | ||
| 100 | return t; pass | ||
| 101 | def a(x, y, y): | ||
| 102 | return t; pass | ||
| 103 | def a(x, y, y): | ||
| 104 | return t; pass | ||
| 105 | def a(x, y, y): | ||
| 106 | return t; pass | ||
| 107 | def a(x, y, y): | ||
| 108 | return t; pass | ||
| 109 | def a(x, y, y): | ||
| 110 | return t; pass | ||
| 111 | def a(x, y, y): | ||
| 112 | return t; pass | ||
| 113 | def a(x, y, y): | ||
| 114 | return t; pass | ||
| 115 | def a(x, y, y): | ||
| 116 | return t; pass | ||
| 117 | def a(x, y, y): | ||
| 118 | return t; pass | ||
| 119 | def a(x, y, y): | ||
| 120 | return t; pass | ||
| 121 | def a(x, y, y): | ||
| 122 | return t; pass | ||
| 123 | def a(x, y, y): | ||
| 124 | return t; pass | ||
| 125 | def a(x, y, y): | ||
| 126 | return t; pass | ||
| 127 | def a(x, y, y): | ||
| 128 | return t; pass | ||
| 129 | def a(x, y, y): | ||
| 130 | return t; pass | ||
| 131 | def a(x, y, y): | ||
| 132 | return t; pass | ||
| 133 | def a(x, y, y): | ||
| 134 | return t; pass | ||
| 135 | def a(x, y, y): | ||
| 136 | return t; pass | ||
| 137 | def a(x, y, y): | ||
| 138 | return t; pass | ||
| 139 | def a(x, y, y): | ||
| 140 | return t; pass | ||
| 141 | def a(x, y, y): | ||
| 142 | return t; pass | ||
| 143 | def a(x, y, y): | ||
| 144 | return t; pass | ||
| 145 | def a(x, y, y): | ||
| 146 | return t; pass | ||
| 147 | def a(x, y, y): | ||
| 148 | return t; pass | ||
| 149 | def a(x, y, y): | ||
| 150 | return t; pass | ||
| 151 | def a(x, y, y): | ||
| 152 | return t; pass | ||
| 153 | def a(x, y, y): | ||
| 154 | return t; pass | ||
| 155 | def a(x, y, y): | ||
| 156 | return t; pass | ||
| 157 | def a(x, y, y): | ||
| 158 | return t; pass | ||
| 159 | def a(x, y, y): | ||
| 160 | return t; pass | ||
| 161 | def a(x, y, y): | ||
| 162 | return t; pass | ||
| 163 | def a(x, y, y): | ||
| 164 | return t; pass | ||
| 165 | def a(x, y, y): | ||
| 166 | return t; pass | ||
| 167 | def a(x, y, y): | ||
| 168 | return t; pass | ||
| 169 | def a(x, y, y): | ||
| 170 | return t; pass | ||
| 171 | def a(x, y, y): | ||
| 172 | return t; pass | ||
| 173 | def a(x, y, y): | ||
| 174 | return t; pass | ||
| 175 | def a(x, y, y): | ||
| 176 | return t; pass | ||
| 177 | def a(x, y, y): | ||
| 178 | return t; pass | ||
| 179 | def a(x, y, y): | ||
| 180 | return t; pass | ||
| 181 | def a(x, y, y): | ||
| 182 | return t; pass | ||
| 183 | def a(x, y, y): | ||
| 184 | return t; pass | ||
| 185 | def a(x, y, y): | ||
| 186 | return t; pass | ||
| 187 | def a(x, y, y): | ||
| 188 | return t; pass | ||
| 189 | def a(x, y, y): | ||
| 190 | return t; pass | ||
| 191 | def a(x, y, y): | ||
| 192 | return t; pass | ||
| 193 | def a(x, y, y): | ||
| 194 | return t; pass | ||
| 195 | def a(x, y, y): | ||
| 196 | return t; pass | ||
| 197 | def a(x, y, y): | ||
| 198 | return t; pass | ||
| 199 | def a(x, y, y): | ||
| 200 | return t; pass | ||
| 201 | def a(x, y, y): | ||
| 202 | return t; pass | ||
| 203 | def a(x, y, y): | ||
| 204 | return t; pass | ||
| 205 | def a(x, y, y): | ||
| 206 | return t; pass | ||
| 207 | def a(x, y, y): | ||
| 208 | return t; pass | ||
| 209 | def a(x, y, y): | ||
| 210 | return t; pass | ||
| 211 | def a(x, y, y): | ||
| 212 | return t; pass | ||
| 213 | def a(x, y, y): | ||
| 214 | return t; pass | ||
| 215 | def a(x, y, y): | ||
| 216 | return t; pass | ||
| 217 | def a(x, y, y): | ||
| 218 | return t; pass | ||
| 219 | def a(x, y, y): | ||
| 220 | return t; pass | ||
| 221 | def a(x, y, y): | ||
| 222 | return t; pass | ||
| 223 | def a(x, y, y): | ||
| 224 | return t; pass | ||
| 225 | def a(x, y, y): | ||
| 226 | return t; pass | ||
| 227 | def a(x, y, y): | ||
| 228 | return t; pass | ||
| 229 | def a(x, y, y): | ||
| 230 | return t; pass | ||
| 231 | def a(x, y, y): | ||
| 232 | return t; pass | ||
| 233 | def a(x, y, y): | ||
| 234 | return t; pass | ||
| 235 | def a(x, y, y): | ||
| 236 | return t; pass | ||
| 237 | def a(x, y, y): | ||
| 238 | return t; pass | ||
| 239 | def a(x, y, y): | ||
| 240 | return t; pass | ||
| 241 | def a(x, y, y): | ||
| 242 | return t; pass | ||
| 243 | def a(x, y, y): | ||
| 244 | return t; pass | ||
| 245 | def a(x, y, y): | ||
| 246 | return t; pass | ||
| 247 | def a(x, y, y): | ||
| 248 | return t; pass | ||
| 249 | def a(x, y, y): | ||
| 250 | return t; pass | ||
| 251 | def a(x, y, y): | ||
| 252 | return t; pass | ||
| 253 | def a(x, y, y): | ||
| 254 | return t; pass | ||
| 255 | def a(x, y, y): | ||
| 256 | return t; pass | ||
| 257 | def a(x, y, y): | ||
| 258 | return t; pass | ||
| 259 | def a(x, y, y): | ||
| 260 | return t; pass | ||
| 261 | def a(x, y, y): | ||
| 262 | return t; pass | ||
| 263 | def a(x, y, y): | ||
| 264 | return t; pass | ||
| 265 | def a(x, y, y): | ||
| 266 | return t; pass | ||
| 267 | def a(x, y, y): | ||
| 268 | return t; pass | ||
| 269 | def a(x, y, y): | ||
| 270 | return t; pass | ||
| 271 | def a(x, y, y): | ||
| 272 | return t; pass | ||
| 273 | def a(x, y, y): | ||
| 274 | return t; pass | ||
| 275 | def a(x, y, y): | ||
| 276 | return t; pass | ||
| 277 | def a(x, y, y): | ||
| 278 | return t; pass | ||
| 279 | def a(x, y, y): | ||
| 280 | return t; pass | ||
| 281 | def a(x, y, y): | ||
| 282 | return t; pass | ||
| 283 | def a(x, y, y): | ||
| 284 | return t; pass | ||
| 285 | def a(x, y, y): | ||
| 286 | return t; pass | ||
| 287 | def a(x, y, y): | ||
| 288 | return t; pass | ||
| 289 | def a(x, y, y): | ||
| 290 | return t; pass | ||
| 291 | def a(x, y, y): | ||
| 292 | return t; pass | ||
| 293 | def a(x, y, y): | ||
| 294 | return t; pass | ||
| 295 | def a(x, y, y): | ||
| 296 | return t; pass | ||
| 297 | def a(x, y, y): | ||
| 298 | return t; pass | ||
| 299 | def a(x, y, y): | ||
| 300 | return t; pass | ||
| 301 | def a(x, y, y): | ||
| 302 | return t; pass | ||
| 303 | def a(x, y, y): | ||
| 304 | return t; pass | ||
| 305 | def a(x, y, y): | ||
| 306 | return t; pass | ||
| 307 | def a(x, y, y): | ||
| 308 | return t; pass | ||
| 309 | def a(x, y, y): | ||
| 310 | return t; pass | ||
| 311 | def a(x, y, y): | ||
| 312 | return t; pass | ||
| 313 | def a(x, y, y): | ||
| 314 | return t; pass | ||
| 315 | def a(x, y, y): | ||
| 316 | return t; pass | ||
| 317 | def a(x, y, y): | ||
| 318 | return t; pass | ||
| 319 | def a(x, y, y): | ||
| 320 | return t; pass | ||
| 321 | def a(x, y, y): | ||
| 322 | return t; pass | ||
| 323 | def a(x, y, y): | ||
| 324 | return t; pass | ||
| 325 | def a(x, y, y): | ||
| 326 | return t; pass | ||
| 327 | def a(x, y, y): | ||
| 328 | return t; pass | ||
| 329 | def a(x, y, y): | ||
| 330 | return t; pass | ||
| 331 | def a(x, y, y): | ||
| 332 | return t; pass | ||
| 333 | def a(x, y, y): | ||
| 334 | return t; pass | ||
| 335 | def a(x, y, y): | ||
| 336 | return t; pass | ||
| 337 | def a(x, y, y): | ||
| 338 | return t; pass | ||
| 339 | def a(x, y, y): | ||
| 340 | return t; pass | ||
| 341 | def a(x, y, y): | ||
| 342 | return t; pass | ||
| 343 | def a(x, y, y): | ||
| 344 | return t; pass | ||
| 345 | def a(x, y, y): | ||
| 346 | return t; pass | ||
| 347 | def a(x, y, y): | ||
| 348 | return t; pass | ||
| 349 | def a(x, y, y): | ||
| 350 | return t; pass | ||
| 351 | def a(x, y, y): | ||
| 352 | return t; pass | ||
| 353 | def a(x, y, y): | ||
| 354 | return t; pass | ||
| 355 | def a(x, y, y): | ||
| 356 | return t; pass | ||
| 357 | def a(x, y, y): | ||
| 358 | return t; pass | ||
| 359 | def a(x, y, y): | ||
| 360 | return t; pass | ||
| 361 | def a(x, y, y): | ||
| 362 | return t; pass | ||
| 363 | def a(x, y, y): | ||
| 364 | return t; pass | ||
| 365 | def a(x, y, y): | ||
| 366 | return t; pass | ||
| 367 | def a(x, y, y): | ||
| 368 | return t; pass | ||
| 369 | def a(x, y, y): | ||
| 370 | return t; pass | ||
| 371 | def a(x, y, y): | ||
| 372 | return t; pass | ||
| 373 | def a(x, y, y): | ||
| 374 | return t; pass | ||
| 375 | def a(x, y, y): | ||
| 376 | return t; pass | ||
| 377 | def a(x, y, y): | ||
| 378 | return t; pass | ||
| 379 | def a(x, y, y): | ||
| 380 | return t; pass | ||
| 381 | def a(x, y, y): | ||
| 382 | return t; pass | ||
| 383 | def a(x, y, y): | ||
| 384 | return t; pass | ||
| 385 | def a(x, y, y): | ||
| 386 | return t; pass | ||
| 387 | def a(x, y, y): | ||
| 388 | return t; pass | ||
| 389 | def a(x, y, y): | ||
| 390 | return t; pass | ||
| 391 | def a(x, y, y): | ||
| 392 | return t; pass | ||
| 393 | def a(x, y, y): | ||
| 394 | return t; pass | ||
| 395 | def a(x, y, y): | ||
| 396 | return t; pass | ||
| 397 | def a(x, y, y): | ||
| 398 | return t; pass | ||
| 399 | def a(x, y, y): | ||
| 400 | return t; pass | ||
| 401 | def a(x, y, y): | ||
| 402 | return t; pass | ||
| 403 | def a(x, y, y): | ||
| 404 | return t; pass | ||
| 405 | def a(x, y, y): | ||
| 406 | return t; pass | ||
| 407 | def a(x, y, y): | ||
| 408 | return t; pass | ||
| 409 | def a(x, y, y): | ||
| 410 | return t; pass | ||
| 411 | def a(x, y, y): | ||
| 412 | return t; pass | ||
| 413 | def a(x, y, y): | ||
| 414 | return t; pass | ||
| 415 | def a(x, y, y): | ||
| 416 | return t; pass | ||
| 417 | def a(x, y, y): | ||
| 418 | return t; pass | ||
| 419 | def a(x, y, y): | ||
| 420 | return t; pass | ||
| 421 | def a(x, y, y): | ||
| 422 | return t; pass | ||
| 423 | def a(x, y, y): | ||
| 424 | return t; pass | ||
| 425 | def a(x, y, y): | ||
| 426 | return t; pass | ||
| 427 | def a(x, y, y): | ||
| 428 | return t; pass | ||
| 429 | def a(x, y, y): | ||
| 430 | return t; pass | ||
| 431 | def a(x, y, y): | ||
| 432 | return t; pass | ||
| 433 | def a(x, y, y): | ||
| 434 | return t; pass | ||
| 435 | def a(x, y, y): | ||
| 436 | return t; pass | ||
| 437 | def a(x, y, y): | ||
| 438 | return t; pass | ||
| 439 | def a(x, y, y): | ||
| 440 | return t; pass | ||
| 441 | def a(x, y, y): | ||
| 442 | return t; pass | ||
| 443 | def a(x, y, y): | ||
| 444 | return t; pass | ||
| 445 | def a(x, y, y): | ||
| 446 | return t; pass | ||
| 447 | def a(x, y, y): | ||
| 448 | return t; pass | ||
| 449 | def a(x, y, y): | ||
| 450 | return t; pass | ||
| 451 | def a(x, y, y): | ||
| 452 | return t; pass | ||
| 453 | def a(x, y, y): | ||
| 454 | return t; pass | ||
| 455 | def a(x, y, y): | ||
| 456 | return t; pass | ||
| 457 | def a(x, y, y): | ||
| 458 | return t; pass | ||
| 459 | def a(x, y, y): | ||
| 460 | return t; pass | ||
| 461 | def a(x, y, y): | ||
| 462 | return t; pass | ||
| 463 | def a(x, y, y): | ||
| 464 | return t; pass | ||
| 465 | def a(x, y, y): | ||
| 466 | return t; pass | ||
| 467 | def a(x, y, y): | ||
| 468 | return t; pass | ||
| 469 | def a(x, y, y): | ||
| 470 | return t; pass | ||
| 471 | def a(x, y, y): | ||
| 472 | return t; pass | ||
| 473 | def a(x, y, y): | ||
| 474 | return t; pass | ||
| 475 | def a(x, y, y): | ||
| 476 | return t; pass | ||
| 477 | def a(x, y, y): | ||
| 478 | return t; pass | ||
| 479 | def a(x, y, y): | ||
| 480 | return t; pass | ||
| 481 | def a(x, y, y): | ||
| 482 | return t; pass | ||
| 483 | def a(x, y, y): | ||
| 484 | return t; pass | ||
| 485 | def a(x, y, y): | ||
| 486 | return t; pass | ||
| 487 | def a(x, y, y): | ||
| 488 | return t; pass | ||
| 489 | def a(x, y, y): | ||
| 490 | return t; pass | ||
| 491 | def a(x, y, y): | ||
| 492 | return t; pass | ||
| 493 | def a(x, y, y): | ||
| 494 | return t; pass | ||
| 495 | def a(x, y, y): | ||
| 496 | return t; pass | ||
| 497 | def a(x, y, y): | ||
| 498 | return t; pass | ||
| 499 | def a(x, y, y): | ||
| 500 | return t; pass | ||
| 501 | def a(x, y, y): | ||
| 502 | return t; pass | ||
| 503 | def a(x, y, y): | ||
| 504 | return t; pass | ||
| 505 | def a(x, y, y): | ||
| 506 | return t; pass | ||
| 507 | def a(x, y, y): | ||
| 508 | return t; pass | ||
| 509 | def a(x, y, y): | ||
| 510 | return t; pass | ||
| 511 | def a(x, y, y): | ||
| 512 | return t; pass | ||
| 513 | def a(x, y, y): | ||
| 514 | return t; pass | ||
| 515 | def a(x, y, y): | ||
| 516 | return t; pass | ||
| 517 | def a(x, y, y): | ||
| 518 | return t; pass | ||
| 519 | def a(x, y, y): | ||
| 520 | return t; pass | ||
| 521 | def a(x, y, y): | ||
| 522 | return t; pass | ||
| 523 | def a(x, y, y): | ||
| 524 | return t; pass | ||
| 525 | def a(x, y, y): | ||
| 526 | return t; pass | ||
| 527 | def a(x, y, y): | ||
| 528 | return t; pass | ||
| 529 | def a(x, y, y): | ||
| 530 | return t; pass | ||
| 531 | def a(x, y, y): | ||
| 532 | return t; pass | ||
| 533 | def a(x, y, y): | ||
| 534 | return t; pass | ||
| 535 | def a(x, y, y): | ||
| 536 | return t; pass | ||
| 537 | def a(x, y, y): | ||
| 538 | return t; pass | ||
| 539 | def a(x, y, y): | ||
| 540 | return t; pass | ||
| 541 | def a(x, y, y): | ||
| 542 | return t; pass | ||
| 543 | def a(x, y, y): | ||
| 544 | return t; pass | ||
| 545 | def a(x, y, y): | ||
| 546 | return t; pass | ||
| 547 | def a(x, y, y): | ||
| 548 | return t; pass | ||
| 549 | def a(x, y, y): | ||
| 550 | return t; pass | ||
| 551 | def a(x, y, y): | ||
| 552 | return t; pass | ||
| 553 | def a(x, y, y): | ||
| 554 | return t; pass | ||
| 555 | def a(x, y, y): | ||
| 556 | return t; pass | ||
| 557 | def a(x, y, y): | ||
| 558 | return t; pass | ||
| 559 | def a(x, y, y): | ||
| 560 | return t; pass | ||
| 561 | def a(x, y, y): | ||
| 562 | return t; pass | ||
| 563 | def a(x, y, y): | ||
| 564 | return t; pass | ||
| 565 | def a(x, y, y): | ||
| 566 | return t; pass | ||
| 567 | def a(x, y, y): | ||
| 568 | return t; pass | ||
| 569 | def a(x, y, y): | ||
| 570 | return t; pass | ||
| 571 | def a(x, y, y): | ||
| 572 | return t; pass | ||
| 573 | def a(x, y, y): | ||
| 574 | return t; pass | ||
| 575 | def a(x, y, y): | ||
| 576 | return t; pass | ||
| 577 | def a(x, y, y): | ||
| 578 | return t; pass | ||
| 579 | def a(x, y, y): | ||
| 580 | return t; pass | ||
| 581 | def a(x, y, y): | ||
| 582 | return t; pass | ||
| 583 | def a(x, y, y): | ||
| 584 | return t; pass | ||
| 585 | def a(x, y, y): | ||
| 586 | return t; pass | ||
| 587 | def a(x, y, y): | ||
| 588 | return t; pass | ||
| 589 | def a(x, y, y): | ||
| 590 | return t; pass | ||
| 591 | def a(x, y, y): | ||
| 592 | return t; pass | ||
| 593 | def a(x, y, y): | ||
| 594 | return t; pass | ||
| 595 | def a(x, y, y): | ||
| 596 | return t; pass | ||
| 597 | def a(x, y, y): | ||
| 598 | return t; pass | ||
| 599 | def a(x, y, y): | ||
| 600 | return t; pass | ||
| 601 | def a(x, y, y): | ||
| 602 | return t; pass | ||
| 603 | def a(x, y, y): | ||
| 604 | return t; pass | ||
| 605 | def a(x, y, y): | ||
| 606 | return t; pass | ||
| 607 | def a(x, y, y): | ||
| 608 | return t; pass | ||
| 609 | def a(x, y, y): | ||
| 610 | return t; pass | ||
| 611 | def a(x, y, y): | ||
| 612 | return t; pass | ||
| 613 | def a(x, y, y): | ||
| 614 | return t; pass | ||
| 615 | def a(x, y, y): | ||
| 616 | return t; pass | ||
| 617 | def a(x, y, y): | ||
| 618 | return t; pass | ||
| 619 | def a(x, y, y): | ||
| 620 | return t; pass | ||
| 621 | def a(x, y, y): | ||
| 622 | return t; pass | ||
| 623 | def a(x, y, y): | ||
| 624 | return t; pass | ||
| 625 | def a(x, y, y): | ||
| 626 | return t; pass | ||
| 627 | def a(x, y, y): | ||
| 628 | return t; pass | ||
| 629 | def a(x, y, y): | ||
| 630 | return t; pass | ||
| 631 | def a(x, y, y): | ||
| 632 | return t; pass | ||
| 633 | def a(x, y, y): | ||
| 634 | return t; pass | ||
| 635 | def a(x, y, y): | ||
| 636 | return t; pass | ||
| 637 | def a(x, y, y): | ||
| 638 | return t; pass | ||
| 639 | def a(x, y, y): | ||
| 640 | return t; pass | ||
| 641 | def a(x, y, y): | ||
| 642 | return t; pass | ||
| 643 | def a(x, y, y): | ||
| 644 | return t; pass | ||
| 645 | def a(x, y, y): | ||
| 646 | return t; pass | ||
| 647 | def a(x, y, y): | ||
| 648 | return t; pass | ||
| 649 | def a(x, y, y): | ||
| 650 | return t; pass | ||
| 651 | def a(x, y, y): | ||
| 652 | return t; pass | ||
| 653 | def a(x, y, y): | ||
| 654 | return t; pass | ||
| 655 | def a(x, y, y): | ||
| 656 | return t; pass | ||
| 657 | def a(x, y, y): | ||
| 658 | return t; pass | ||
| 659 | def a(x, y, y): | ||
| 660 | return t; pass | ||
| 661 | def a(x, y, y): | ||
| 662 | return t; pass | ||
| 663 | def a(x, y, y): | ||
| 664 | return t; pass | ||
| 665 | def a(x, y, y): | ||
| 666 | return t; pass | ||
| 667 | def a(x, y, y): | ||
| 668 | return t; pass | ||
| 669 | def a(x, y, y): | ||
| 670 | return t; pass | ||
| 671 | def a(x, y, y): | ||
| 672 | return t; pass | ||
| 673 | def a(x, y, y): | ||
| 674 | return t; pass | ||
| 675 | def a(x, y, y): | ||
| 676 | return t; pass | ||
| 677 | def a(x, y, y): | ||
| 678 | return t; pass | ||
| 679 | def a(x, y, y): | ||
| 680 | return t; pass | ||
| 681 | def a(x, y, y): | ||
| 682 | return t; pass | ||
| 683 | def a(x, y, y): | ||
| 684 | return t; pass | ||
| 685 | def a(x, y, y): | ||
| 686 | return t; pass | ||
| 687 | def a(x, y, y): | ||
| 688 | return t; pass | ||
| 689 | def a(x, y, y): | ||
| 690 | return t; pass | ||
| 691 | def a(x, y, y): | ||
| 692 | return t; pass | ||
| 693 | def a(x, y, y): | ||
| 694 | return t; pass | ||
| 695 | def a(x, y, y): | ||
| 696 | return t; pass | ||
| 697 | def a(x, y, y): | ||
| 698 | return t; pass | ||
| 699 | def a(x, y, y): | ||
| 700 | return t; pass | ||
| 701 | def a(x, y, y): | ||
| 702 | return t; pass | ||
| 703 | def a(x, y, y): | ||
| 704 | return t; pass | ||
| 705 | def a(x, y, y): | ||
| 706 | return t; pass | ||
| 707 | def a(x, y, y): | ||
| 708 | return t; pass | ||
| 709 | def a(x, y, y): | ||
| 710 | return t; pass | ||
| 711 | def a(x, y, y): | ||
| 712 | return t; pass | ||
| 713 | def a(x, y, y): | ||
| 714 | return t; pass | ||
| 715 | def a(x, y, y): | ||
| 716 | return t; pass | ||
| 717 | def a(x, y, y): | ||
| 718 | return t; pass | ||
| 719 | def a(x, y, y): | ||
| 720 | return t; pass | ||
| 721 | def a(x, y, y): | ||
| 722 | return t; pass | ||
| 723 | def a(x, y, y): | ||
| 724 | return t; pass | ||
| 725 | def a(x, y, y): | ||
| 726 | return t; pass | ||
| 727 | def a(x, y, y): | ||
| 728 | return t; pass | ||
| 729 | def a(x, y, y): | ||
| 730 | return t; pass | ||
| 731 | def a(x, y, y): | ||
| 732 | return t; pass | ||
| 733 | def a(x, y, y): | ||
| 734 | return t; pass | ||
| 735 | def a(x, y, y): | ||
| 736 | return t; pass | ||
| 737 | def a(x, y, y): | ||
| 738 | return t; pass | ||
| 739 | def a(x, y, y): | ||
| 740 | return t; pass | ||
| 741 | def a(x, y, y): | ||
| 742 | return t; pass | ||
| 743 | def a(x, y, y): | ||
| 744 | return t; pass | ||
| 745 | def a(x, y, y): | ||
| 746 | return t; pass | ||
| 747 | def a(x, y, y): | ||
| 748 | return t; pass | ||
| 749 | def a(x, y, y): | ||
| 750 | return t; pass | ||
| 751 | def a(x, y, y): | ||
| 752 | return t; pass | ||
| 753 | def a(x, y, y): | ||
| 754 | return t; pass | ||
| 755 | def a(x, y, y): | ||
| 756 | return t; pass | ||
| 757 | def a(x, y, y): | ||
| 758 | return t; pass | ||
| 759 | def a(x, y, y): | ||
| 760 | return t; pass | ||
| 761 | def a(x, y, y): | ||
| 762 | return t; pass | ||
| 763 | def a(x, y, y): | ||
| 764 | return t; pass | ||
| 765 | def a(x, y, y): | ||
| 766 | return t; pass | ||
| 767 | def a(x, y, y): | ||
| 768 | return t; pass | ||
| 769 | def a(x, y, y): | ||
| 770 | return t; pass | ||
| 771 | def a(x, y, y): | ||
| 772 | return t; pass | ||
| 773 | def a(x, y, y): | ||
| 774 | return t; pass | ||
| 775 | def a(x, y, y): | ||
| 776 | return t; pass | ||
| 777 | def a(x, y, y): | ||
| 778 | return t; pass | ||
| 779 | def a(x, y, y): | ||
| 780 | return t; pass | ||
| 781 | def a(x, y, y): | ||
| 782 | return t; pass | ||
| 783 | def a(x, y, y): | ||
| 784 | return t; pass | ||
| 785 | def a(x, y, y): | ||
| 786 | return t; pass | ||
| 787 | def a(x, y, y): | ||
| 788 | return t; pass | ||
| 789 | def a(x, y, y): | ||
| 790 | return t; pass | ||
| 791 | def a(x, y, y): | ||
| 792 | return t; pass | ||
| 793 | def a(x, y, y): | ||
| 794 | return t; pass | ||
| 795 | def a(x, y, y): | ||
| 796 | return t; pass | ||
| 797 | def a(x, y, y): | ||
| 798 | return t; pass | ||
| 799 | def a(x, y, y): | ||
| 800 | return t; pass | ||
| 801 | def a(x, y, y): | ||
| 802 | return t; pass | ||
| 803 | def a(x, y, y): | ||
| 804 | return t; pass | ||
| 805 | def a(x, y, y): | ||
| 806 | return t; pass | ||
| 807 | def a(x, y, y): | ||
| 808 | return t; pass | ||
| 809 | def a(x, y, y): | ||
| 810 | return t; pass | ||
| 811 | def a(x, y, y): | ||
| 812 | return t; pass | ||
| 813 | def a(x, y, y): | ||
| 814 | return t; pass | ||
| 815 | def a(x, y, y): | ||
| 816 | return t; pass | ||
| 817 | def a(x, y, y): | ||
| 818 | return t; pass | ||
| 819 | def a(x, y, y): | ||
| 820 | return t; pass | ||
| 821 | def a(x, y, y): | ||
| 822 | return t; pass | ||
| 823 | def a(x, y, y): | ||
| 824 | return t; pass | ||
| 825 | def a(x, y, y): | ||
| 826 | return t; pass | ||
| 827 | def a(x, y, y): | ||
| 828 | return t; pass | ||
| 829 | def a(x, y, y): | ||
| 830 | return t; pass | ||
| 831 | def a(x, y, y): | ||
| 832 | return t; pass | ||
| 833 | def a(x, y, y): | ||
| 834 | return t; pass | ||
| 835 | def a(x, y, y): | ||
| 836 | return t; pass | ||
| 837 | def a(x, y, y): | ||
| 838 | return t; pass | ||
| 839 | def a(x, y, y): | ||
| 840 | return t; pass | ||
| 841 | def a(x, y, y): | ||
| 842 | return t; pass | ||
| 843 | def a(x, y, y): | ||
| 844 | return t; pass | ||
| 845 | def a(x, y, y): | ||
| 846 | return t; pass | ||
| 847 | def a(x, y, y): | ||
| 848 | return t; pass | ||
| 849 | def a(x, y, y): | ||
| 850 | return t; pass | ||
| 851 | def a(x, y, y): | ||
| 852 | return t; pass | ||
| 853 | def a(x, y, y): | ||
| 854 | return t; pass | ||
| 855 | def a(x, y, y): | ||
| 856 | return t; pass | ||
| 857 | def a(x, y, y): | ||
| 858 | return t; pass | ||
| 859 | def a(x, y, y): | ||
| 860 | return t; pass | ||
| 861 | def a(x, y, y): | ||
| 862 | return t; pass | ||
| 863 | def a(x, y, y): | ||
| 864 | return t; pass | ||
| 865 | def a(x, y, y): | ||
| 866 | return t; pass | ||
| 867 | def a(x, y, y): | ||
| 868 | return t; pass | ||
| 869 | def a(x, y, y): | ||
| 870 | return t; pass | ||
| 871 | def a(x, y, y): | ||
| 872 | return t; pass | ||
| 873 | def a(x, y, y): | ||
| 874 | return t; pass | ||
| 875 | def a(x, y, y): | ||
| 876 | return t; pass | ||
| 877 | def a(x, y, y): | ||
| 878 | return t; pass | ||
| 879 | def a(x, y, y): | ||
| 880 | return t; pass | ||
| 881 | def a(x, y, y): | ||
| 882 | return t; pass | ||
| 883 | def a(x, y, y): | ||
| 884 | return t; pass | ||
| 885 | def a(x, y, y): | ||
| 886 | return t; pass | ||
| 887 | def a(x, y, y): | ||
| 888 | return t; pass | ||
| 889 | def a(x, y, y): | ||
| 890 | return t; pass | ||
| 891 | def a(x, y, y): | ||
| 892 | return t; pass | ||
| 893 | def a(x, y, y): | ||
| 894 | return t; pass | ||
| 895 | def a(x, y, y): | ||
| 896 | return t; pass | ||
| 897 | def a(x, y, y): | ||
| 898 | return t; pass | ||
| 899 | def a(x, y, y): | ||
| 900 | return t; pass | ||
| 901 | def a(x, y, y): | ||
| 902 | return t; pass | ||
| 903 | def a(x, y, y): | ||
| 904 | return t; pass | ||
| 905 | def a(x, y, y): | ||
| 906 | return t; pass | ||
| 907 | def a(x, y, y): | ||
| 908 | return t; pass | ||
| 909 | def a(x, y, y): | ||
| 910 | return t; pass | ||
| 911 | def a(x, y, y): | ||
| 912 | return t; pass | ||
| 913 | def a(x, y, y): | ||
| 914 | return t; pass | ||
| 915 | def a(x, y, y): | ||
| 916 | return t; pass | ||
| 917 | def a(x, y, y): | ||
| 918 | return t; pass | ||
| 919 | def a(x, y, y): | ||
| 920 | return t; pass | ||
| 921 | def a(x, y, y): | ||
| 922 | return t; pass | ||
| 923 | def a(x, y, y): | ||
| 924 | return t; pass | ||
| 925 | def a(x, y, y): | ||
| 926 | return t; pass | ||
| 927 | def a(x, y, y): | ||
| 928 | return t; pass | ||
| 929 | def a(x, y, y): | ||
| 930 | return t; pass | ||
| 931 | def a(x, y, y): | ||
| 932 | return t; pass | ||
| 933 | def a(x, y, y): | ||
| 934 | return t; pass | ||
| 935 | def a(x, y, y): | ||
| 936 | return t; pass | ||
| 937 | def a(x, y, y): | ||
| 938 | return t; pass | ||
| 939 | def a(x, y, y): | ||
| 940 | return t; pass | ||
| 941 | def a(x, y, y): | ||
| 942 | return t; pass | ||
| 943 | def a(x, y, y): | ||
| 944 | return t; pass | ||
| 945 | def a(x, y, y): | ||
| 946 | return t; pass | ||
| 947 | def a(x, y, y): | ||
| 948 | return t; pass | ||
| 949 | def a(x, y, y): | ||
| 950 | return t; pass | ||
| 951 | def a(x, y, y): | ||
| 952 | return t; pass | ||
| 953 | def a(x, y, y): | ||
| 954 | return t; pass | ||
| 955 | def a(x, y, y): | ||
| 956 | return t; pass | ||
| 957 | def a(x, y, y): | ||
| 958 | return t; pass | ||
| 959 | def a(x, y, y): | ||
| 960 | return t; pass | ||
| 961 | def a(x, y, y): | ||
| 962 | return t; pass | ||
| 963 | def a(x, y, y): | ||
| 964 | return t; pass | ||
| 965 | def a(x, y, y): | ||
| 966 | return t; pass | ||
| 967 | def a(x, y, y): | ||
| 968 | return t; pass | ||
| 969 | def a(x, y, y): | ||
| 970 | return t; pass | ||
| 971 | def a(x, y, y): | ||
| 972 | return t; pass | ||
| 973 | def a(x, y, y): | ||
| 974 | return t; pass | ||
| 975 | def a(x, y, y): | ||
| 976 | return t; pass | ||
| 977 | def a(x, y, y): | ||
| 978 | return t; pass | ||
| 979 | def a(x, y, y): | ||
| 980 | return t; pass | ||
| 981 | def a(x, y, y): | ||
| 982 | return t; pass | ||
| 983 | def a(x, y, y): | ||
| 984 | return t; pass | ||
| 985 | def a(x, y, y): | ||
| 986 | return t; pass | ||
| 987 | def a(x, y, y): | ||
| 988 | return t; pass | ||
| 989 | def a(x, y, y): | ||
| 990 | return t; pass | ||
| 991 | def a(x, y, y): | ||
| 992 | return t; pass | ||
| 993 | def a(x, y, y): | ||
| 994 | return t; pass | ||
| 995 | def a(x, y, y): | ||
| 996 | return t; pass | ||
| 997 | def a(x, y, y): | ||
| 998 | return t; pass | ||
| 999 | def a(x, y, y): | ||
| 1000 | return t; pass | ||
| 1001 | def a(x, y, y): | ||
| 1002 | return t; pass | ||
| 1003 | def a(x, y, y): | ||
| 1004 | return t; pass | ||
| 1005 | def a(x, y, y): | ||
| 1006 | return t; pass | ||
| 1007 | def a(x, y, y): | ||
| 1008 | return t; pass | ||
| 1009 | def a(x, y, y): | ||
| 1010 | return t; pass | ||
| 1011 | def a(x, y, y): | ||
| 1012 | return t; pass | ||
| 1013 | def a(x, y, y): | ||
| 1014 | return t; pass | ||
| 1015 | def a(x, y, y): | ||
| 1016 | return t; pass | ||
| 1017 | def a(x, y, y): | ||
| 1018 | return t; pass | ||
| 1019 | def a(x, y, y): | ||
| 1020 | return t; pass | ||
| 1021 | def a(x, y, y): | ||
| 1022 | return t; pass | ||
| 1023 | def a(x, y, y): | ||
| 1024 | return t; pass | ||
| 1025 | def a(x, y, y): | ||
| 1026 | return t; pass | ||
| 1027 | def a(x, y, y): | ||
| 1028 | return t; pass | ||
| 1029 | def a(x, y, y): | ||
| 1030 | return t; pass | ||
| 1031 | def a(x, y, y): | ||
| 1032 | return t; pass | ||
| 1033 | def a(x, y, y): | ||
| 1034 | return t; pass | ||
| 1035 | def a(x, y, y): | ||
| 1036 | return t; pass | ||
| 1037 | def a(x, y, y): | ||
| 1038 | return t; pass | ||
| 1039 | def a(x, y, y): | ||
| 1040 | return t; pass | ||
| 1041 | def a(x, y, y): | ||
| 1042 | return t; pass | ||
| 1043 | def a(x, y, y): | ||
| 1044 | return t; pass | ||
| 1045 | def a(x, y, y): | ||
| 1046 | return t; pass | ||
| 1047 | def a(x, y, y): | ||
| 1048 | return t; pass | ||
| 1049 | def a(x, y, y): | ||
| 1050 | return t; pass | ||
| 1051 | def a(x, y, y): | ||
| 1052 | return t; pass | ||
| 1053 | def a(x, y, y): | ||
| 1054 | return t; pass | ||
| 1055 | def a(x, y, y): | ||
| 1056 | return t; pass | ||
| 1057 | def a(x, y, y): | ||
| 1058 | return t; pass | ||
| 1059 | def a(x, y, y): | ||
| 1060 | return t; pass | ||
| 1061 | def a(x, y, y): | ||
| 1062 | return t; pass | ||
| 1063 | def a(x, y, y): | ||
| 1064 | return t; pass | ||
| 1065 | def a(x, y, y): | ||
| 1066 | return t; pass | ||
| 1067 | def a(x, y, y): | ||
| 1068 | return t; pass | ||
| 1069 | def a(x, y, y): | ||
| 1070 | return t; pass | ||
| 1071 | def a(x, y, y): | ||
| 1072 | return t; pass | ||
| 1073 | def a(x, y, y): | ||
| 1074 | return t; pass | ||
| 1075 | def a(x, y, y): | ||
| 1076 | return t; pass | ||
| 1077 | def a(x, y, y): | ||
| 1078 | return t; pass | ||
| 1079 | def a(x, y, y): | ||
| 1080 | return t; pass | ||
| 1081 | def a(x, y, y): | ||
| 1082 | return t; pass | ||
| 1083 | def a(x, y, y): | ||
| 1084 | return t; pass | ||
| 1085 | def a(x, y, y): | ||
| 1086 | return t; pass | ||
| 1087 | def a(x, y, y): | ||
| 1088 | return t; pass | ||
| 1089 | def a(x, y, y): | ||
| 1090 | return t; pass | ||
| 1091 | def a(x, y, y): | ||
| 1092 | return t; pass | ||
| 1093 | def a(x, y, y): | ||
| 1094 | return t; pass | ||
| 1095 | def a(x, y, y): | ||
| 1096 | return t; pass | ||
| 1097 | def a(x, y, y): | ||
| 1098 | return t; pass | ||
| 1099 | def a(x, y, y): | ||
| 1100 | return t; pass | ||
| 1101 | def a(x, y, y): | ||
| 1102 | return t; pass | ||
| 1103 | def a(x, y, y): | ||
| 1104 | return t; pass | ||
| 1105 | def a(x, y, y): | ||
| 1106 | return t; pass | ||
| 1107 | def a(x, y, y): | ||
| 1108 | return t; pass | ||
| 1109 | def a(x, y, y): | ||
| 1110 | return t; pass | ||
| 1111 | def a(x, y, y): | ||
| 1112 | return t; pass | ||
| 1113 | def a(x, y, y): | ||
| 1114 | return t; pass | ||
| 1115 | def a(x, y, y): | ||
| 1116 | return t; pass | ||
| 1117 | def a(x, y, y): | ||
| 1118 | return t; pass | ||
| 1119 | def a(x, y, y): | ||
| 1120 | return t; pass | ||
| 1121 | def a(x, y, y): | ||
| 1122 | return t; pass | ||
| 1123 | def a(x, y, y): | ||
| 1124 | return t; pass | ||
| 1125 | def a(x, y, y): | ||
| 1126 | return t; pass | ||
| 1127 | def a(x, y, y): | ||
| 1128 | return t; pass | ||
| 1129 | def a(x, y, y): | ||
| 1130 | return t; pass | ||
| 1131 | def a(x, y, y): | ||
| 1132 | return t; pass | ||
| 1133 | def a(x, y, y): | ||
| 1134 | return t; pass | ||
| 1135 | def a(x, y, y): | ||
| 1136 | return t; pass | ||
| 1137 | def a(x, y, y): | ||
| 1138 | return t; pass | ||
| 1139 | def a(x, y, y): | ||
| 1140 | return t; pass | ||
| 1141 | def a(x, y, y): | ||
| 1142 | return t; pass | ||
| 1143 | def a(x, y, y): | ||
| 1144 | return t; pass | ||
| 1145 | def a(x, y, y): | ||
| 1146 | return t; pass | ||
| 1147 | def a(x, y, y): | ||
| 1148 | return t; pass | ||
| 1149 | def a(x, y, y): | ||
| 1150 | return t; pass | ||
| 1151 | def a(x, y, y): | ||
| 1152 | return t; pass | ||
| 1153 | def a(x, y, y): | ||
| 1154 | return t; pass | ||
| 1155 | def a(x, y, y): | ||
| 1156 | return t; pass | ||
| 1157 | def a(x, y, y): | ||
| 1158 | return t; pass | ||
| 1159 | def a(x, y, y): | ||
| 1160 | return t; pass | ||
| 1161 | def a(x, y, y): | ||
| 1162 | return t; pass | ||
| 1163 | def a(x, y, y): | ||
| 1164 | return t; pass | ||
| 1165 | def a(x, y, y): | ||
| 1166 | return t; pass | ||
| 1167 | def a(x, y, y): | ||
| 1168 | return t; pass | ||
| 1169 | def a(x, y, y): | ||
| 1170 | return t; pass | ||
| 1171 | def a(x, y, y): | ||
| 1172 | return t; pass | ||
| 1173 | def a(x, y, y): | ||
| 1174 | return t; pass | ||
| 1175 | def a(x, y, y): | ||
| 1176 | return t; pass | ||
| 1177 | def a(x, y, y): | ||
| 1178 | return t; pass | ||
| 1179 | def a(x, y, y): | ||
| 1180 | return t; pass | ||
| 1181 | def a(x, y, y): | ||
| 1182 | return t; pass | ||
| 1183 | def a(x, y, y): | ||
| 1184 | return t; pass | ||
| 1185 | def a(x, y, y): | ||
| 1186 | return t; pass | ||
| 1187 | def a(x, y, y): | ||
| 1188 | return t; pass | ||
| 1189 | def a(x, y, y): | ||
| 1190 | return t; pass | ||
| 1191 | def a(x, y, y): | ||
| 1192 | return t; pass | ||
| 1193 | def a(x, y, y): | ||
| 1194 | return t; pass | ||
| 1195 | def a(x, y, y): | ||
| 1196 | return t; pass | ||
| 1197 | def a(x, y, y): | ||
| 1198 | return t; pass | ||
| 1199 | def a(x, y, y): | ||
| 1200 | return t; pass | ||
| 1201 | def a(x, y, y): | ||
| 1202 | return t; pass | ||
| 1203 | def a(x, y, y): | ||
| 1204 | return t; pass | ||
| 1205 | def a(x, y, y): | ||
| 1206 | return t; pass | ||
| 1207 | def a(x, y, y): | ||
| 1208 | return t; pass | ||
| 1209 | def a(x, y, y): | ||
| 1210 | return t; pass | ||
| 1211 | def a(x, y, y): | ||
| 1212 | return t; pass | ||
| 1213 | def a(x, y, y): | ||
| 1214 | return t; pass | ||
| 1215 | def a(x, y, y): | ||
| 1216 | return t; pass | ||
| 1217 | def a(x, y, y): | ||
| 1218 | return t; pass | ||
| 1219 | def a(x, y, y): | ||
| 1220 | return t; pass | ||
| 1221 | def a(x, y, y): | ||
| 1222 | return t; pass | ||
| 1223 | def a(x, y, y): | ||
| 1224 | return t; pass | ||
| 1225 | def a(x, y, y): | ||
| 1226 | return t; pass | ||
| 1227 | def a(x, y, y): | ||
| 1228 | return t; pass | ||
| 1229 | def a(x, y, y): | ||
| 1230 | return t; pass | ||
| 1231 | def a(x, y, y): | ||
| 1232 | return t; pass | ||
| 1233 | def a(x, y, y): | ||
| 1234 | return t; pass | ||
| 1235 | def a(x, y, y): | ||
| 1236 | return t; pass | ||
| 1237 | def a(x, y, y): | ||
| 1238 | return t; pass | ||
| 1239 | def a(x, y, y): | ||
| 1240 | return t; pass | ||
| 1241 | def a(x, y, y): | ||
| 1242 | return t; pass | ||
| 1243 | def a(x, y, y): | ||
| 1244 | return t; pass | ||
| 1245 | def a(x, y, y): | ||
| 1246 | return t; pass | ||
| 1247 | def a(x, y, y): | ||
| 1248 | return t; pass | ||
| 1249 | def a(x, y, y): | ||
| 1250 | return t; pass | ||
| 1251 | def a(x, y, y): | ||
| 1252 | return t; pass | ||
| 1253 | def a(x, y, y): | ||
| 1254 | return t; pass | ||
| 1255 | def a(x, y, y): | ||
| 1256 | return t; pass | ||
| 1257 | def a(x, y, y): | ||
| 1258 | return t; pass | ||
| 1259 | def a(x, y, y): | ||
| 1260 | return t; pass | ||
| 1261 | def a(x, y, y): | ||
| 1262 | return t; pass | ||
| 1263 | def a(x, y, y): | ||
| 1264 | return t; pass | ||
| 1265 | def a(x, y, y): | ||
| 1266 | return t; pass | ||
| 1267 | def a(x, y, y): | ||
| 1268 | return t; pass | ||
| 1269 | def a(x, y, y): | ||
| 1270 | return t; pass | ||
| 1271 | def a(x, y, y): | ||
| 1272 | return t; pass | ||
| 1273 | def a(x, y, y): | ||
| 1274 | return t; pass | ||
| 1275 | def a(x, y, y): | ||
| 1276 | return t; pass | ||
| 1277 | def a(x, y, y): | ||
| 1278 | return t; pass | ||
| 1279 | def a(x, y, y): | ||
| 1280 | return t; pass | ||
| 1281 | def a(x, y, y): | ||
| 1282 | return t; pass | ||
| 1283 | def a(x, y, y): | ||
| 1284 | return t; pass | ||
| 1285 | def a(x, y, y): | ||
| 1286 | return t; pass | ||
| 1287 | def a(x, y, y): | ||
| 1288 | return t; pass | ||
| 1289 | def a(x, y, y): | ||
| 1290 | return t; pass | ||
| 1291 | def a(x, y, y): | ||
| 1292 | return t; pass | ||
| 1293 | def a(x, y, y): | ||
| 1294 | return t; pass | ||
| 1295 | def a(x, y, y): | ||
| 1296 | return t; pass | ||
| 1297 | def a(x, y, y): | ||
| 1298 | return t; pass | ||
| 1299 | def a(x, y, y): | ||
| 1300 | return t; pass | ||
| 1301 | def a(x, y, y): | ||
| 1302 | return t; pass | ||
| 1303 | def a(x, y, y): | ||
| 1304 | return t; pass | ||
| 1305 | def a(x, y, y): | ||
| 1306 | return t; pass | ||
| 1307 | def a(x, y, y): | ||
| 1308 | return t; pass | ||
| 1309 | def a(x, y, y): | ||
| 1310 | return t; pass | ||
| 1311 | def a(x, y, y): | ||
| 1312 | return t; pass | ||
| 1313 | def a(x, y, y): | ||
| 1314 | return t; pass | ||
| 1315 | def a(x, y, y): | ||
| 1316 | return t; pass | ||
| 1317 | def a(x, y, y): | ||
| 1318 | return t; pass | ||
| 1319 | def a(x, y, y): | ||
| 1320 | return t; pass | ||
| 1321 | def a(x, y, y): | ||
| 1322 | return t; pass | ||
| 1323 | def a(x, y, y): | ||
| 1324 | return t; pass | ||
| 1325 | def a(x, y, y): | ||
| 1326 | return t; pass | ||
| 1327 | def a(x, y, y): | ||
| 1328 | return t; pass | ||
| 1329 | def a(x, y, y): | ||
| 1330 | return t; pass | ||
| 1331 | def a(x, y, y): | ||
| 1332 | return t; pass | ||
| 1333 | def a(x, y, y): | ||
| 1334 | return t; pass | ||
| 1335 | def a(x, y, y): | ||
| 1336 | return t; pass | ||
| 1337 | def a(x, y, y): | ||
| 1338 | return t; pass | ||
| 1339 | def a(x, y, y): | ||
| 1340 | return t; pass | ||
| 1341 | def a(x, y, y): | ||
| 1342 | return t; pass | ||
| 1343 | def a(x, y, y): | ||
| 1344 | return t; pass | ||
| 1345 | def a(x, y, y): | ||
| 1346 | return t; pass | ||
| 1347 | def a(x, y, y): | ||
| 1348 | return t; pass | ||
| 1349 | def a(x, y, y): | ||
| 1350 | return t; pass | ||
| 1351 | def a(x, y, y): | ||
| 1352 | return t; pass | ||
| 1353 | def a(x, y, y): | ||
| 1354 | return t; pass | ||
| 1355 | def a(x, y, y): | ||
| 1356 | return t; pass | ||
| 1357 | def a(x, y, y): | ||
| 1358 | return t; pass | ||
| 1359 | def a(x, y, y): | ||
| 1360 | return t; pass | ||
| 1361 | def a(x, y, y): | ||
| 1362 | return t; pass | ||
| 1363 | def a(x, y, y): | ||
| 1364 | return t; pass | ||
| 1365 | def a(x, y, y): | ||
| 1366 | return t; pass | ||
| 1367 | def a(x, y, y): | ||
| 1368 | return t; pass | ||
| 1369 | def a(x, y, y): | ||
| 1370 | return t; pass | ||
| 1371 | def a(x, y, y): | ||
| 1372 | return t; pass | ||
| 1373 | def a(x, y, y): | ||
| 1374 | return t; pass | ||
| 1375 | def a(x, y, y): | ||
| 1376 | return t; pass | ||
| 1377 | def a(x, y, y): | ||
| 1378 | return t; pass | ||
| 1379 | def a(x, y, y): | ||
| 1380 | return t; pass | ||
| 1381 | def a(x, y, y): | ||
| 1382 | return t; pass | ||
| 1383 | def a(x, y, y): | ||
| 1384 | return t; pass | ||
| 1385 | def a(x, y, y): | ||
| 1386 | return t; pass | ||
| 1387 | def a(x, y, y): | ||
| 1388 | return t; pass | ||
| 1389 | def a(x, y, y): | ||
| 1390 | return t; pass | ||
| 1391 | def a(x, y, y): | ||
| 1392 | return t; pass | ||
| 1393 | def a(x, y, y): | ||
| 1394 | return t; pass | ||
| 1395 | def a(x, y, y): | ||
| 1396 | return t; pass | ||
| 1397 | def a(x, y, y): | ||
| 1398 | return t; pass | ||
| 1399 | def a(x, y, y): | ||
| 1400 | return t; pass | ||
| 1401 | def a(x, y, y): | ||
| 1402 | return t; pass | ||
| 1403 | def a(x, y, y): | ||
| 1404 | return t; pass | ||
| 1405 | def a(x, y, y): | ||
| 1406 | return t; pass | ||
| 1407 | def a(x, y, y): | ||
| 1408 | return t; pass | ||
| 1409 | def a(x, y, y): | ||
| 1410 | return t; pass | ||
| 1411 | def a(x, y, y): | ||
| 1412 | return t; pass | ||
| 1413 | def a(x, y, y): | ||
| 1414 | return t; pass | ||
| 1415 | def a(x, y, y): | ||
| 1416 | return t; pass | ||
| 1417 | def a(x, y, y): | ||
| 1418 | return t; pass | ||
| 1419 | def a(x, y, y): | ||
| 1420 | return t; pass | ||
| 1421 | def a(x, y, y): | ||
| 1422 | return t; pass | ||
| 1423 | def a(x, y, y): | ||
| 1424 | return t; pass | ||
| 1425 | def a(x, y, y): | ||
| 1426 | return t; pass | ||
| 1427 | def a(x, y, y): | ||
| 1428 | return t; pass | ||
| 1429 | def a(x, y, y): | ||
| 1430 | return t; pass | ||
| 1431 | def a(x, y, y): | ||
| 1432 | return t; pass | ||
| 1433 | def a(x, y, y): | ||
| 1434 | return t; pass | ||
| 1435 | def a(x, y, y): | ||
| 1436 | return t; pass | ||
| 1437 | def a(x, y, y): | ||
| 1438 | return t; pass | ||
| 1439 | def a(x, y, y): | ||
| 1440 | return t; pass | ||
| 1441 | def a(x, y, y): | ||
| 1442 | return t; pass | ||
| 1443 | def a(x, y, y): | ||
| 1444 | return t; pass | ||
| 1445 | def a(x, y, y): | ||
| 1446 | return t; pass | ||
| 1447 | def a(x, y, y): | ||
| 1448 | return t; pass | ||
| 1449 | def a(x, y, y): | ||
| 1450 | return t; pass | ||
| 1451 | def a(x, y, y): | ||
| 1452 | return t; pass | ||
| 1453 | def a(x, y, y): | ||
| 1454 | return t; pass | ||
| 1455 | def a(x, y, y): | ||
| 1456 | return t; pass | ||
| 1457 | def a(x, y, y): | ||
| 1458 | return t; pass | ||
| 1459 | def a(x, y, y): | ||
| 1460 | return t; pass | ||
| 1461 | def a(x, y, y): | ||
| 1462 | return t; pass | ||
| 1463 | def a(x, y, y): | ||
| 1464 | return t; pass | ||
| 1465 | def a(x, y, y): | ||
| 1466 | return t; pass | ||
| 1467 | def a(x, y, y): | ||
| 1468 | return t; pass | ||
| 1469 | def a(x, y, y): | ||
| 1470 | return t; pass | ||
| 1471 | def a(x, y, y): | ||
| 1472 | return t; pass | ||
| 1473 | def a(x, y, y): | ||
| 1474 | return t; pass | ||
| 1475 | def a(x, y, y): | ||
| 1476 | return t; pass | ||
| 1477 | def a(x, y, y): | ||
| 1478 | return t; pass | ||
| 1479 | def a(x, y, y): | ||
| 1480 | return t; pass | ||
| 1481 | def a(x, y, y): | ||
| 1482 | return t; pass | ||
| 1483 | def a(x, y, y): | ||
| 1484 | return t; pass | ||
| 1485 | def a(x, y, y): | ||
| 1486 | return t; pass | ||
| 1487 | def a(x, y, y): | ||
| 1488 | return t; pass | ||
| 1489 | def a(x, y, y): | ||
| 1490 | return t; pass | ||
| 1491 | def a(x, y, y): | ||
| 1492 | return t; pass | ||
| 1493 | def a(x, y, y): | ||
| 1494 | return t; pass | ||
| 1495 | def a(x, y, y): | ||
| 1496 | return t; pass | ||
| 1497 | def a(x, y, y): | ||
| 1498 | return t; pass | ||
| 1499 | def a(x, y, y): | ||
| 1500 | return t; pass | ||
| 1501 | def a(x, y, y): | ||
| 1502 | return t; pass | ||
| 1503 | def a(x, y, y): | ||
| 1504 | return t; pass | ||
| 1505 | def a(x, y, y): | ||
| 1506 | return t; pass | ||
| 1507 | def a(x, y, y): | ||
| 1508 | return t; pass | ||
| 1509 | def a(x, y, y): | ||
| 1510 | return t; pass | ||
| 1511 | def a(x, y, y): | ||
| 1512 | return t; pass | ||
| 1513 | def a(x, y, y): | ||
| 1514 | return t; pass | ||
| 1515 | def a(x, y, y): | ||
| 1516 | return t; pass | ||
| 1517 | def a(x, y, y): | ||
| 1518 | return t; pass | ||
| 1519 | def a(x, y, y): | ||
| 1520 | return t; pass | ||
| 1521 | def a(x, y, y): | ||
| 1522 | return t; pass | ||
| 1523 | def a(x, y, y): | ||
| 1524 | return t; pass | ||
| 1525 | def a(x, y, y): | ||
| 1526 | return t; pass | ||
| 1527 | def a(x, y, y): | ||
| 1528 | return t; pass | ||
| 1529 | def a(x, y, y): | ||
| 1530 | return t; pass | ||
| 1531 | def a(x, y, y): | ||
| 1532 | return t; pass | ||
| 1533 | def a(x, y, y): | ||
| 1534 | return t; pass | ||
| 1535 | def a(x, y, y): | ||
| 1536 | return t; pass | ||
| 1537 | def a(x, y, y): | ||
| 1538 | return t; pass | ||
| 1539 | def a(x, y, y): | ||
| 1540 | return t; pass | ||
| 1541 | def a(x, y, y): | ||
| 1542 | return t; pass | ||
| 1543 | def a(x, y, y): | ||
| 1544 | return t; pass | ||
| 1545 | def a(x, y, y): | ||
| 1546 | return t; pass | ||
| 1547 | def a(x, y, y): | ||
| 1548 | return t; pass | ||
| 1549 | def a(x, y, y): | ||
| 1550 | return t; pass | ||
| 1551 | def a(x, y, y): | ||
| 1552 | return t; pass | ||
| 1553 | def a(x, y, y): | ||
| 1554 | return t; pass | ||
| 1555 | def a(x, y, y): | ||
| 1556 | return t; pass | ||
| 1557 | def a(x, y, y): | ||
| 1558 | return t; pass | ||
| 1559 | def a(x, y, y): | ||
| 1560 | return t; pass | ||
| 1561 | def a(x, y, y): | ||
| 1562 | return t; pass | ||
| 1563 | def a(x, y, y): | ||
| 1564 | return t; pass | ||
| 1565 | def a(x, y, y): | ||
| 1566 | return t; pass | ||
| 1567 | def a(x, y, y): | ||
| 1568 | return t; pass | ||
| 1569 | def a(x, y, y): | ||
| 1570 | return t; pass | ||
| 1571 | def a(x, y, y): | ||
| 1572 | return t; pass | ||
| 1573 | def a(x, y, y): | ||
| 1574 | return t; pass | ||
| 1575 | def a(x, y, y): | ||
| 1576 | return t; pass | ||
| 1577 | def a(x, y, y): | ||
| 1578 | return t; pass | ||
| 1579 | def a(x, y, y): | ||
| 1580 | return t; pass | ||
| 1581 | def a(x, y, y): | ||
| 1582 | return t; pass | ||
| 1583 | def a(x, y, y): | ||
| 1584 | return t; pass | ||
| 1585 | def a(x, y, y): | ||
| 1586 | return t; pass | ||
| 1587 | def a(x, y, y): | ||
| 1588 | return t; pass | ||
| 1589 | def a(x, y, y): | ||
| 1590 | return t; pass | ||
| 1591 | def a(x, y, y): | ||
| 1592 | return t; pass | ||
| 1593 | def a(x, y, y): | ||
| 1594 | return t; pass | ||
| 1595 | def a(x, y, y): | ||
| 1596 | return t; pass | ||
| 1597 | def a(x, y, y): | ||
| 1598 | return t; pass | ||
| 1599 | def a(x, y, y): | ||
| 1600 | return t; pass | ||
| 1601 | def a(x, y, y): | ||
| 1602 | return t; pass | ||
| 1603 | def a(x, y, y): | ||
| 1604 | return t; pass | ||
| 1605 | def a(x, y, y): | ||
| 1606 | return t; pass | ||
| 1607 | def a(x, y, y): | ||
| 1608 | return t; pass | ||
| 1609 | def a(x, y, y): | ||
| 1610 | return t; pass | ||
| 1611 | def a(x, y, y): | ||
| 1612 | return t; pass | ||
| 1613 | def a(x, y, y): | ||
| 1614 | return t; pass | ||
| 1615 | def a(x, y, y): | ||
| 1616 | return t; pass | ||
| 1617 | def a(x, y, y): | ||
| 1618 | return t; pass | ||
| 1619 | def a(x, y, y): | ||
| 1620 | return t; pass | ||
| 1621 | def a(x, y, y): | ||
| 1622 | return t; pass | ||
| 1623 | def a(x, y, y): | ||
| 1624 | return t; pass | ||
| 1625 | def a(x, y, y): | ||
| 1626 | return t; pass | ||
| 1627 | def a(x, y, y): | ||
| 1628 | return t; pass | ||
| 1629 | def a(x, y, y): | ||
| 1630 | return t; pass | ||
| 1631 | def a(x, y, y): | ||
| 1632 | return t; pass | ||
| 1633 | def a(x, y, y): | ||
| 1634 | return t; pass | ||
| 1635 | def a(x, y, y): | ||
| 1636 | return t; pass | ||
| 1637 | def a(x, y, y): | ||
| 1638 | return t; pass | ||
| 1639 | def a(x, y, y): | ||
| 1640 | return t; pass | ||
| 1641 | def a(x, y, y): | ||
| 1642 | return t; pass | ||
| 1643 | def a(x, y, y): | ||
| 1644 | return t; pass | ||
| 1645 | def a(x, y, y): | ||
| 1646 | return t; pass | ||
| 1647 | def a(x, y, y): | ||
| 1648 | return t; pass | ||
| 1649 | def a(x, y, y): | ||
| 1650 | return t; pass | ||
| 1651 | def a(x, y, y): | ||
| 1652 | return t; pass | ||
| 1653 | def a(x, y, y): | ||
| 1654 | return t; pass | ||
| 1655 | def a(x, y, y): | ||
| 1656 | return t; pass | ||
| 1657 | def a(x, y, y): | ||
| 1658 | return t; pass | ||
| 1659 | def a(x, y, y): | ||
| 1660 | return t; pass | ||
| 1661 | def a(x, y, y): | ||
| 1662 | return t; pass | ||
| 1663 | def a(x, y, y): | ||
| 1664 | return t; pass | ||
| 1665 | def a(x, y, y): | ||
| 1666 | return t; pass | ||
| 1667 | def a(x, y, y): | ||
| 1668 | return t; pass | ||
| 1669 | def a(x, y, y): | ||
| 1670 | return t; pass | ||
| 1671 | def a(x, y, y): | ||
| 1672 | return t; pass | ||
| 1673 | def a(x, y, y): | ||
| 1674 | return t; pass | ||
| 1675 | def a(x, y, y): | ||
| 1676 | return t; pass | ||
| 1677 | def a(x, y, y): | ||
| 1678 | return t; pass | ||
| 1679 | def a(x, y, y): | ||
| 1680 | return t; pass | ||
| 1681 | def a(x, y, y): | ||
| 1682 | return t; pass | ||
| 1683 | def a(x, y, y): | ||
| 1684 | return t; pass | ||
| 1685 | def a(x, y, y): | ||
| 1686 | return t; pass | ||
| 1687 | def a(x, y, y): | ||
| 1688 | return t; pass | ||
| 1689 | def a(x, y, y): | ||
| 1690 | return t; pass | ||
| 1691 | def a(x, y, y): | ||
| 1692 | return t; pass | ||
| 1693 | def a(x, y, y): | ||
| 1694 | return t; pass | ||
| 1695 | def a(x, y, y): | ||
| 1696 | return t; pass | ||
| 1697 | def a(x, y, y): | ||
| 1698 | return t; pass | ||
| 1699 | def a(x, y, y): | ||
| 1700 | return t; pass | ||
| 1701 | def a(x, y, y): | ||
| 1702 | return t; pass | ||
| 1703 | def a(x, y, y): | ||
| 1704 | return t; pass | ||
| 1705 | def a(x, y, y): | ||
| 1706 | return t; pass | ||
| 1707 | def a(x, y, y): | ||
| 1708 | return t; pass | ||
| 1709 | def a(x, y, y): | ||
| 1710 | return t; pass | ||
| 1711 | def a(x, y, y): | ||
| 1712 | return t; pass | ||
| 1713 | def a(x, y, y): | ||
| 1714 | return t; pass | ||
| 1715 | def a(x, y, y): | ||
| 1716 | return t; pass | ||
| 1717 | def a(x, y, y): | ||
| 1718 | return t; pass | ||
| 1719 | def a(x, y, y): | ||
| 1720 | return t; pass | ||
| 1721 | def a(x, y, y): | ||
| 1722 | return t; pass | ||
| 1723 | def a(x, y, y): | ||
| 1724 | return t; pass | ||
| 1725 | def a(x, y, y): | ||
| 1726 | return t; pass | ||
| 1727 | def a(x, y, y): | ||
| 1728 | return t; pass | ||
| 1729 | def a(x, y, y): | ||
| 1730 | return t; pass | ||
| 1731 | def a(x, y, y): | ||
| 1732 | return t; pass | ||
| 1733 | def a(x, y, y): | ||
| 1734 | return t; pass | ||
| 1735 | def a(x, y, y): | ||
| 1736 | return t; pass | ||
| 1737 | def a(x, y, y): | ||
| 1738 | return t; pass | ||
| 1739 | def a(x, y, y): | ||
| 1740 | return t; pass | ||
| 1741 | def a(x, y, y): | ||
| 1742 | return t; pass | ||
| 1743 | def a(x, y, y): | ||
| 1744 | return t; pass | ||
| 1745 | def a(x, y, y): | ||
| 1746 | return t; pass | ||
| 1747 | def a(x, y, y): | ||
| 1748 | return t; pass | ||
| 1749 | def a(x, y, y): | ||
| 1750 | return t; pass | ||
| 1751 | def a(x, y, y): | ||
| 1752 | return t; pass | ||
| 1753 | def a(x, y, y): | ||
| 1754 | return t; pass | ||
| 1755 | def a(x, y, y): | ||
| 1756 | return t; pass | ||
| 1757 | def a(x, y, y): | ||
| 1758 | return t; pass | ||
| 1759 | def a(x, y, y): | ||
| 1760 | return t; pass | ||
| 1761 | def a(x, y, y): | ||
| 1762 | return t; pass | ||
| 1763 | def a(x, y, y): | ||
| 1764 | return t; pass | ||
| 1765 | def a(x, y, y): | ||
| 1766 | return t; pass | ||
| 1767 | def a(x, y, y): | ||
| 1768 | return t; pass | ||
| 1769 | def a(x, y, y): | ||
| 1770 | return t; pass | ||
| 1771 | def a(x, y, y): | ||
| 1772 | return t; pass | ||
| 1773 | def a(x, y, y): | ||
| 1774 | return t; pass | ||
| 1775 | def a(x, y, y): | ||
| 1776 | return t; pass | ||
| 1777 | def a(x, y, y): | ||
| 1778 | return t; pass | ||
| 1779 | def a(x, y, y): | ||
| 1780 | return t; pass | ||
| 1781 | def a(x, y, y): | ||
| 1782 | return t; pass | ||
| 1783 | def a(x, y, y): | ||
| 1784 | return t; pass | ||
| 1785 | def a(x, y, y): | ||
| 1786 | return t; pass | ||
| 1787 | def a(x, y, y): | ||
| 1788 | return t; pass | ||
| 1789 | def a(x, y, y): | ||
| 1790 | return t; pass | ||
| 1791 | def a(x, y, y): | ||
| 1792 | return t; pass | ||
| 1793 | def a(x, y, y): | ||
| 1794 | return t; pass | ||
| 1795 | def a(x, y, y): | ||
| 1796 | return t; pass | ||
| 1797 | def a(x, y, y): | ||
| 1798 | return t; pass | ||
| 1799 | def a(x, y, y): | ||
| 1800 | return t; pass | ||
| 1801 | def a(x, y, y): | ||
| 1802 | return t; pass | ||
| 1803 | def a(x, y, y): | ||
| 1804 | return t; pass | ||
| 1805 | def a(x, y, y): | ||
| 1806 | return t; pass | ||
| 1807 | def a(x, y, y): | ||
| 1808 | return t; pass | ||
| 1809 | def a(x, y, y): | ||
| 1810 | return t; pass | ||
| 1811 | def a(x, y, y): | ||
| 1812 | return t; pass | ||
| 1813 | def a(x, y, y): | ||
| 1814 | return t; pass | ||
| 1815 | def a(x, y, y): | ||
| 1816 | return t; pass | ||
| 1817 | def a(x, y, y): | ||
| 1818 | return t; pass | ||
| 1819 | def a(x, y, y): | ||
| 1820 | return t; pass | ||
| 1821 | def a(x, y, y): | ||
| 1822 | return t; pass | ||
| 1823 | def a(x, y, y): | ||
| 1824 | return t; pass | ||
| 1825 | def a(x, y, y): | ||
| 1826 | return t; pass | ||
| 1827 | def a(x, y, y): | ||
| 1828 | return t; pass | ||
| 1829 | def a(x, y, y): | ||
| 1830 | return t; pass | ||
| 1831 | def a(x, y, y): | ||
| 1832 | return t; pass | ||
| 1833 | def a(x, y, y): | ||
| 1834 | return t; pass | ||
| 1835 | def a(x, y, y): | ||
| 1836 | return t; pass | ||
| 1837 | def a(x, y, y): | ||
| 1838 | return t; pass | ||
| 1839 | def a(x, y, y): | ||
| 1840 | return t; pass | ||
| 1841 | def a(x, y, y): | ||
| 1842 | return t; pass | ||
| 1843 | def a(x, y, y): | ||
| 1844 | return t; pass | ||
| 1845 | def a(x, y, y): | ||
| 1846 | return t; pass | ||
| 1847 | def a(x, y, y): | ||
| 1848 | return t; pass | ||
| 1849 | def a(x, y, y): | ||
| 1850 | return t; pass | ||
| 1851 | def a(x, y, y): | ||
| 1852 | return t; pass | ||
| 1853 | def a(x, y, y): | ||
| 1854 | return t; pass | ||
| 1855 | def a(x, y, y): | ||
| 1856 | return t; pass | ||
| 1857 | def a(x, y, y): | ||
| 1858 | return t; pass | ||
| 1859 | def a(x, y, y): | ||
| 1860 | return t; pass | ||
| 1861 | def a(x, y, y): | ||
| 1862 | return t; pass | ||
| 1863 | def a(x, y, y): | ||
| 1864 | return t; pass | ||
| 1865 | def a(x, y, y): | ||
| 1866 | return t; pass | ||
| 1867 | def a(x, y, y): | ||
| 1868 | return t; pass | ||
| 1869 | def a(x, y, y): | ||
| 1870 | return t; pass | ||
| 1871 | def a(x, y, y): | ||
| 1872 | return t; pass | ||
| 1873 | def a(x, y, y): | ||
| 1874 | return t; pass | ||
| 1875 | def a(x, y, y): | ||
| 1876 | return t; pass | ||
| 1877 | def a(x, y, y): | ||
| 1878 | return t; pass | ||
| 1879 | def a(x, y, y): | ||
| 1880 | return t; pass | ||
| 1881 | def a(x, y, y): | ||
| 1882 | return t; pass | ||
| 1883 | def a(x, y, y): | ||
| 1884 | return t; pass | ||
| 1885 | def a(x, y, y): | ||
| 1886 | return t; pass | ||
| 1887 | def a(x, y, y): | ||
| 1888 | return t; pass | ||
| 1889 | def a(x, y, y): | ||
| 1890 | return t; pass | ||
| 1891 | def a(x, y, y): | ||
| 1892 | return t; pass | ||
| 1893 | def a(x, y, y): | ||
| 1894 | return t; pass | ||
| 1895 | def a(x, y, y): | ||
| 1896 | return t; pass | ||
| 1897 | def a(x, y, y): | ||
| 1898 | return t; pass | ||
| 1899 | def a(x, y, y): | ||
| 1900 | return t; pass | ||
| 1901 | def a(x, y, y): | ||
| 1902 | return t; pass | ||
| 1903 | def a(x, y, y): | ||
| 1904 | return t; pass | ||
| 1905 | def a(x, y, y): | ||
| 1906 | return t; pass | ||
| 1907 | def a(x, y, y): | ||
| 1908 | return t; pass | ||
| 1909 | def a(x, y, y): | ||
| 1910 | return t; pass | ||
| 1911 | def a(x, y, y): | ||
| 1912 | return t; pass | ||
| 1913 | def a(x, y, y): | ||
| 1914 | return t; pass | ||
| 1915 | def a(x, y, y): | ||
| 1916 | return t; pass | ||
| 1917 | def a(x, y, y): | ||
| 1918 | return t; pass | ||
| 1919 | def a(x, y, y): | ||
| 1920 | return t; pass | ||
| 1921 | def a(x, y, y): | ||
| 1922 | return t; pass | ||
| 1923 | def a(x, y, y): | ||
| 1924 | return t; pass | ||
| 1925 | def a(x, y, y): | ||
| 1926 | return t; pass | ||
| 1927 | def a(x, y, y): | ||
| 1928 | return t; pass | ||
| 1929 | def a(x, y, y): | ||
| 1930 | return t; pass | ||
| 1931 | def a(x, y, y): | ||
| 1932 | return t; pass | ||
| 1933 | def a(x, y, y): | ||
| 1934 | return t; pass | ||
| 1935 | def a(x, y, y): | ||
| 1936 | return t; pass | ||
| 1937 | def a(x, y, y): | ||
| 1938 | return t; pass | ||
| 1939 | def a(x, y, y): | ||
| 1940 | return t; pass | ||
| 1941 | def a(x, y, y): | ||
| 1942 | return t; pass | ||
| 1943 | def a(x, y, y): | ||
| 1944 | return t; pass | ||
| 1945 | def a(x, y, y): | ||
| 1946 | return t; pass | ||
| 1947 | def a(x, y, y): | ||
| 1948 | return t; pass | ||
| 1949 | def a(x, y, y): | ||
| 1950 | return t; pass | ||
| 1951 | def a(x, y, y): | ||
| 1952 | return t; pass | ||
| 1953 | def a(x, y, y): | ||
| 1954 | return t; pass | ||
| 1955 | def a(x, y, y): | ||
| 1956 | return t; pass | ||
| 1957 | def a(x, y, y): | ||
| 1958 | return t; pass | ||
| 1959 | def a(x, y, y): | ||
| 1960 | return t; pass | ||
| 1961 | def a(x, y, y): | ||
| 1962 | return t; pass | ||
| 1963 | def a(x, y, y): | ||
| 1964 | return t; pass | ||
| 1965 | def a(x, y, y): | ||
| 1966 | return t; pass | ||
| 1967 | def a(x, y, y): | ||
| 1968 | return t; pass | ||
| 1969 | def a(x, y, y): | ||
| 1970 | return t; pass | ||
| 1971 | def a(x, y, y): | ||
| 1972 | return t; pass | ||
| 1973 | def a(x, y, y): | ||
| 1974 | return t; pass | ||
| 1975 | def a(x, y, y): | ||
| 1976 | return t; pass | ||
| 1977 | def a(x, y, y): | ||
| 1978 | return t; pass | ||
| 1979 | def a(x, y, y): | ||
| 1980 | return t; pass | ||
| 1981 | def a(x, y, y): | ||
| 1982 | return t; pass | ||
| 1983 | def a(x, y, y): | ||
| 1984 | return t; pass | ||
| 1985 | def a(x, y, y): | ||
| 1986 | return t; pass | ||
| 1987 | def a(x, y, y): | ||
| 1988 | return t; pass | ||
| 1989 | def a(x, y, y): | ||
| 1990 | return t; pass | ||
| 1991 | def a(x, y, y): | ||
| 1992 | return t; pass | ||
| 1993 | def a(x, y, y): | ||
| 1994 | return t; pass | ||
| 1995 | def a(x, y, y): | ||
| 1996 | return t; pass | ||
| 1997 | def a(x, y, y): | ||
| 1998 | return t; pass | ||
| 1999 | def a(x, y, y): | ||
| 2000 | return t; pass | ||
| 2001 | def a(x, y, y): | ||
| 2002 | return t; pass | ||
| 2003 | def a(x, y, y): | ||
| 2004 | return t; pass | ||
| 2005 | def a(x, y, y): | ||
| 2006 | return t; pass | ||
| 2007 | def a(x, y, y): | ||
| 2008 | return t; pass | ||
| 2009 | def a(x, y, y): | ||
| 2010 | return t; pass | ||
| 2011 | def a(x, y, y): | ||
| 2012 | return t; pass | ||
| 2013 | def a(x, y, y): | ||
| 2014 | return t; pass | ||
| 2015 | def a(x, y, y): | ||
| 2016 | return t; pass | ||
| 2017 | def a(x, y, y): | ||
| 2018 | return t; pass | ||
| 2019 | def a(x, y, y): | ||
| 2020 | return t; pass | ||
| 2021 | def a(x, y, y): | ||
| 2022 | return t; pass | ||
| 2023 | def a(x, y, y): | ||
| 2024 | return t; pass | ||
| 2025 | def a(x, y, y): | ||
| 2026 | return t; pass | ||
| 2027 | def a(x, y, y): | ||
| 2028 | return t; pass | ||
| 2029 | def a(x, y, y): | ||
| 2030 | return t; pass | ||
| 2031 | def a(x, y, y): | ||
| 2032 | return t; pass | ||
| 2033 | def a(x, y, y): | ||
| 2034 | return t; pass | ||
| 2035 | def a(x, y, y): | ||
| 2036 | return t; pass | ||
| 2037 | def a(x, y, y): | ||
| 2038 | return t; pass | ||
| 2039 | def a(x, y, y): | ||
| 2040 | return t; pass | ||
| 2041 | def a(x, y, y): | ||
| 2042 | return t; pass | ||
| 2043 | def a(x, y, y): | ||
| 2044 | return t; pass | ||
| 2045 | def a(x, y, y): | ||
| 2046 | return t; pass | ||
| 2047 | def a(x, y, y): | ||
| 2048 | return t; pass | ||
| 2049 | def a(x, y, y): | ||
| 2050 | return t; pass | ||
| 2051 | def a(x, y, y): | ||
| 2052 | return t; pass | ||
| 2053 | def a(x, y, y): | ||
| 2054 | return t; pass | ||
| 2055 | def a(x, y, y): | ||
| 2056 | return t; pass | ||
| 2057 | def a(x, y, y): | ||
| 2058 | return t; pass | ||
| 2059 | def a(x, y, y): | ||
| 2060 | return t; pass | ||
| 2061 | def a(x, y, y): | ||
| 2062 | return t; pass | ||
| 2063 | def a(x, y, y): | ||
| 2064 | return t; pass | ||
| 2065 | def a(x, y, y): | ||
| 2066 | return t; pass | ||
| 2067 | def a(x, y, y): | ||
| 2068 | return t; pass | ||
| 2069 | def a(x, y, y): | ||
| 2070 | return t; pass | ||
| 2071 | def a(x, y, y): | ||
| 2072 | return t; pass | ||
| 2073 | def a(x, y, y): | ||
| 2074 | return t; pass | ||
| 2075 | def a(x, y, y): | ||
| 2076 | return t; pass | ||
| 2077 | def a(x, y, y): | ||
| 2078 | return t; pass | ||
| 2079 | def a(x, y, y): | ||
| 2080 | return t; pass | ||
| 2081 | def a(x, y, y): | ||
| 2082 | return t; pass | ||
| 2083 | def a(x, y, y): | ||
| 2084 | return t; pass | ||
| 2085 | def a(x, y, y): | ||
| 2086 | return t; pass | ||
| 2087 | def a(x, y, y): | ||
| 2088 | return t; pass | ||
| 2089 | def a(x, y, y): | ||
| 2090 | return t; pass | ||
| 2091 | def a(x, y, y): | ||
| 2092 | return t; pass | ||
| 2093 | def a(x, y, y): | ||
| 2094 | return t; pass | ||
| 2095 | def a(x, y, y): | ||
| 2096 | return t; pass | ||
| 2097 | def a(x, y, y): | ||
| 2098 | return t; pass | ||
| 2099 | def a(x, y, y): | ||
| 2100 | return t; pass | ||
| 2101 | def a(x, y, y): | ||
| 2102 | return t; pass | ||
| 2103 | def a(x, y, y): | ||
| 2104 | return t; pass | ||
| 2105 | def a(x, y, y): | ||
| 2106 | return t; pass | ||
| 2107 | def a(x, y, y): | ||
| 2108 | return t; pass | ||
| 2109 | def a(x, y, y): | ||
| 2110 | return t; pass | ||
| 2111 | def a(x, y, y): | ||
| 2112 | return t; pass | ||
| 2113 | def a(x, y, y): | ||
| 2114 | return t; pass | ||
| 2115 | def a(x, y, y): | ||
| 2116 | return t; pass | ||
| 2117 | def a(x, y, y): | ||
| 2118 | return t; pass | ||
| 2119 | def a(x, y, y): | ||
| 2120 | return t; pass | ||
| 2121 | def a(x, y, y): | ||
| 2122 | return t; pass | ||
| 2123 | def a(x, y, y): | ||
| 2124 | return t; pass | ||
| 2125 | def a(x, y, y): | ||
| 2126 | return t; pass | ||
| 2127 | def a(x, y, y): | ||
| 2128 | return t; pass | ||
| 2129 | def a(x, y, y): | ||
| 2130 | return t; pass | ||
| 2131 | def a(x, y, y): | ||
| 2132 | return t; pass | ||
| 2133 | def a(x, y, y): | ||
| 2134 | return t; pass | ||
| 2135 | def a(x, y, y): | ||
| 2136 | return t; pass | ||
| 2137 | def a(x, y, y): | ||
| 2138 | return t; pass | ||
| 2139 | def a(x, y, y): | ||
| 2140 | return t; pass | ||
| 2141 | def a(x, y, y): | ||
| 2142 | return t; pass | ||
| 2143 | def a(x, y, y): | ||
| 2144 | return t; pass | ||
| 2145 | def a(x, y, y): | ||
| 2146 | return t; pass | ||
| 2147 | def a(x, y, y): | ||
| 2148 | return t; pass | ||
| 2149 | def a(x, y, y): | ||
| 2150 | return t; pass | ||
| 2151 | def a(x, y, y): | ||
| 2152 | return t; pass | ||
| 2153 | def a(x, y, y): | ||
| 2154 | return t; pass | ||
| 2155 | def a(x, y, y): | ||
| 2156 | return t; pass | ||
| 2157 | def a(x, y, y): | ||
| 2158 | return t; pass | ||
| 2159 | def a(x, y, y): | ||
| 2160 | return t; pass | ||
| 2161 | def a(x, y, y): | ||
| 2162 | return t; pass | ||
| 2163 | def a(x, y, y): | ||
| 2164 | return t; pass | ||
| 2165 | def a(x, y, y): | ||
| 2166 | return t; pass | ||
| 2167 | def a(x, y, y): | ||
| 2168 | return t; pass | ||
| 2169 | def a(x, y, y): | ||
| 2170 | return t; pass | ||
| 2171 | def a(x, y, y): | ||
| 2172 | return t; pass | ||
| 2173 | def a(x, y, y): | ||
| 2174 | return t; pass | ||
| 2175 | def a(x, y, y): | ||
| 2176 | return t; pass | ||
| 2177 | def a(x, y, y): | ||
| 2178 | return t; pass | ||
| 2179 | def a(x, y, y): | ||
| 2180 | return t; pass | ||
| 2181 | def a(x, y, y): | ||
| 2182 | return t; pass | ||
| 2183 | def a(x, y, y): | ||
| 2184 | return t; pass | ||
| 2185 | def a(x, y, y): | ||
| 2186 | return t; pass | ||
| 2187 | def a(x, y, y): | ||
| 2188 | return t; pass | ||
| 2189 | def a(x, y, y): | ||
| 2190 | return t; pass | ||
| 2191 | def a(x, y, y): | ||
| 2192 | return t; pass | ||
| 2193 | def a(x, y, y): | ||
| 2194 | return t; pass | ||
| 2195 | def a(x, y, y): | ||
| 2196 | return t; pass | ||
| 2197 | def a(x, y, y): | ||
| 2198 | return t; pass | ||
| 2199 | def a(x, y, y): | ||
| 2200 | return t; pass | ||
| 2201 | def a(x, y, y): | ||
| 2202 | return t; pass | ||
| 2203 | def a(x, y, y): | ||
| 2204 | return t; pass | ||
| 2205 | def a(x, y, y): | ||
| 2206 | return t; pass | ||
| 2207 | def a(x, y, y): | ||
| 2208 | return t; pass | ||
| 2209 | def a(x, y, y): | ||
| 2210 | return t; pass | ||
| 2211 | def a(x, y, y): | ||
| 2212 | return t; pass | ||
| 2213 | def a(x, y, y): | ||
| 2214 | return t; pass | ||
| 2215 | def a(x, y, y): | ||
| 2216 | return t; pass | ||
| 2217 | def a(x, y, y): | ||
| 2218 | return t; pass | ||
| 2219 | def a(x, y, y): | ||
| 2220 | return t; pass | ||
| 2221 | def a(x, y, y): | ||
| 2222 | return t; pass | ||
| 2223 | def a(x, y, y): | ||
| 2224 | return t; pass | ||
| 2225 | def a(x, y, y): | ||
| 2226 | return t; pass | ||
| 2227 | def a(x, y, y): | ||
| 2228 | return t; pass | ||
| 2229 | def a(x, y, y): | ||
| 2230 | return t; pass | ||
| 2231 | def a(x, y, y): | ||
| 2232 | return t; pass | ||
| 2233 | def a(x, y, y): | ||
| 2234 | return t; pass | ||
| 2235 | def a(x, y, y): | ||
| 2236 | return t; pass | ||
| 2237 | def a(x, y, y): | ||
| 2238 | return t; pass | ||
| 2239 | def a(x, y, y): | ||
| 2240 | return t; pass | ||
| 2241 | def a(x, y, y): | ||
| 2242 | return t; pass | ||
| 2243 | def a(x, y, y): | ||
| 2244 | return t; pass | ||
| 2245 | def a(x, y, y): | ||
| 2246 | return t; pass | ||
| 2247 | def a(x, y, y): | ||
| 2248 | return t; pass | ||
| 2249 | def a(x, y, y): | ||
| 2250 | return t; pass | ||
| 2251 | def a(x, y, y): | ||
| 2252 | return t; pass | ||
| 2253 | def a(x, y, y): | ||
| 2254 | return t; pass | ||
| 2255 | def a(x, y, y): | ||
| 2256 | return t; pass | ||
| 2257 | def a(x, y, y): | ||
| 2258 | return t; pass | ||
| 2259 | def a(x, y, y): | ||
| 2260 | return t; pass | ||
| 2261 | def a(x, y, y): | ||
| 2262 | return t; pass | ||
| 2263 | def a(x, y, y): | ||
| 2264 | return t; pass | ||
| 2265 | def a(x, y, y): | ||
| 2266 | return t; pass | ||
| 2267 | def a(x, y, y): | ||
| 2268 | return t; pass | ||
| 2269 | def a(x, y, y): | ||
| 2270 | return t; pass | ||
| 2271 | def a(x, y, y): | ||
| 2272 | return t; pass | ||
| 2273 | def a(x, y, y): | ||
| 2274 | return t; pass | ||
| 2275 | def a(x, y, y): | ||
| 2276 | return t; pass | ||
| 2277 | def a(x, y, y): | ||
| 2278 | return t; pass | ||
| 2279 | def a(x, y, y): | ||
| 2280 | return t; pass | ||
| 2281 | def a(x, y, y): | ||
| 2282 | return t; pass | ||
| 2283 | def a(x, y, y): | ||
| 2284 | return t; pass | ||
| 2285 | def a(x, y, y): | ||
| 2286 | return t; pass | ||
| 2287 | def a(x, y, y): | ||
| 2288 | return t; pass | ||
| 2289 | def a(x, y, y): | ||
| 2290 | return t; pass | ||
| 2291 | def a(x, y, y): | ||
| 2292 | return t; pass | ||
| 2293 | def a(x, y, y): | ||
| 2294 | return t; pass | ||
| 2295 | def a(x, y, y): | ||
| 2296 | return t; pass | ||
| 2297 | def a(x, y, y): | ||
| 2298 | return t; pass | ||
| 2299 | def a(x, y, y): | ||
| 2300 | return t; pass | ||
| 2301 | def a(x, y, y): | ||
| 2302 | return t; pass | ||
| 2303 | def a(x, y, y): | ||
| 2304 | return t; pass | ||
| 2305 | def a(x, y, y): | ||
| 2306 | return t; pass | ||
| 2307 | def a(x, y, y): | ||
| 2308 | return t; pass | ||
| 2309 | def a(x, y, y): | ||
| 2310 | return t; pass | ||
| 2311 | def a(x, y, y): | ||
| 2312 | return t; pass | ||
| 2313 | def a(x, y, y): | ||
| 2314 | return t; pass | ||
| 2315 | def a(x, y, y): | ||
| 2316 | return t; pass | ||
| 2317 | def a(x, y, y): | ||
| 2318 | return t; pass | ||
| 2319 | def a(x, y, y): | ||
| 2320 | return t; pass | ||
| 2321 | def a(x, y, y): | ||
| 2322 | return t; pass | ||
| 2323 | def a(x, y, y): | ||
| 2324 | return t; pass | ||
| 2325 | def a(x, y, y): | ||
| 2326 | return t; pass | ||
| 2327 | def a(x, y, y): | ||
| 2328 | return t; pass | ||
| 2329 | def a(x, y, y): | ||
| 2330 | return t; pass | ||
| 2331 | def a(x, y, y): | ||
| 2332 | return t; pass | ||
| 2333 | def a(x, y, y): | ||
| 2334 | return t; pass | ||
| 2335 | def a(x, y, y): | ||
| 2336 | return t; pass | ||
| 2337 | def a(x, y, y): | ||
| 2338 | return t; pass | ||
| 2339 | def a(x, y, y): | ||
| 2340 | return t; pass | ||
| 2341 | def a(x, y, y): | ||
| 2342 | return t; pass | ||
| 2343 | def a(x, y, y): | ||
| 2344 | return t; pass | ||
| 2345 | def a(x, y, y): | ||
| 2346 | return t; pass | ||
| 2347 | def a(x, y, y): | ||
| 2348 | return t; pass | ||
| 2349 | def a(x, y, y): | ||
| 2350 | return t; pass | ||
| 2351 | def a(x, y, y): | ||
| 2352 | return t; pass | ||
| 2353 | def a(x, y, y): | ||
| 2354 | return t; pass | ||
| 2355 | def a(x, y, y): | ||
| 2356 | return t; pass | ||
| 2357 | def a(x, y, y): | ||
| 2358 | return t; pass | ||
| 2359 | def a(x, y, y): | ||
| 2360 | return t; pass | ||
| 2361 | def a(x, y, y): | ||
| 2362 | return t; pass | ||
| 2363 | def a(x, y, y): | ||
| 2364 | return t; pass | ||
| 2365 | def a(x, y, y): | ||
| 2366 | return t; pass | ||
| 2367 | def a(x, y, y): | ||
| 2368 | return t; pass | ||
| 2369 | def a(x, y, y): | ||
| 2370 | return t; pass | ||
| 2371 | def a(x, y, y): | ||
| 2372 | return t; pass | ||
| 2373 | def a(x, y, y): | ||
| 2374 | return t; pass | ||
| 2375 | def a(x, y, y): | ||
| 2376 | return t; pass | ||
| 2377 | def a(x, y, y): | ||
| 2378 | return t; pass | ||
| 2379 | def a(x, y, y): | ||
| 2380 | return t; pass | ||
| 2381 | def a(x, y, y): | ||
| 2382 | return t; pass | ||
| 2383 | def a(x, y, y): | ||
| 2384 | return t; pass | ||
| 2385 | def a(x, y, y): | ||
| 2386 | return t; pass | ||
| 2387 | def a(x, y, y): | ||
| 2388 | return t; pass | ||
| 2389 | def a(x, y, y): | ||
| 2390 | return t; pass | ||
| 2391 | def a(x, y, y): | ||
| 2392 | return t; pass | ||
| 2393 | def a(x, y, y): | ||
| 2394 | return t; pass | ||
| 2395 | def a(x, y, y): | ||
| 2396 | return t; pass | ||
| 2397 | def a(x, y, y): | ||
| 2398 | return t; pass | ||
| 2399 | def a(x, y, y): | ||
| 2400 | return t; pass | ||
| 2401 | def a(x, y, y): | ||
| 2402 | return t; pass | ||
| 2403 | def a(x, y, y): | ||
| 2404 | return t; pass | ||
| 2405 | def a(x, y, y): | ||
| 2406 | return t; pass | ||
| 2407 | def a(x, y, y): | ||
| 2408 | return t; pass | ||
| 2409 | def a(x, y, y): | ||
| 2410 | return t; pass | ||
| 2411 | def a(x, y, y): | ||
| 2412 | return t; pass | ||
| 2413 | def a(x, y, y): | ||
| 2414 | return t; pass | ||
| 2415 | def a(x, y, y): | ||
| 2416 | return t; pass | ||
| 2417 | def a(x, y, y): | ||
| 2418 | return t; pass | ||
| 2419 | def a(x, y, y): | ||
| 2420 | return t; pass | ||
| 2421 | def a(x, y, y): | ||
| 2422 | return t; pass | ||
| 2423 | def a(x, y, y): | ||
| 2424 | return t; pass | ||
| 2425 | def a(x, y, y): | ||
| 2426 | return t; pass | ||
| 2427 | def a(x, y, y): | ||
| 2428 | return t; pass | ||
| 2429 | def a(x, y, y): | ||
| 2430 | return t; pass | ||
| 2431 | def a(x, y, y): | ||
| 2432 | return t; pass | ||
| 2433 | def a(x, y, y): | ||
| 2434 | return t; pass | ||
| 2435 | def a(x, y, y): | ||
| 2436 | return t; pass | ||
| 2437 | def a(x, y, y): | ||
| 2438 | return t; pass | ||
| 2439 | def a(x, y, y): | ||
| 2440 | return t; pass | ||
| 2441 | def a(x, y, y): | ||
| 2442 | return t; pass | ||
| 2443 | def a(x, y, y): | ||
| 2444 | return t; pass | ||
| 2445 | def a(x, y, y): | ||
| 2446 | return t; pass | ||
| 2447 | def a(x, y, y): | ||
| 2448 | return t; pass | ||
| 2449 | def a(x, y, y): | ||
| 2450 | return t; pass | ||
| 2451 | def a(x, y, y): | ||
| 2452 | return t; pass | ||
| 2453 | def a(x, y, y): | ||
| 2454 | return t; pass | ||
| 2455 | def a(x, y, y): | ||
| 2456 | return t; pass | ||
| 2457 | def a(x, y, y): | ||
| 2458 | return t; pass | ||
| 2459 | def a(x, y, y): | ||
| 2460 | return t; pass | ||
| 2461 | def a(x, y, y): | ||
| 2462 | return t; pass | ||
| 2463 | def a(x, y, y): | ||
| 2464 | return t; pass | ||
| 2465 | def a(x, y, y): | ||
| 2466 | return t; pass | ||
| 2467 | def a(x, y, y): | ||
| 2468 | return t; pass | ||
| 2469 | def a(x, y, y): | ||
| 2470 | return t; pass | ||
| 2471 | def a(x, y, y): | ||
| 2472 | return t; pass | ||
| 2473 | def a(x, y, y): | ||
| 2474 | return t; pass | ||
| 2475 | def a(x, y, y): | ||
| 2476 | return t; pass | ||
| 2477 | def a(x, y, y): | ||
| 2478 | return t; pass | ||
| 2479 | def a(x, y, y): | ||
| 2480 | return t; pass | ||
diff --git a/test/manual/noverlay/overlay-perf.el b/test/manual/noverlay/overlay-perf.el new file mode 100644 index 00000000000..e84941c08f9 --- /dev/null +++ b/test/manual/noverlay/overlay-perf.el | |||
| @@ -0,0 +1,764 @@ | |||
| 1 | ;; -*- lexical-binding:t -*- | ||
| 2 | (require 'cl-lib) | ||
| 3 | (require 'subr-x) | ||
| 4 | (require 'seq) | ||
| 5 | (require 'hi-lock) | ||
| 6 | |||
| 7 | |||
| 8 | ;; +===================================================================================+ | ||
| 9 | ;; | Framework | ||
| 10 | ;; +===================================================================================+ | ||
| 11 | |||
| 12 | (defmacro perf-define-constant-test (name &optional doc &rest body) | ||
| 13 | (declare (indent 1) (debug (symbol &optional string &rest form))) | ||
| 14 | `(progn | ||
| 15 | (put ',name 'perf-constant-test t) | ||
| 16 | (defun ,name nil ,doc ,@body))) | ||
| 17 | |||
| 18 | (defmacro perf-define-variable-test (name args &optional doc &rest body) | ||
| 19 | (declare (indent 2) (debug defun)) | ||
| 20 | (unless (and (consp args) | ||
| 21 | (= (length args) 1)) | ||
| 22 | (error "Function %s should accept exactly one argument." name)) | ||
| 23 | `(progn | ||
| 24 | (put ',name 'perf-variable-test t) | ||
| 25 | (defun ,name ,args ,doc ,@body))) | ||
| 26 | |||
| 27 | (defmacro perf-define-test-suite (name &rest tests) | ||
| 28 | (declare (indent 1)) | ||
| 29 | `(put ',name 'perf-test-suite | ||
| 30 | ,(cons 'list tests))) | ||
| 31 | |||
| 32 | (defun perf-constant-test-p (test) | ||
| 33 | (get test 'perf-constant-test)) | ||
| 34 | |||
| 35 | (defun perf-variable-test-p (test) | ||
| 36 | (get test 'perf-variable-test)) | ||
| 37 | |||
| 38 | (defun perf-test-suite-p (suite) | ||
| 39 | (not (null (perf-test-suite-elements suite)))) | ||
| 40 | |||
| 41 | (defun perf-test-suite-elements (suite) | ||
| 42 | (get suite 'perf-test-suite)) | ||
| 43 | |||
| 44 | (defun perf-expand-suites (test-and-suites) | ||
| 45 | (apply #' append (mapcar (lambda (elt) | ||
| 46 | (if (perf-test-suite-p elt) | ||
| 47 | (perf-test-suite-elements elt) | ||
| 48 | (list elt))) | ||
| 49 | test-and-suites))) | ||
| 50 | (defun perf-test-p (symbol) | ||
| 51 | (or (perf-variable-test-p symbol) | ||
| 52 | (perf-constant-test-p symbol))) | ||
| 53 | |||
| 54 | (defun perf-all-tests () | ||
| 55 | (let (result) | ||
| 56 | (mapatoms (lambda (symbol) | ||
| 57 | (when (and (fboundp symbol) | ||
| 58 | (perf-test-p symbol)) | ||
| 59 | (push symbol result)))) | ||
| 60 | (sort result #'string-lessp))) | ||
| 61 | |||
| 62 | (defvar perf-default-test-argument 4096) | ||
| 63 | |||
| 64 | (defun perf-run-1 (&optional k n &rest tests) | ||
| 65 | "Run TESTS K times using N as argument for non-constant ones. | ||
| 66 | |||
| 67 | Return test-total elapsed time." | ||
| 68 | (random "") | ||
| 69 | (when (and n (not (numberp n))) | ||
| 70 | (push k tests) | ||
| 71 | (push n tests) | ||
| 72 | (setq n nil k nil)) | ||
| 73 | (when (and k (not (numberp k))) | ||
| 74 | (push k tests) | ||
| 75 | (setq k nil)) | ||
| 76 | (let* ((k (or k 1)) | ||
| 77 | (n (or n perf-default-test-argument)) | ||
| 78 | (tests (perf-expand-suites (or tests | ||
| 79 | (perf-all-tests)))) | ||
| 80 | (variable-tests (seq-filter #'perf-variable-test-p tests)) | ||
| 81 | (constant-tests (seq-filter #'perf-constant-test-p tests)) | ||
| 82 | (max-test-string-width (perf-max-symbol-length tests))) | ||
| 83 | (unless (seq-every-p #'perf-test-p tests) | ||
| 84 | (error "Some of these are not tests: %s" tests)) | ||
| 85 | (cl-labels ((format-result (result) | ||
| 86 | (cond | ||
| 87 | ((numberp result) (format "%.2f" result)) | ||
| 88 | ((stringp result) result) | ||
| 89 | ((null result) "N/A"))) | ||
| 90 | (format-test (fn) | ||
| 91 | (concat (symbol-name fn) | ||
| 92 | (make-string | ||
| 93 | (+ (- max-test-string-width | ||
| 94 | (length (symbol-name fn))) | ||
| 95 | 1) | ||
| 96 | ?\s))) | ||
| 97 | (format-summary (results _total) | ||
| 98 | (let ((min (apply #'min results)) | ||
| 99 | (max (apply #'max results)) | ||
| 100 | (avg (/ (apply #'+ results) (float (length results))))) | ||
| 101 | (format "n=%d min=%.2f avg=%.2f max=%.2f" (length results) min avg max))) | ||
| 102 | (run-test (fn) | ||
| 103 | (let ((total 0) results) | ||
| 104 | (dotimes (_ (max 0 k)) | ||
| 105 | (garbage-collect) | ||
| 106 | (princ (concat " " (format-test fn))) | ||
| 107 | (let ((result (condition-case-unless-debug err | ||
| 108 | (cond | ||
| 109 | ((perf-variable-test-p fn) | ||
| 110 | (random "") (car (funcall fn n))) | ||
| 111 | ((perf-constant-test-p fn) | ||
| 112 | (random "") (car (funcall fn))) | ||
| 113 | (t "skip")) | ||
| 114 | (error (error-message-string err))))) | ||
| 115 | (when (numberp result) | ||
| 116 | (cl-incf total result) | ||
| 117 | (push result results)) | ||
| 118 | (princ (format-result result)) | ||
| 119 | (terpri))) | ||
| 120 | (when (> (length results) 1) | ||
| 121 | (princ (concat "#" (format-test fn) | ||
| 122 | (format-summary results total))) | ||
| 123 | (terpri))))) | ||
| 124 | (when variable-tests | ||
| 125 | (terpri) | ||
| 126 | (dolist (fn variable-tests) | ||
| 127 | (run-test fn) | ||
| 128 | (terpri))) | ||
| 129 | (when constant-tests | ||
| 130 | (dolist (fn constant-tests) | ||
| 131 | (run-test fn) | ||
| 132 | (terpri)))))) | ||
| 133 | |||
| 134 | (defun perf-run (&optional k n &rest tests) | ||
| 135 | (interactive | ||
| 136 | (let* ((n (if current-prefix-arg | ||
| 137 | (prefix-numeric-value current-prefix-arg) | ||
| 138 | perf-default-test-argument)) | ||
| 139 | (tests (mapcar #'intern | ||
| 140 | (completing-read-multiple | ||
| 141 | (format "Run tests (n=%d): " n) | ||
| 142 | (perf-all-tests) nil t nil 'perf-test-history)))) | ||
| 143 | (cons 1 (cons n tests)))) | ||
| 144 | (with-current-buffer (get-buffer-create "*perf-results*") | ||
| 145 | (let ((inhibit-read-only t) | ||
| 146 | (standard-output (current-buffer))) | ||
| 147 | (erase-buffer) | ||
| 148 | (apply #'perf-run-1 k n tests) | ||
| 149 | (display-buffer (current-buffer))))) | ||
| 150 | |||
| 151 | |||
| 152 | (defun perf-batch-parse-command-line (args) | ||
| 153 | (let ((k 1) | ||
| 154 | (n perf-default-test-argument) | ||
| 155 | tests) | ||
| 156 | (while args | ||
| 157 | (cond ((string-match-p "\\`-[cn]\\'" (car args)) | ||
| 158 | (unless (and (cdr args) | ||
| 159 | (string-match-p "\\`[0-9]+\\'" (cadr args))) | ||
| 160 | (error "%s expectes a natnum argument" (car args))) | ||
| 161 | (if (equal (car args) "-c") | ||
| 162 | (setq k (string-to-number (cadr args))) | ||
| 163 | (setq n (string-to-number (cadr args)))) | ||
| 164 | (setq args (cddr args))) | ||
| 165 | (t (push (intern (pop args)) tests)))) | ||
| 166 | (list k n tests))) | ||
| 167 | |||
| 168 | |||
| 169 | (defun perf-run-batch () | ||
| 170 | "Runs tests from `command-line-args-left' and kill emacs." | ||
| 171 | (let ((standard-output #'external-debugging-output)) | ||
| 172 | (condition-case err | ||
| 173 | (cl-destructuring-bind (k n tests) | ||
| 174 | (perf-batch-parse-command-line command-line-args-left) | ||
| 175 | (apply #'perf-run-1 k n tests) | ||
| 176 | (save-buffers-kill-emacs)) | ||
| 177 | (error | ||
| 178 | (princ (error-message-string err)) | ||
| 179 | (save-buffers-kill-emacs))))) | ||
| 180 | |||
| 181 | (defconst perf-number-of-columns 70) | ||
| 182 | |||
| 183 | (defun perf-insert-lines (n) | ||
| 184 | "Insert N lines into the current buffer." | ||
| 185 | (dotimes (i n) | ||
| 186 | (insert (make-string 70 (if (= (% i 2) 0) | ||
| 187 | ?. | ||
| 188 | ?O)) | ||
| 189 | ?\n))) | ||
| 190 | |||
| 191 | (defun perf-switch-to-buffer-scroll-random (n &optional buffer) | ||
| 192 | (interactive) | ||
| 193 | (set-window-buffer nil (or buffer (current-buffer))) | ||
| 194 | (goto-char (point-min)) | ||
| 195 | (redisplay t) | ||
| 196 | (dotimes (_ n) | ||
| 197 | (goto-char (random (point-max))) | ||
| 198 | (recenter) | ||
| 199 | (redisplay t))) | ||
| 200 | |||
| 201 | (defun perf-insert-overlays (n &optional create-callback random-p) | ||
| 202 | (if random-p | ||
| 203 | (perf-insert-overlays-random n create-callback) | ||
| 204 | (perf-insert-overlays-sequential n create-callback))) | ||
| 205 | |||
| 206 | (defun perf-insert-overlays-sequential (n &optional create-callback) | ||
| 207 | "Insert an overlay every Nth line." | ||
| 208 | (declare (indent 1)) | ||
| 209 | (let ((i 0) | ||
| 210 | (create-callback (or create-callback #'ignore))) | ||
| 211 | (save-excursion | ||
| 212 | (goto-char (point-min)) | ||
| 213 | (while (not (eobp)) | ||
| 214 | (when (= 0 (% i n)) | ||
| 215 | (let ((ov (make-overlay (point-at-bol) (point-at-eol)))) | ||
| 216 | (funcall create-callback ov) | ||
| 217 | (overlay-put ov 'priority (random (buffer-size))))) | ||
| 218 | (cl-incf i) | ||
| 219 | (forward-line))))) | ||
| 220 | |||
| 221 | (defun perf-insert-overlays-random (n &optional create-callback) | ||
| 222 | "Insert an overlay every Nth line." | ||
| 223 | (declare (indent 1)) | ||
| 224 | (let ((create-callback (or create-callback #'ignore))) | ||
| 225 | (save-excursion | ||
| 226 | (while (>= (cl-decf n) 0) | ||
| 227 | (let* ((beg (1+ (random (point-max)))) | ||
| 228 | (ov (make-overlay beg (+ beg (random 70))))) | ||
| 229 | (funcall create-callback ov) | ||
| 230 | (overlay-put ov 'priority (random (buffer-size)))))))) | ||
| 231 | |||
| 232 | (defun perf-insert-overlays-hierarchical (n &optional create-callback) | ||
| 233 | (let ((create-callback (or create-callback #'ignore))) | ||
| 234 | (save-excursion | ||
| 235 | (goto-char (point-min)) | ||
| 236 | (let ((spacing (floor (/ (/ (count-lines (point-min) (point-max)) | ||
| 237 | (float 3)) | ||
| 238 | n)))) | ||
| 239 | (when (< spacing 1) | ||
| 240 | (error "Hierarchical overlay overflow !!")) | ||
| 241 | (dotimes (i n) | ||
| 242 | (funcall create-callback | ||
| 243 | (make-overlay (point) | ||
| 244 | (save-excursion | ||
| 245 | (goto-char (point-max)) | ||
| 246 | (forward-line (- (* spacing i))) | ||
| 247 | (point)))) | ||
| 248 | |||
| 249 | (when (eobp) | ||
| 250 | (error "End of buffer in hierarchical overlays")) | ||
| 251 | (forward-line spacing)))))) | ||
| 252 | |||
| 253 | (defun perf-overlay-ascii-chart (&optional buffer width) | ||
| 254 | (interactive) | ||
| 255 | (save-current-buffer | ||
| 256 | (when buffer (set-buffer buffer)) | ||
| 257 | (unless width (setq width 100)) | ||
| 258 | (let* ((ovl (sort (overlays-in (point-min) (point-max)) | ||
| 259 | (lambda (ov1 ov2) | ||
| 260 | (or (<= (overlay-start ov1) | ||
| 261 | (overlay-start ov2)) | ||
| 262 | (and | ||
| 263 | (= (overlay-start ov1) | ||
| 264 | (overlay-start ov2)) | ||
| 265 | (< (overlay-end ov1) | ||
| 266 | (overlay-end ov2))))))) | ||
| 267 | (ov-width (apply #'max (mapcar (lambda (ov) | ||
| 268 | (- (overlay-end ov) | ||
| 269 | (overlay-start ov))) | ||
| 270 | ovl))) | ||
| 271 | (ov-min (apply #'min (mapcar #'overlay-start ovl))) | ||
| 272 | (ov-max (apply #'max (mapcar #'overlay-end ovl))) | ||
| 273 | (scale (/ (float width) (+ ov-min ov-width)))) | ||
| 274 | (with-current-buffer (get-buffer-create "*overlay-ascii-chart*") | ||
| 275 | (let ((inhibit-read-only t)) | ||
| 276 | (erase-buffer) | ||
| 277 | (buffer-disable-undo) | ||
| 278 | (insert (format "%06d%s%06d\n" ov-min (make-string (- width 12) ?\s) ov-max)) | ||
| 279 | (dolist (ov ovl) | ||
| 280 | (let ((length (round (* scale (- (overlay-end ov) | ||
| 281 | (overlay-start ov)))))) | ||
| 282 | (insert (make-string (round (* scale (overlay-start ov))) ?\s)) | ||
| 283 | (cl-case length | ||
| 284 | (0 (insert "O")) | ||
| 285 | (1 (insert "|")) | ||
| 286 | (t (insert (format "|%s|" (make-string (- length 2) ?-))))) | ||
| 287 | (insert "\n"))) | ||
| 288 | (goto-char (point-min))) | ||
| 289 | (read-only-mode 1) | ||
| 290 | (pop-to-buffer (current-buffer)))))) | ||
| 291 | |||
| 292 | (defconst perf-overlay-faces (mapcar #'intern (seq-take hi-lock-face-defaults 3))) | ||
| 293 | |||
| 294 | (defun perf-overlay-face-callback (ov) | ||
| 295 | (overlay-put ov 'face (nth (random (length perf-overlay-faces)) | ||
| 296 | perf-overlay-faces))) | ||
| 297 | |||
| 298 | (defun perf-overlay-invisible-callback (ov) | ||
| 299 | (overlay-put ov 'invisble (= 1 (random 2)))) | ||
| 300 | |||
| 301 | (defun perf-overlay-display-callback (ov) | ||
| 302 | (overlay-put ov 'display (make-string 70 ?*))) | ||
| 303 | |||
| 304 | (defmacro perf-define-display-test (overlay-type property-type scroll-type) | ||
| 305 | (let ((name (intern (format "perf-display-%s/%s/%s" | ||
| 306 | overlay-type property-type scroll-type))) | ||
| 307 | (arg (make-symbol "n"))) | ||
| 308 | |||
| 309 | `(perf-define-variable-test ,name (,arg) | ||
| 310 | (with-temp-buffer | ||
| 311 | (perf-insert-lines ,arg) | ||
| 312 | (overlay-recenter (point-max)) | ||
| 313 | ,@(perf-define-display-test-1 arg overlay-type property-type scroll-type))))) | ||
| 314 | |||
| 315 | (defun perf-define-display-test-1 (arg overlay-type property-type scroll-type) | ||
| 316 | (list (append (cl-case overlay-type | ||
| 317 | (sequential | ||
| 318 | (list 'perf-insert-overlays-sequential 2)) | ||
| 319 | (hierarchical | ||
| 320 | `(perf-insert-overlays-hierarchical (/ ,arg 10))) | ||
| 321 | (random | ||
| 322 | `(perf-insert-overlays-random (/ ,arg 2))) | ||
| 323 | (t (error "Invalid insert type: %s" overlay-type))) | ||
| 324 | (list | ||
| 325 | (cl-case property-type | ||
| 326 | (display '#'perf-overlay-display-callback) | ||
| 327 | (face '#'perf-overlay-face-callback) | ||
| 328 | (invisible '#'perf-overlay-invisible-callback) | ||
| 329 | (t (error "Invalid overlay type: %s" overlay-type))))) | ||
| 330 | (list 'benchmark-run 1 | ||
| 331 | (cl-case scroll-type | ||
| 332 | (scroll '(perf-switch-to-buffer-scroll-up-and-down)) | ||
| 333 | (random `(perf-switch-to-buffer-scroll-random (/ ,arg 50))) | ||
| 334 | (t (error "Invalid scroll type: %s" overlay-type)))))) | ||
| 335 | |||
| 336 | (defun perf-max-symbol-length (symbols) | ||
| 337 | "Return the longest symbol in SYMBOLS, or -1 if symbols is nil." | ||
| 338 | (if (null symbols) | ||
| 339 | -1 | ||
| 340 | (apply #'max (mapcar | ||
| 341 | (lambda (elt) | ||
| 342 | (length (symbol-name elt))) | ||
| 343 | symbols)))) | ||
| 344 | |||
| 345 | (defun perf-insert-text (n) | ||
| 346 | "Insert N character into the current buffer." | ||
| 347 | (let ((ncols 68) | ||
| 348 | (char ?.)) | ||
| 349 | (dotimes (_ (/ n ncols)) | ||
| 350 | (insert (make-string (1- ncols) char) ?\n)) | ||
| 351 | (when (> (% n ncols) 0) | ||
| 352 | (insert (make-string (1- (% n ncols)) char) ?\n)))) | ||
| 353 | |||
| 354 | (defconst perf-insert-overlays-default-length 24) | ||
| 355 | |||
| 356 | (defun perf-insert-overlays-scattered (n &optional length) | ||
| 357 | "Insert N overlays of max length 24 randomly." | ||
| 358 | (dotimes (_ n) | ||
| 359 | (let ((begin (random (1+ (point-max))))) | ||
| 360 | (make-overlay | ||
| 361 | begin (+ begin (random (1+ (or length perf-insert-overlays-default-length 0)))))))) | ||
| 362 | |||
| 363 | (defvar perf-marker-gc-protection nil) | ||
| 364 | |||
| 365 | (defun perf-insert-marker-scattered (n) | ||
| 366 | "Insert N marker randomly." | ||
| 367 | (setq perf-marker-gc-protection nil) | ||
| 368 | (dotimes (_ n) | ||
| 369 | (push (copy-marker (random (1+ (point-max)))) | ||
| 370 | perf-marker-gc-protection))) | ||
| 371 | |||
| 372 | (defun perf-switch-to-buffer-scroll-up-and-down (&optional buffer) | ||
| 373 | (interactive) | ||
| 374 | (set-window-buffer nil (or buffer (current-buffer))) | ||
| 375 | (goto-char (point-min)) | ||
| 376 | (redisplay t) | ||
| 377 | (while (condition-case nil | ||
| 378 | (progn (scroll-up) t) | ||
| 379 | (end-of-buffer nil)) | ||
| 380 | (redisplay t)) | ||
| 381 | (while (condition-case nil | ||
| 382 | (progn (scroll-down) t) | ||
| 383 | (beginning-of-buffer nil)) | ||
| 384 | (redisplay t))) | ||
| 385 | |||
| 386 | (defun perf-emacs-lisp-setup () | ||
| 387 | (add-to-list 'imenu-generic-expression | ||
| 388 | '(nil "^\\s-*(perf-define\\(?:\\w\\|\\s_\\)*\\s-*\\(\\(?:\\w\\|\\s_\\)+\\)" 1))) | ||
| 389 | |||
| 390 | (add-hook 'emacs-lisp-mode 'perf-emacs-lisp-setup) | ||
| 391 | |||
| 392 | |||
| 393 | ;; +===================================================================================+ | ||
| 394 | ;; | Basic performance tests | ||
| 395 | ;; +===================================================================================+ | ||
| 396 | |||
| 397 | (perf-define-variable-test perf-make-overlay (n) | ||
| 398 | (with-temp-buffer | ||
| 399 | (overlay-recenter (point-min)) | ||
| 400 | (benchmark-run 1 | ||
| 401 | (dotimes (_ n) | ||
| 402 | (make-overlay 1 1))))) | ||
| 403 | |||
| 404 | (perf-define-variable-test perf-make-overlay-continuous (n) | ||
| 405 | (with-temp-buffer | ||
| 406 | (perf-insert-text n) | ||
| 407 | (overlay-recenter (point-max)) | ||
| 408 | (benchmark-run 1 | ||
| 409 | (dotimes (i n) | ||
| 410 | (make-overlay i (1+ i)))))) | ||
| 411 | |||
| 412 | (perf-define-variable-test perf-make-overlay-scatter (n) | ||
| 413 | (with-temp-buffer | ||
| 414 | (perf-insert-text n) | ||
| 415 | (benchmark-run 1 | ||
| 416 | (perf-insert-overlays-scattered n)))) | ||
| 417 | |||
| 418 | (perf-define-variable-test perf-delete-overlay (n) | ||
| 419 | (with-temp-buffer | ||
| 420 | (let ((ovls (cl-loop for i from 1 to n | ||
| 421 | collect (make-overlay 1 1)))) | ||
| 422 | (overlay-recenter (point-min)) | ||
| 423 | (benchmark-run 1 | ||
| 424 | (mapc #'delete-overlay ovls))))) | ||
| 425 | |||
| 426 | (perf-define-variable-test perf-delete-overlay-continuous (n) | ||
| 427 | (with-temp-buffer | ||
| 428 | (perf-insert-text n) | ||
| 429 | (let ((ovls (cl-loop for i from 1 to n | ||
| 430 | collect (make-overlay i (1+ i))))) | ||
| 431 | (overlay-recenter (point-min)) | ||
| 432 | (benchmark-run 1 | ||
| 433 | (mapc #'delete-overlay ovls))))) | ||
| 434 | |||
| 435 | (perf-define-variable-test perf-delete-overlay-scatter (n) | ||
| 436 | (with-temp-buffer | ||
| 437 | (perf-insert-text n) | ||
| 438 | (let ((ovls (progn (perf-insert-overlays-scattered n) | ||
| 439 | (overlays-in (point-min) (point-max))))) | ||
| 440 | (benchmark-run 1 | ||
| 441 | (mapc #'delete-overlay ovls))))) | ||
| 442 | |||
| 443 | (perf-define-variable-test perf-overlays-at (n) | ||
| 444 | (with-temp-buffer | ||
| 445 | (perf-insert-text n) | ||
| 446 | (perf-insert-overlays-scattered n) | ||
| 447 | (benchmark-run 1 | ||
| 448 | (dotimes (i (point-max)) | ||
| 449 | (overlays-at i))))) | ||
| 450 | |||
| 451 | (perf-define-variable-test perf-overlays-in (n) | ||
| 452 | (with-temp-buffer | ||
| 453 | (perf-insert-text n) | ||
| 454 | (perf-insert-overlays-scattered n) | ||
| 455 | (let ((len perf-insert-overlays-default-length)) | ||
| 456 | (benchmark-run 1 | ||
| 457 | (dotimes (i (- (point-max) len)) | ||
| 458 | (overlays-in i (+ i len))))))) | ||
| 459 | |||
| 460 | (perf-define-variable-test perf-insert-before (n) | ||
| 461 | (with-temp-buffer | ||
| 462 | (perf-insert-text n) | ||
| 463 | (perf-insert-overlays-scattered n) | ||
| 464 | (goto-char 1) | ||
| 465 | (overlay-recenter (point-min)) | ||
| 466 | (benchmark-run 1 | ||
| 467 | (dotimes (_ (/ n 2)) | ||
| 468 | (insert ?X))))) | ||
| 469 | |||
| 470 | (perf-define-variable-test perf-insert-before-empty (n) | ||
| 471 | (let ((perf-insert-overlays-default-length 0)) | ||
| 472 | (perf-insert-before n))) | ||
| 473 | (perf-define-variable-test perf-insert-after-empty (n) | ||
| 474 | (let ((perf-insert-overlays-default-length 0)) | ||
| 475 | (perf-insert-after n))) | ||
| 476 | (perf-define-variable-test perf-insert-scatter-empty (n) | ||
| 477 | (let ((perf-insert-overlays-default-length 0)) | ||
| 478 | (perf-insert-scatter n))) | ||
| 479 | (perf-define-variable-test perf-delete-before-empty (n) | ||
| 480 | (let ((perf-insert-overlays-default-length 0)) | ||
| 481 | (perf-delete-before n))) | ||
| 482 | (perf-define-variable-test perf-delete-after-empty (n) | ||
| 483 | (let ((perf-insert-overlays-default-length 0)) | ||
| 484 | (perf-delete-after n))) | ||
| 485 | (perf-define-variable-test perf-delete-scatter-empty (n) | ||
| 486 | (let ((perf-insert-overlays-default-length 0)) | ||
| 487 | (perf-delete-scatter n))) | ||
| 488 | |||
| 489 | (defmacro perf-define-marker-test (type where) | ||
| 490 | (let ((name (intern (format "perf-%s-%s-marker" type where)))) | ||
| 491 | `(perf-define-variable-test ,name (n) | ||
| 492 | (with-temp-buffer | ||
| 493 | (perf-insert-text n) | ||
| 494 | (perf-insert-marker-scattered n) | ||
| 495 | (goto-char ,(cl-case where | ||
| 496 | (after (list 'point-max)) | ||
| 497 | (t (list 'point-min)))) | ||
| 498 | (benchmark-run 1 | ||
| 499 | (dotimes (_ (/ n 2)) | ||
| 500 | ,@(when (eq where 'scatter) | ||
| 501 | (list '(goto-char (max 1 (random (point-max)))))) | ||
| 502 | ,(cl-case type | ||
| 503 | (insert (list 'insert ?X)) | ||
| 504 | (delete (list 'delete-char (if (eq where 'after) -1 1)))))))))) | ||
| 505 | |||
| 506 | (perf-define-test-suite perf-marker-suite | ||
| 507 | (perf-define-marker-test insert before) | ||
| 508 | (perf-define-marker-test insert after) | ||
| 509 | (perf-define-marker-test insert scatter) | ||
| 510 | (perf-define-marker-test delete before) | ||
| 511 | (perf-define-marker-test delete after) | ||
| 512 | (perf-define-marker-test delete scatter)) | ||
| 513 | |||
| 514 | (perf-define-variable-test perf-insert-after (n) | ||
| 515 | (with-temp-buffer | ||
| 516 | (perf-insert-text n) | ||
| 517 | (perf-insert-overlays-scattered n) | ||
| 518 | (goto-char (point-max)) | ||
| 519 | (overlay-recenter (point-max)) | ||
| 520 | (benchmark-run 1 | ||
| 521 | (dotimes (_ (/ n 2)) | ||
| 522 | (insert ?X))))) | ||
| 523 | |||
| 524 | (perf-define-variable-test perf-insert-scatter (n) | ||
| 525 | (with-temp-buffer | ||
| 526 | (perf-insert-text n) | ||
| 527 | (perf-insert-overlays-scattered n) | ||
| 528 | (goto-char (point-max)) | ||
| 529 | (benchmark-run 1 | ||
| 530 | (dotimes (_ (/ n 2)) | ||
| 531 | (goto-char (1+ (random (point-max)))) | ||
| 532 | (insert ?X))))) | ||
| 533 | |||
| 534 | (perf-define-variable-test perf-delete-before (n) | ||
| 535 | (with-temp-buffer | ||
| 536 | (perf-insert-text n) | ||
| 537 | (perf-insert-overlays-scattered n) | ||
| 538 | (goto-char 1) | ||
| 539 | (overlay-recenter (point-min)) | ||
| 540 | (benchmark-run 1 | ||
| 541 | (dotimes (_ (/ n 2)) | ||
| 542 | (delete-char 1))))) | ||
| 543 | |||
| 544 | (perf-define-variable-test perf-delete-after (n) | ||
| 545 | (with-temp-buffer | ||
| 546 | (perf-insert-text n) | ||
| 547 | (perf-insert-overlays-scattered n) | ||
| 548 | (goto-char (point-max)) | ||
| 549 | (overlay-recenter (point-max)) | ||
| 550 | (benchmark-run 1 | ||
| 551 | (dotimes (_ (/ n 2)) | ||
| 552 | (delete-char -1))))) | ||
| 553 | |||
| 554 | (perf-define-variable-test perf-delete-scatter (n) | ||
| 555 | (with-temp-buffer | ||
| 556 | (perf-insert-text n) | ||
| 557 | (perf-insert-overlays-scattered n) | ||
| 558 | (goto-char (point-max)) | ||
| 559 | (benchmark-run 1 | ||
| 560 | (dotimes (_ (/ n 2)) | ||
| 561 | (goto-char (max 1 (random (point-max)))) | ||
| 562 | (delete-char 1))))) | ||
| 563 | |||
| 564 | (perf-define-test-suite perf-insert-delete-suite | ||
| 565 | 'perf-insert-before | ||
| 566 | 'perf-insert-after | ||
| 567 | 'perf-insert-scatter | ||
| 568 | 'perf-delete-before | ||
| 569 | 'perf-delete-after | ||
| 570 | 'perf-delete-scatter | ||
| 571 | ) | ||
| 572 | |||
| 573 | |||
| 574 | ;; +===================================================================================+ | ||
| 575 | ;; | Redisplay (new) | ||
| 576 | ;; +===================================================================================+ | ||
| 577 | |||
| 578 | ;; 5000 | ||
| 579 | ;; 25000 | ||
| 580 | ;; 75000 | ||
| 581 | |||
| 582 | ;; Number of Overlays = N / 2 | ||
| 583 | ;; | ||
| 584 | ;; (except for the hierarchical case, where it is divided by 10.) | ||
| 585 | |||
| 586 | ;; . scrolling through a buffer with lots of overlays that affect faces | ||
| 587 | ;; of characters in the buffer text | ||
| 588 | ;; . scrolling through a buffer with lots of overlays that define | ||
| 589 | ;; 'display' properties which are strings | ||
| 590 | ;; . scrolling through a buffer with lots of overlays that define | ||
| 591 | ;; 'invisible' properties | ||
| 592 | |||
| 593 | (perf-define-test-suite perf-display-suite | ||
| 594 | (perf-define-display-test sequential display scroll) | ||
| 595 | (perf-define-display-test sequential display random) | ||
| 596 | (perf-define-display-test sequential face scroll) | ||
| 597 | (perf-define-display-test sequential face random) | ||
| 598 | (perf-define-display-test sequential invisible scroll) | ||
| 599 | (perf-define-display-test sequential invisible random) | ||
| 600 | (perf-define-display-test random display scroll) | ||
| 601 | (perf-define-display-test random display random) | ||
| 602 | (perf-define-display-test random face scroll) | ||
| 603 | (perf-define-display-test random face random) | ||
| 604 | (perf-define-display-test random invisible scroll) | ||
| 605 | (perf-define-display-test random invisible random)) | ||
| 606 | |||
| 607 | ;; |------------| | ||
| 608 | ;; |--------| | ||
| 609 | ;; |----| | ||
| 610 | (perf-define-display-test hierarchical face scroll) | ||
| 611 | |||
| 612 | |||
| 613 | |||
| 614 | |||
| 615 | ;; +===================================================================================+ | ||
| 616 | ;; | Real World | ||
| 617 | ;; +===================================================================================+ | ||
| 618 | |||
| 619 | (require 'python) | ||
| 620 | |||
| 621 | (defconst perf-many-errors-file | ||
| 622 | (expand-file-name "many-errors.py" | ||
| 623 | (and load-file-name (file-name-directory load-file-name)))) | ||
| 624 | |||
| 625 | (perf-define-constant-test perf-realworld-flycheck | ||
| 626 | (interactive) | ||
| 627 | (package-initialize) | ||
| 628 | (when (and (require 'flycheck nil t) | ||
| 629 | (file-exists-p perf-many-errors-file) | ||
| 630 | (or (executable-find "pylint") | ||
| 631 | (executable-find "flake8"))) | ||
| 632 | (setq flycheck-python-pylint-executable | ||
| 633 | (executable-find "pylint")) | ||
| 634 | (setq flycheck-python-flake8-executable | ||
| 635 | (executable-find "flake8")) | ||
| 636 | (setq python-indent-guess-indent-offset-verbose nil) | ||
| 637 | (setq flycheck-check-syntax-automatically nil) | ||
| 638 | (setq flycheck-checker-error-threshold nil) | ||
| 639 | (setq flycheck-display-errors-function nil) | ||
| 640 | (with-current-buffer (find-file-noselect perf-many-errors-file) | ||
| 641 | (let* ((done) | ||
| 642 | (flycheck-after-syntax-check-hook | ||
| 643 | (list (lambda () (setq done t))))) | ||
| 644 | (flycheck-mode 1) | ||
| 645 | (flycheck-buffer) | ||
| 646 | (benchmark-run 1 | ||
| 647 | (while (not done) | ||
| 648 | (accept-process-output)) | ||
| 649 | (perf-switch-to-buffer-scroll-up-and-down) | ||
| 650 | (flycheck-mode -1)))))) | ||
| 651 | |||
| 652 | ;; https://lists.gnu.org/archive/html/emacs-devel/2009-04/msg00242.html | ||
| 653 | (defun make-lines-invisible (regexp &optional arg) | ||
| 654 | "Make all lines matching a regexp invisible and intangible. | ||
| 655 | With a prefix arg, make it visible again. It is not necessary | ||
| 656 | that REGEXP matches the whole line; if a hit is found, the | ||
| 657 | affected line gets automatically selected. | ||
| 658 | |||
| 659 | This command affects the whole buffer." | ||
| 660 | (interactive "MRegexp: \nP") | ||
| 661 | (let (ov | ||
| 662 | ovs | ||
| 663 | count) | ||
| 664 | (cond | ||
| 665 | ((equal arg '(4)) | ||
| 666 | (setq ovs (overlays-in (point-min) (point-max))) | ||
| 667 | (mapc (lambda (o) | ||
| 668 | (if (overlay-get o 'make-lines-invisible) | ||
| 669 | (delete-overlay o))) | ||
| 670 | ovs)) | ||
| 671 | (t | ||
| 672 | (save-excursion | ||
| 673 | (goto-char (point-min)) | ||
| 674 | (setq count 0) | ||
| 675 | (while (re-search-forward regexp nil t) | ||
| 676 | (setq count (1+ count)) | ||
| 677 | (if (= (% count 100) 0) | ||
| 678 | (message "%d" count)) | ||
| 679 | (setq ov (make-overlay (line-beginning-position) | ||
| 680 | (1+ (line-end-position)))) | ||
| 681 | (overlay-put ov 'make-lines-invisible t) | ||
| 682 | (overlay-put ov 'invisible t) | ||
| 683 | (overlay-put ov 'intangible t) | ||
| 684 | (goto-char (line-end-position)))))))) | ||
| 685 | |||
| 686 | (perf-define-constant-test perf-realworld-make-lines-invisible | ||
| 687 | (with-temp-buffer | ||
| 688 | (insert-file-contents "/usr/share/dict/words") | ||
| 689 | (set-window-buffer nil (current-buffer)) | ||
| 690 | (redisplay t) | ||
| 691 | (overlay-recenter (point-max)) | ||
| 692 | (benchmark-run 1 | ||
| 693 | (make-lines-invisible "a")))) | ||
| 694 | |||
| 695 | (perf-define-constant-test perf-realworld-line-numbering | ||
| 696 | (interactive) | ||
| 697 | (with-temp-buffer | ||
| 698 | (insert-file-contents "/usr/share/dict/words") | ||
| 699 | (overlay-recenter (point-max)) | ||
| 700 | (goto-char (point-min)) | ||
| 701 | (let* ((nlines (count-lines (point-min) (point-max))) | ||
| 702 | (line 1) | ||
| 703 | (width 0)) | ||
| 704 | (dotimes (i nlines) ;;-with-progress-reporter "Creating overlays" | ||
| 705 | (let ((ov (make-overlay (point) (point))) | ||
| 706 | (str (propertize (format "%04d" line) 'face 'shadow))) | ||
| 707 | (overlay-put ov 'before-string | ||
| 708 | (propertize " " 'display `((margin left-margin) ,str))) | ||
| 709 | (setq width (max width (length str))) | ||
| 710 | (cl-incf line) | ||
| 711 | (forward-line))) | ||
| 712 | (benchmark-run 1 | ||
| 713 | (let ((left-margin-width width)) | ||
| 714 | (perf-switch-to-buffer-scroll-up-and-down)))))) | ||
| 715 | |||
| 716 | (perf-define-test-suite perf-realworld-suite | ||
| 717 | 'perf-realworld-flycheck | ||
| 718 | 'perf-realworld-make-lines-invisible | ||
| 719 | 'perf-realworld-line-numbering) | ||
| 720 | |||
| 721 | |||
| 722 | ;; +===================================================================================+ | ||
| 723 | ;; | next-overlay-change | ||
| 724 | ;; +===================================================================================+ | ||
| 725 | |||
| 726 | (perf-define-variable-test perf-noc-hierarchical/forward/linear (n) | ||
| 727 | "Search linear for the next change on every line." | ||
| 728 | (with-temp-buffer | ||
| 729 | (perf-insert-lines (* 3 n)) | ||
| 730 | (perf-insert-overlays-hierarchical n) | ||
| 731 | (goto-char (point-min)) | ||
| 732 | (benchmark-run 1 | ||
| 733 | (while (not (eobp)) | ||
| 734 | (next-overlay-change (point)) | ||
| 735 | (forward-line))))) | ||
| 736 | |||
| 737 | (perf-define-variable-test perf-noc-sequential/forward/linear (n) | ||
| 738 | "Search linear for the next change on every line." | ||
| 739 | (with-temp-buffer | ||
| 740 | (perf-insert-lines (* 3 n)) | ||
| 741 | (perf-insert-overlays-sequential n) | ||
| 742 | (goto-char (point-min)) | ||
| 743 | (benchmark-run 1 | ||
| 744 | (while (not (eobp)) | ||
| 745 | (next-overlay-change (point)) | ||
| 746 | (forward-line))))) | ||
| 747 | |||
| 748 | (perf-define-variable-test perf-noc-hierarchical/forward/backnforth (n) | ||
| 749 | "Search back and forth for the next change from `point-min' to `point-max'." | ||
| 750 | (with-temp-buffer | ||
| 751 | (perf-insert-lines (* 3 n)) | ||
| 752 | (overlay-recenter (point-max)) | ||
| 753 | (perf-insert-overlays-hierarchical n) | ||
| 754 | (goto-char (point-min)) | ||
| 755 | (benchmark-run 1 | ||
| 756 | (while (not (eobp)) | ||
| 757 | (next-overlay-change (point)) | ||
| 758 | (next-overlay-change (+ (point) 2)) | ||
| 759 | (forward-char))))) | ||
| 760 | |||
| 761 | (perf-define-test-suite perf-noc-suite | ||
| 762 | 'perf-noc-hierarchical/forward/linear | ||
| 763 | 'perf-noc-hierarchical/forward/backnforth | ||
| 764 | 'perf-noc-hierarchical/forward/backnforth) | ||
diff --git a/test/src/buffer-tests.el b/test/src/buffer-tests.el index 834acaf66f5..71f8705c6fd 100644 --- a/test/src/buffer-tests.el +++ b/test/src/buffer-tests.el | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | ;;; Code: | 20 | ;;; Code: |
| 21 | 21 | ||
| 22 | (require 'ert) | 22 | (require 'ert) |
| 23 | (require 'seq) | ||
| 23 | 24 | ||
| 24 | (ert-deftest overlay-modification-hooks-message-other-buf () | 25 | (ert-deftest overlay-modification-hooks-message-other-buf () |
| 25 | "Test for bug#21824. | 26 | "Test for bug#21824. |
| @@ -50,4 +51,7522 @@ with parameters from the *Messages* buffer modification." | |||
| 50 | (progn (get-buffer-create "nil") | 51 | (progn (get-buffer-create "nil") |
| 51 | (generate-new-buffer-name "nil"))))) | 52 | (generate-new-buffer-name "nil"))))) |
| 52 | 53 | ||
| 54 | |||
| 55 | ;; +===================================================================================+ | ||
| 56 | ;; | Overlay test setup | ||
| 57 | ;; +===================================================================================+ | ||
| 58 | |||
| 59 | (eval-when-compile | ||
| 60 | (defun make-overlay-test-name (fn x y) | ||
| 61 | (intern (format "test-%s-%s-%s" fn x y)))) | ||
| 62 | |||
| 63 | (defun unmake-ov-test-name (symbol) | ||
| 64 | (let ((name (if (stringp symbol) symbol (symbol-name symbol)))) | ||
| 65 | (when (string-match "\\`test-\\(.*\\)-\\(.*\\)-\\(.*\\)\\'" name) | ||
| 66 | (list (match-string 1 name) (match-string 2 name) (match-string 3 name))))) | ||
| 67 | |||
| 68 | (defmacro deftest-make-overlay-1 (id args) | ||
| 69 | (declare (indent 1)) | ||
| 70 | `(ert-deftest ,(make-overlay-test-name 'make-overlay 1 id) () | ||
| 71 | (with-temp-buffer | ||
| 72 | (should ,(cons 'make-overlay args))))) | ||
| 73 | |||
| 74 | (defmacro deftest-make-overlay-2 (id args condition) | ||
| 75 | (declare (indent 1)) | ||
| 76 | `(ert-deftest ,(make-overlay-test-name 'make-overlay 2 id) () | ||
| 77 | (with-temp-buffer | ||
| 78 | (should-error | ||
| 79 | ,(cons 'make-overlay args) | ||
| 80 | :type ',condition | ||
| 81 | :exclude-subtypes t)))) | ||
| 82 | |||
| 83 | (defmacro deftest-overlay-start/end-1 (id start-end-args start-end-should) | ||
| 84 | (declare (indent 1)) | ||
| 85 | (cl-destructuring-bind (start end sstart send) | ||
| 86 | (append start-end-args start-end-should) | ||
| 87 | `(ert-deftest ,(make-overlay-test-name 'overlay-start/end 1 id) () | ||
| 88 | (with-temp-buffer | ||
| 89 | (insert (make-string 9 ?\n)) | ||
| 90 | (let ((ov (make-overlay ,start ,end))) | ||
| 91 | (should (equal ,sstart (overlay-start ov))) | ||
| 92 | (should (equal ,send (overlay-end ov)))))))) | ||
| 93 | |||
| 94 | (defmacro deftest-overlay-buffer-1 (id arg-expr should-expr) | ||
| 95 | (declare (indent 1)) | ||
| 96 | `(ert-deftest ,(make-overlay-test-name 'overlay-buffer 1 id) () | ||
| 97 | (with-temp-buffer | ||
| 98 | (should (equal (overlay-buffer (make-overlay 1 1 ,arg-expr)) | ||
| 99 | ,should-expr))))) | ||
| 100 | |||
| 101 | (defmacro deftest-overlayp-1 (id arg-expr should-expr) | ||
| 102 | (declare (indent 1)) | ||
| 103 | `(ert-deftest ,(make-overlay-test-name 'overlay-buffer 1 id) () | ||
| 104 | (with-temp-buffer | ||
| 105 | (should (equal ,should-expr (overlayp ,arg-expr)))))) | ||
| 106 | |||
| 107 | (defmacro deftest-next-overlay-change-1 (id pos result &rest ov-tuple) | ||
| 108 | `(ert-deftest ,(make-overlay-test-name 'next-overlay-change 1 id) () | ||
| 109 | (let ((tuple (copy-sequence ',ov-tuple))) | ||
| 110 | (with-temp-buffer | ||
| 111 | (insert (make-string (max 100 (if tuple | ||
| 112 | (apply #'max | ||
| 113 | (mapcar | ||
| 114 | (lambda (m) (apply #'max m)) tuple)) | ||
| 115 | 0)) | ||
| 116 | ?\n)) | ||
| 117 | (dolist (tup tuple) | ||
| 118 | (make-overlay (car tup) (cadr tup))) | ||
| 119 | (should (equal (next-overlay-change ,pos) | ||
| 120 | ,result)))))) | ||
| 121 | |||
| 122 | (defmacro deftest-previous-overlay-change-1 (id pos result &rest ov-tuple) | ||
| 123 | `(ert-deftest ,(make-overlay-test-name 'previous-overlay-change 1 id) () | ||
| 124 | (let ((tuple ',ov-tuple)) | ||
| 125 | (with-temp-buffer | ||
| 126 | (insert (make-string (max 100 (if tuple | ||
| 127 | (apply #'max | ||
| 128 | (mapcar | ||
| 129 | (lambda (m) (apply #'max m)) tuple)) | ||
| 130 | 0)) | ||
| 131 | ?\n)) | ||
| 132 | (dolist (tup tuple) | ||
| 133 | (make-overlay (car tup) (cadr tup))) | ||
| 134 | (should (equal (previous-overlay-change ,pos) | ||
| 135 | ,result)))))) | ||
| 136 | |||
| 137 | (defmacro deftest-overlays-at-1 (id pos result &rest ov-triple) | ||
| 138 | `(ert-deftest ,(make-overlay-test-name 'overlays-at 1 id) () | ||
| 139 | (let ((pos* ,pos)) | ||
| 140 | (with-temp-buffer | ||
| 141 | (insert (make-string 100 ?\s)) | ||
| 142 | (should-not (memq nil ',result)) | ||
| 143 | (dolist (v ',ov-triple) | ||
| 144 | (cl-destructuring-bind (tag start end) | ||
| 145 | v | ||
| 146 | (overlay-put (make-overlay start end) 'tag tag))) | ||
| 147 | (let ((ovl (overlays-at pos*))) | ||
| 148 | (should (equal (length ovl) (length ',result))) | ||
| 149 | (dolist (ov ovl) | ||
| 150 | (should (memq (overlay-get ov 'tag) ',result)))))))) | ||
| 151 | |||
| 152 | (defmacro deftest-overlays-in-1 (id beg end result &rest ov-triple) | ||
| 153 | `(ert-deftest ,(make-overlay-test-name 'overlays-in 1 id) () | ||
| 154 | (let ((beg* ,beg) | ||
| 155 | (end* ,end)) | ||
| 156 | (with-temp-buffer | ||
| 157 | (insert (make-string 100 ?\s)) | ||
| 158 | (should-not (memq nil ',result)) | ||
| 159 | (dolist (v ',ov-triple) | ||
| 160 | (cl-destructuring-bind (tag start end) | ||
| 161 | v | ||
| 162 | (overlay-put (make-overlay start end) 'tag tag))) | ||
| 163 | (let ((ovl (overlays-in beg* end*))) | ||
| 164 | (should (equal (length ovl) (length ',result))) | ||
| 165 | (dolist (ov ovl) | ||
| 166 | (should (memq (overlay-get ov 'tag) ',result)))))))) | ||
| 167 | |||
| 168 | (defmacro test-with-overlay-in-buffer (symbol-beg-end-fa-ra &rest body) | ||
| 169 | (declare (indent 1)) | ||
| 170 | (cl-destructuring-bind (symbol beg end &optional fa ra) | ||
| 171 | symbol-beg-end-fa-ra | ||
| 172 | `(with-temp-buffer | ||
| 173 | (insert (make-string (max 1000 (1- ,end)) ?\s)) | ||
| 174 | (goto-char 1) | ||
| 175 | (let ((,symbol (make-overlay ,beg ,end nil ,fa ,ra))) | ||
| 176 | ,@body)))) | ||
| 177 | |||
| 178 | (defmacro deftest-overlays-equal-1 (id result ov1-args ov2-args) | ||
| 179 | `(ert-deftest ,(make-overlay-test-name 'overlays-equal 1 id) () | ||
| 180 | (cl-labels ((create-overlay (args) | ||
| 181 | (cl-destructuring-bind (start end &optional fa ra &rest properties) | ||
| 182 | args | ||
| 183 | (let ((ov (make-overlay start end nil fa ra))) | ||
| 184 | (while properties | ||
| 185 | (overlay-put ov (pop properties) (pop properties))) | ||
| 186 | ov)))) | ||
| 187 | (with-temp-buffer | ||
| 188 | (insert (make-string 1024 ?\s)) | ||
| 189 | (should (,(if result 'identity 'not) | ||
| 190 | (equal (create-overlay ',ov1-args) | ||
| 191 | (create-overlay ',ov2-args)))))))) | ||
| 192 | |||
| 193 | |||
| 194 | (defun find-ert-overlay-test (name) | ||
| 195 | (let ((test (unmake-ov-test-name name))) | ||
| 196 | (or (and test | ||
| 197 | (cl-destructuring-bind (fn x y) | ||
| 198 | test | ||
| 199 | (let ((regexp (format "deftest-%s-%s +%s" fn x y))) | ||
| 200 | (re-search-forward regexp nil t)))) | ||
| 201 | (let ((find-function-regexp-alist | ||
| 202 | (cl-remove 'find-ert-overlay-test find-function-regexp-alist :key #'cdr))) | ||
| 203 | (find-function-do-it name 'ert-deftest 'switch-to-buffer-other-window))))) | ||
| 204 | |||
| 205 | (add-to-list 'find-function-regexp-alist | ||
| 206 | '(ert-deftest . find-ert-overlay-test)) | ||
| 207 | |||
| 208 | |||
| 209 | ;; +===================================================================================+ | ||
| 210 | ;; | make-overlay | ||
| 211 | ;; +===================================================================================+ | ||
| 212 | |||
| 213 | ;; Test if making an overlay succeeds. | ||
| 214 | (deftest-make-overlay-1 A (1 1)) | ||
| 215 | (deftest-make-overlay-1 B (7 26)) | ||
| 216 | (deftest-make-overlay-1 C (29 7)) | ||
| 217 | (deftest-make-overlay-1 D (most-positive-fixnum 1)) | ||
| 218 | (deftest-make-overlay-1 E (most-negative-fixnum 1)) | ||
| 219 | (deftest-make-overlay-1 F (1 most-positive-fixnum)) | ||
| 220 | (deftest-make-overlay-1 G (1 most-negative-fixnum)) | ||
| 221 | (deftest-make-overlay-1 H (1 1 nil t)) | ||
| 222 | (deftest-make-overlay-1 I (1 1 nil nil)) | ||
| 223 | (deftest-make-overlay-1 J (1 1 nil nil nil)) | ||
| 224 | (deftest-make-overlay-1 K (1 1 nil nil t)) | ||
| 225 | (deftest-make-overlay-1 L (1 1 nil t t)) | ||
| 226 | (deftest-make-overlay-1 M (1 1 nil "yes" "yes")) | ||
| 227 | |||
| 228 | ;; Test if trying to make an overlay signals conditions. | ||
| 229 | (deftest-make-overlay-2 A () wrong-number-of-arguments) | ||
| 230 | (deftest-make-overlay-2 B (1) wrong-number-of-arguments) | ||
| 231 | (deftest-make-overlay-2 C (1 2 3 4 5 6) wrong-number-of-arguments) | ||
| 232 | (deftest-make-overlay-2 D ("1") wrong-number-of-arguments) | ||
| 233 | (deftest-make-overlay-2 E ("1" "2") wrong-type-argument) | ||
| 234 | (deftest-make-overlay-2 F (1 2 "b") wrong-type-argument) | ||
| 235 | (deftest-make-overlay-2 G (1 2 3.14) wrong-type-argument) | ||
| 236 | (deftest-make-overlay-2 H (3.14 3) wrong-type-argument) | ||
| 237 | (deftest-make-overlay-2 I (1 [1]) wrong-type-argument) | ||
| 238 | (deftest-make-overlay-2 J (1 1 (with-temp-buffer | ||
| 239 | (current-buffer))) | ||
| 240 | error) | ||
| 241 | |||
| 242 | |||
| 243 | ;; +===================================================================================+ | ||
| 244 | ;; | overlay-start/end | ||
| 245 | ;; +===================================================================================+ | ||
| 246 | |||
| 247 | ;; Test if the overlays return proper positions. point-max of the | ||
| 248 | ;; buffer will equal 10. ARG RESULT | ||
| 249 | (deftest-overlay-start/end-1 A (1 1) (1 1)) | ||
| 250 | (deftest-overlay-start/end-1 B (2 7) (2 7)) | ||
| 251 | (deftest-overlay-start/end-1 C (7 2) (2 7)) | ||
| 252 | (deftest-overlay-start/end-1 D (1 10) (1 10)) | ||
| 253 | (deftest-overlay-start/end-1 E (1 11) (1 10)) | ||
| 254 | (deftest-overlay-start/end-1 F (1 most-positive-fixnum) (1 10)) | ||
| 255 | (deftest-overlay-start/end-1 G (most-positive-fixnum 1) (1 10)) | ||
| 256 | (deftest-overlay-start/end-1 H (most-positive-fixnum most-positive-fixnum) (10 10)) | ||
| 257 | (deftest-overlay-start/end-1 I (100 11) (10 10)) | ||
| 258 | (deftest-overlay-start/end-1 J (11 100) (10 10)) | ||
| 259 | (deftest-overlay-start/end-1 K (0 1) (1 1)) | ||
| 260 | (deftest-overlay-start/end-1 L (1 0) (1 1)) | ||
| 261 | (deftest-overlay-start/end-1 M (0 0) (1 1)) | ||
| 262 | |||
| 263 | (ert-deftest test-overlay-start/end-2 () | ||
| 264 | (should-not (overlay-start (with-temp-buffer (make-overlay 1 1)))) | ||
| 265 | (should-not (overlay-end (with-temp-buffer (make-overlay 1 1))))) | ||
| 266 | |||
| 267 | |||
| 268 | ;; +===================================================================================+ | ||
| 269 | ;; | overlay-buffer | ||
| 270 | ;; +===================================================================================+ | ||
| 271 | |||
| 272 | ;; Test if overlay-buffer returns appropriate values. | ||
| 273 | (deftest-overlay-buffer-1 A (current-buffer) (current-buffer)) | ||
| 274 | (deftest-overlay-buffer-1 B nil (current-buffer)) | ||
| 275 | (ert-deftest test-overlay-buffer-1-C () | ||
| 276 | (should-error (make-overlay | ||
| 277 | 1 1 (with-temp-buffer (current-buffer))))) | ||
| 278 | |||
| 279 | |||
| 280 | ;; +===================================================================================+ | ||
| 281 | ;; | overlayp | ||
| 282 | ;; +===================================================================================+ | ||
| 283 | |||
| 284 | ;; Check the overlay predicate. | ||
| 285 | (deftest-overlayp-1 A (make-overlay 1 1) t) | ||
| 286 | (deftest-overlayp-1 B (with-temp-buffer (make-overlay 1 1)) t) | ||
| 287 | (deftest-overlayp-1 C nil nil) | ||
| 288 | (deftest-overlayp-1 D 'symbol nil) | ||
| 289 | (deftest-overlayp-1 E "string" nil) | ||
| 290 | (deftest-overlayp-1 F 42 nil) | ||
| 291 | (deftest-overlayp-1 G [1 2] nil) | ||
| 292 | (deftest-overlayp-1 H (symbol-function 'car) nil) | ||
| 293 | (deftest-overlayp-1 I float-pi nil) | ||
| 294 | (deftest-overlayp-1 J (cons 1 2) nil) | ||
| 295 | (deftest-overlayp-1 K (make-hash-table) nil) | ||
| 296 | (deftest-overlayp-1 L (symbol-function 'ert-deftest) nil) | ||
| 297 | (deftest-overlayp-1 M (current-buffer) nil) | ||
| 298 | (deftest-overlayp-1 N (selected-window) nil) | ||
| 299 | (deftest-overlayp-1 O (selected-frame) nil) | ||
| 300 | |||
| 301 | |||
| 302 | ;; +===================================================================================+ | ||
| 303 | ;; | overlay equality | ||
| 304 | ;; +===================================================================================+ | ||
| 305 | |||
| 306 | (deftest-overlays-equal-1 A t (1 1) (1 1)) | ||
| 307 | (deftest-overlays-equal-1 B t (5 10) (5 10)) | ||
| 308 | (deftest-overlays-equal-1 C nil (5 11) (5 10)) | ||
| 309 | (deftest-overlays-equal-1 D t (10 20 t) (10 20)) | ||
| 310 | (deftest-overlays-equal-1 E t (10 20 nil t) (10 20)) | ||
| 311 | (deftest-overlays-equal-1 F t (10 20 t t) (10 20 nil t)) | ||
| 312 | (deftest-overlays-equal-1 G t (10 20 t t) (10 20 t nil)) | ||
| 313 | (deftest-overlays-equal-1 H t (10 20 nil nil foo 42) (10 20 nil nil foo 42)) | ||
| 314 | (deftest-overlays-equal-1 I nil (10 20 nil nil foo 42) (10 20 nil nil foo 43)) | ||
| 315 | |||
| 316 | |||
| 317 | ;; +===================================================================================+ | ||
| 318 | ;; | overlay-lists | ||
| 319 | ;; +===================================================================================+ | ||
| 320 | |||
| 321 | ;; Check whether overlay-lists returns something sensible. | ||
| 322 | (ert-deftest test-overlay-lists-1 () | ||
| 323 | (with-temp-buffer | ||
| 324 | (should (equal (cons nil nil) (overlay-lists))) | ||
| 325 | (dotimes (i 10) (make-overlay 1 i)) | ||
| 326 | (should (listp (car (overlay-lists)))) | ||
| 327 | (should (listp (cdr (overlay-lists)))) | ||
| 328 | (let ((list (append (car (overlay-lists)) | ||
| 329 | (cdr (overlay-lists))))) | ||
| 330 | (should (= 10 (length list))) | ||
| 331 | (should (seq-every-p #'overlayp list))))) | ||
| 332 | |||
| 333 | |||
| 334 | ;; +===================================================================================+ | ||
| 335 | ;; | overlay-put/get/properties | ||
| 336 | ;; +===================================================================================+ | ||
| 337 | |||
| 338 | ;; Test if overlay-put properties can be retrieved by overlay-get and | ||
| 339 | ;; overlay-properties. | ||
| 340 | (ert-deftest test-overlay-props-1 () | ||
| 341 | (with-temp-buffer | ||
| 342 | (let* ((keys '(:k1 :k2 :k3)) | ||
| 343 | (values '(1 "v2" v3)) | ||
| 344 | (ov (make-overlay 1 1)) | ||
| 345 | (n (length keys))) | ||
| 346 | (should (equal (length keys) (length values))) | ||
| 347 | (should (null (overlay-properties ov))) | ||
| 348 | ;; Insert keys and values. | ||
| 349 | (dotimes (i n) | ||
| 350 | (should (equal (overlay-put ov (nth i keys) (nth i values)) | ||
| 351 | (nth i values)))) | ||
| 352 | ;; Compare with what overlay-get says. | ||
| 353 | (dotimes (i n) | ||
| 354 | (should (equal (overlay-get ov (nth i keys)) | ||
| 355 | (nth i values)))) | ||
| 356 | ;; Test if overlay-properties is a superset. | ||
| 357 | (dotimes (i n) | ||
| 358 | (should (equal (plist-get (overlay-properties ov) | ||
| 359 | (nth i keys)) | ||
| 360 | (nth i values)))) | ||
| 361 | ;; Check if overlay-properties is a subset. | ||
| 362 | (should (= (length (overlay-properties ov)) (* n 2)))))) | ||
| 363 | |||
| 364 | |||
| 365 | ;; +===================================================================================+ | ||
| 366 | ;; | next-overlay-change | ||
| 367 | ;; +===================================================================================+ | ||
| 368 | |||
| 369 | ;; Test if next-overlay-change returns RESULT if called with POS in a | ||
| 370 | ;; buffer with overlays corresponding to OVS and point-max >= 100. | ||
| 371 | ;; (POS RESULT &rest OVS) | ||
| 372 | ;; 0 overlays | ||
| 373 | (deftest-next-overlay-change-1 A (point-min) (point-max)) | ||
| 374 | (deftest-next-overlay-change-1 B (point-max) (point-max)) | ||
| 375 | ;; 1 non-empty overlay | ||
| 376 | (deftest-next-overlay-change-1 C 1 10 (10 20)) | ||
| 377 | (deftest-next-overlay-change-1 D 10 20 (10 20)) | ||
| 378 | (deftest-next-overlay-change-1 E 15 20 (10 20)) | ||
| 379 | (deftest-next-overlay-change-1 F 20 (point-max) (10 20)) | ||
| 380 | (deftest-next-overlay-change-1 G 30 (point-max) (10 20)) | ||
| 381 | ;; 1 empty overlay | ||
| 382 | (deftest-next-overlay-change-1 H 1 10 (10 10)) | ||
| 383 | (deftest-next-overlay-change-1 I 10 (point-max) (10 10)) | ||
| 384 | (deftest-next-overlay-change-1 J 20 (point-max) (10 10)) | ||
| 385 | ;; 2 non-empty, non-intersecting | ||
| 386 | (deftest-next-overlay-change-1 D 10 20 (20 30) (40 50)) | ||
| 387 | (deftest-next-overlay-change-1 E 35 40 (20 30) (40 50)) | ||
| 388 | (deftest-next-overlay-change-1 F 60 (point-max) (20 30) (40 50)) | ||
| 389 | (deftest-next-overlay-change-1 G 30 40 (20 30) (40 50)) | ||
| 390 | (deftest-next-overlay-change-1 H 50 (point-max) (20 30) (40 50)) | ||
| 391 | ;; 2 non-empty, intersecting | ||
| 392 | (deftest-next-overlay-change-1 I 10 20 (20 30) (25 35)) | ||
| 393 | (deftest-next-overlay-change-1 J 20 25 (20 30) (25 35)) | ||
| 394 | (deftest-next-overlay-change-1 K 23 25 (20 30) (25 35)) | ||
| 395 | (deftest-next-overlay-change-1 L 25 30 (20 30) (25 35)) | ||
| 396 | (deftest-next-overlay-change-1 M 28 30 (20 30) (25 35)) | ||
| 397 | (deftest-next-overlay-change-1 N 30 35 (20 30) (25 35)) | ||
| 398 | (deftest-next-overlay-change-1 O 35 (point-max) (20 30) (25 35)) | ||
| 399 | (deftest-next-overlay-change-1 P 50 (point-max) (20 30) (25 35)) | ||
| 400 | ;; 2 non-empty, continuous | ||
| 401 | (deftest-next-overlay-change-1 Q 10 20 (20 30) (30 40)) | ||
| 402 | (deftest-next-overlay-change-1 R 20 30 (20 30) (30 40)) | ||
| 403 | (deftest-next-overlay-change-1 S 25 30 (20 30) (30 40)) | ||
| 404 | (deftest-next-overlay-change-1 T 30 40 (20 30) (30 40)) | ||
| 405 | (deftest-next-overlay-change-1 U 35 40 (20 30) (30 40)) | ||
| 406 | (deftest-next-overlay-change-1 V 40 (point-max) (20 30) (30 40)) | ||
| 407 | (deftest-next-overlay-change-1 W 50 (point-max) (20 30) (30 40)) | ||
| 408 | ;; 1 empty, 1 non-empty, non-in | ||
| 409 | (deftest-next-overlay-change-1 a 10 20 (20 20) (30 40)) | ||
| 410 | (deftest-next-overlay-change-1 b 20 30 (20 30) (30 40)) | ||
| 411 | (deftest-next-overlay-change-1 c 25 30 (20 30) (30 40)) | ||
| 412 | (deftest-next-overlay-change-1 d 30 40 (20 30) (30 40)) | ||
| 413 | (deftest-next-overlay-change-1 e 35 40 (20 30) (30 40)) | ||
| 414 | (deftest-next-overlay-change-1 f 40 (point-max) (20 30) (30 40)) | ||
| 415 | (deftest-next-overlay-change-1 g 50 (point-max) (20 30) (30 40)) | ||
| 416 | ;; 1 empty, 1 non-empty, intersecting at begin | ||
| 417 | (deftest-next-overlay-change-1 h 10 20 (20 20) (20 30)) | ||
| 418 | (deftest-next-overlay-change-1 i 20 30 (20 20) (20 30)) | ||
| 419 | (deftest-next-overlay-change-1 j 25 30 (20 20) (20 30)) | ||
| 420 | (deftest-next-overlay-change-1 k 30 (point-max) (20 20) (20 30)) | ||
| 421 | (deftest-next-overlay-change-1 l 40 (point-max) (20 20) (20 30)) | ||
| 422 | ;; 1 empty, 1 non-empty, intersecting at end | ||
| 423 | (deftest-next-overlay-change-1 h 10 20 (30 30) (20 30)) | ||
| 424 | (deftest-next-overlay-change-1 i 20 30 (30 30) (20 30)) | ||
| 425 | (deftest-next-overlay-change-1 j 25 30 (30 30) (20 30)) | ||
| 426 | (deftest-next-overlay-change-1 k 30 (point-max) (20 20) (20 30)) | ||
| 427 | (deftest-next-overlay-change-1 l 40 (point-max) (20 20) (20 30)) | ||
| 428 | ;; 1 empty, 1 non-empty, intersecting in the middle | ||
| 429 | (deftest-next-overlay-change-1 m 10 20 (25 25) (20 30)) | ||
| 430 | (deftest-next-overlay-change-1 n 20 25 (25 25) (20 30)) | ||
| 431 | (deftest-next-overlay-change-1 o 25 30 (25 25) (20 30)) | ||
| 432 | (deftest-next-overlay-change-1 p 30 (point-max) (25 25) (20 30)) | ||
| 433 | (deftest-next-overlay-change-1 q 40 (point-max) (25 25) (20 30)) | ||
| 434 | ;; 2 empty, intersecting | ||
| 435 | (deftest-next-overlay-change-1 r 10 20 (20 20) (20 20)) | ||
| 436 | (deftest-next-overlay-change-1 s 20 (point-max) (20 20) (20 20)) | ||
| 437 | (deftest-next-overlay-change-1 t 30 (point-max) (20 20) (20 20)) | ||
| 438 | ;; 2 empty, non-intersecting | ||
| 439 | (deftest-next-overlay-change-1 u 10 20 (20 20) (30 30)) | ||
| 440 | (deftest-next-overlay-change-1 v 20 30 (20 20) (30 30)) | ||
| 441 | (deftest-next-overlay-change-1 w 25 30 (20 20) (30 30)) | ||
| 442 | (deftest-next-overlay-change-1 x 30 (point-max) (20 20) (30 30)) | ||
| 443 | (deftest-next-overlay-change-1 y 50 (point-max) (20 20) (30 30)) | ||
| 444 | ;; 10 random | ||
| 445 | (deftest-next-overlay-change-1 aa 1 5 | ||
| 446 | (58 66) (41 10) (9 67) (28 88) (27 43) | ||
| 447 | (24 27) (48 36) (5 90) (61 9)) | ||
| 448 | (deftest-next-overlay-change-1 ab (point-max) (point-max) | ||
| 449 | (58 66) (41 10) (9 67) (28 88) (27 43) | ||
| 450 | (24 27) (48 36) (5 90) (61 9)) | ||
| 451 | (deftest-next-overlay-change-1 ac 67 88 | ||
| 452 | (58 66) (41 10) (9 67) (28 88) (27 43) | ||
| 453 | (24 27) (48 36) (5 90) (61 9)) | ||
| 454 | |||
| 455 | |||
| 456 | ;; +===================================================================================+ | ||
| 457 | ;; | previous-overlay-change. | ||
| 458 | ;; +===================================================================================+ | ||
| 459 | |||
| 460 | ;; Same for previous-overlay-change. | ||
| 461 | ;; 1 non-empty overlay | ||
| 462 | (deftest-previous-overlay-change-1 A (point-max) 1) | ||
| 463 | (deftest-previous-overlay-change-1 B 1 1) | ||
| 464 | (deftest-previous-overlay-change-1 C 1 1 (10 20)) | ||
| 465 | (deftest-previous-overlay-change-1 D 10 1 (10 20)) | ||
| 466 | (deftest-previous-overlay-change-1 E 15 10 (10 20)) | ||
| 467 | (deftest-previous-overlay-change-1 F 20 10 (10 20)) | ||
| 468 | (deftest-previous-overlay-change-1 G 30 20 (10 20)) | ||
| 469 | ;; 1 empty overlay | ||
| 470 | (deftest-previous-overlay-change-1 H 1 1 (10 10)) | ||
| 471 | (deftest-previous-overlay-change-1 I 10 1 (10 10)) | ||
| 472 | (deftest-previous-overlay-change-1 J 20 10 (10 10)) | ||
| 473 | ;; 2 non-empty, non-intersecting | ||
| 474 | (deftest-previous-overlay-change-1 D 10 1 (20 30) (40 50)) | ||
| 475 | (deftest-previous-overlay-change-1 E 35 30 (20 30) (40 50)) | ||
| 476 | (deftest-previous-overlay-change-1 F 60 50 (20 30) (40 50)) | ||
| 477 | (deftest-previous-overlay-change-1 G 30 20 (20 30) (40 50)) | ||
| 478 | (deftest-previous-overlay-change-1 H 50 40 (20 30) (40 50)) | ||
| 479 | ;; 2 non-empty, intersecting | ||
| 480 | (deftest-previous-overlay-change-1 I 10 1 (20 30) (25 35)) | ||
| 481 | (deftest-previous-overlay-change-1 J 20 1 (20 30) (25 35)) | ||
| 482 | (deftest-previous-overlay-change-1 K 23 20 (20 30) (25 35)) | ||
| 483 | (deftest-previous-overlay-change-1 L 25 20 (20 30) (25 35)) | ||
| 484 | (deftest-previous-overlay-change-1 M 28 25 (20 30) (25 35)) | ||
| 485 | (deftest-previous-overlay-change-1 N 30 25 (20 30) (25 35)) | ||
| 486 | (deftest-previous-overlay-change-1 O 35 30 (20 30) (25 35)) | ||
| 487 | (deftest-previous-overlay-change-1 P 50 35 (20 30) (25 35)) | ||
| 488 | ;; 2 non-empty, continuous | ||
| 489 | (deftest-previous-overlay-change-1 Q 10 1 (20 30) (30 40)) | ||
| 490 | (deftest-previous-overlay-change-1 R 20 1 (20 30) (30 40)) | ||
| 491 | (deftest-previous-overlay-change-1 S 25 20 (20 30) (30 40)) | ||
| 492 | (deftest-previous-overlay-change-1 T 30 20 (20 30) (30 40)) | ||
| 493 | (deftest-previous-overlay-change-1 U 35 30 (20 30) (30 40)) | ||
| 494 | (deftest-previous-overlay-change-1 V 40 30 (20 30) (30 40)) | ||
| 495 | (deftest-previous-overlay-change-1 W 50 40 (20 30) (30 40)) | ||
| 496 | ;; 1 empty, 1 non-empty, non-intersecting | ||
| 497 | (deftest-previous-overlay-change-1 a 10 1 (20 20) (30 40)) | ||
| 498 | (deftest-previous-overlay-change-1 b 20 1 (20 30) (30 40)) | ||
| 499 | (deftest-previous-overlay-change-1 c 25 20 (20 30) (30 40)) | ||
| 500 | (deftest-previous-overlay-change-1 d 30 20 (20 30) (30 40)) | ||
| 501 | (deftest-previous-overlay-change-1 e 35 30 (20 30) (30 40)) | ||
| 502 | (deftest-previous-overlay-change-1 f 40 30 (20 30) (30 40)) | ||
| 503 | (deftest-previous-overlay-change-1 g 50 40 (20 30) (30 40)) | ||
| 504 | ;; 1 empty, 1 non-empty, intersecting at begin | ||
| 505 | (deftest-previous-overlay-change-1 h 10 1 (20 20) (20 30)) | ||
| 506 | (deftest-previous-overlay-change-1 i 20 1 (20 20) (20 30)) | ||
| 507 | (deftest-previous-overlay-change-1 j 25 20 (20 20) (20 30)) | ||
| 508 | (deftest-previous-overlay-change-1 k 30 20 (20 20) (20 30)) | ||
| 509 | (deftest-previous-overlay-change-1 l 40 30 (20 20) (20 30)) | ||
| 510 | ;; 1 empty, 1 non-empty, intersecting at end | ||
| 511 | (deftest-previous-overlay-change-1 m 10 1 (30 30) (20 30)) | ||
| 512 | (deftest-previous-overlay-change-1 n 20 1 (30 30) (20 30)) | ||
| 513 | (deftest-previous-overlay-change-1 o 25 20 (30 30) (20 30)) | ||
| 514 | (deftest-previous-overlay-change-1 p 30 20 (20 20) (20 30)) | ||
| 515 | (deftest-previous-overlay-change-1 q 40 30 (20 20) (20 30)) | ||
| 516 | ;; 1 empty, 1 non-empty, intersectig in the middle | ||
| 517 | (deftest-previous-overlay-change-1 r 10 1 (25 25) (20 30)) | ||
| 518 | (deftest-previous-overlay-change-1 s 20 1 (25 25) (20 30)) | ||
| 519 | (deftest-previous-overlay-change-1 t 25 20 (25 25) (20 30)) | ||
| 520 | (deftest-previous-overlay-change-1 u 30 25 (25 25) (20 30)) | ||
| 521 | (deftest-previous-overlay-change-1 v 40 30 (25 25) (20 30)) | ||
| 522 | ;; 2 empty, intersecting | ||
| 523 | (deftest-previous-overlay-change-1 w 10 1 (20 20) (20 20)) | ||
| 524 | (deftest-previous-overlay-change-1 x 20 1 (20 20) (20 20)) | ||
| 525 | (deftest-previous-overlay-change-1 y 30 20 (20 20) (20 20)) | ||
| 526 | ;; 2 empty, non-intersecting | ||
| 527 | (deftest-previous-overlay-change-1 z 10 1 (20 20) (30 30)) | ||
| 528 | (deftest-previous-overlay-change-1 aa 20 1 (20 20) (30 30)) | ||
| 529 | (deftest-previous-overlay-change-1 ab 25 20 (20 20) (30 30)) | ||
| 530 | (deftest-previous-overlay-change-1 ac 30 20 (20 20) (30 30)) | ||
| 531 | (deftest-previous-overlay-change-1 ad 50 30 (20 20) (30 30)) | ||
| 532 | ;; 10 random | ||
| 533 | (deftest-previous-overlay-change-1 ae 100 90 | ||
| 534 | (58 66) (41 10) (9 67) (28 88) (27 43) | ||
| 535 | (24 27) (48 36) (5 90) (61 9)) | ||
| 536 | (deftest-previous-overlay-change-1 af (point-min) (point-min) | ||
| 537 | (58 66) (41 10) (9 67) (28 88) (27 43) | ||
| 538 | (24 27) (48 36) (5 90) (61 9)) | ||
| 539 | (deftest-previous-overlay-change-1 ag 29 28 | ||
| 540 | (58 66) (41 10) (9 67) (28 88) (27 43) | ||
| 541 | (24 27) (48 36) (5 90) (61 9)) | ||
| 542 | |||
| 543 | |||
| 544 | ;; +===================================================================================+ | ||
| 545 | ;; | overlays-at | ||
| 546 | ;; +===================================================================================+ | ||
| 547 | |||
| 548 | |||
| 549 | ;; Test whether overlay-at returns RESULT at POS after overlays OVL were | ||
| 550 | ;; created in a buffer. POS RES OVL | ||
| 551 | (deftest-overlays-at-1 A 1 ()) | ||
| 552 | ;; 1 overlay | ||
| 553 | (deftest-overlays-at-1 B 10 (a) (a 10 20)) | ||
| 554 | (deftest-overlays-at-1 C 15 (a) (a 10 20)) | ||
| 555 | (deftest-overlays-at-1 D 19 (a) (a 10 20)) | ||
| 556 | (deftest-overlays-at-1 E 20 () (a 10 20)) | ||
| 557 | (deftest-overlays-at-1 F 1 () (a 10 20)) | ||
| 558 | |||
| 559 | ;; 2 non-empty overlays non-intersecting | ||
| 560 | (deftest-overlays-at-1 G 1 () (a 10 20) (b 30 40)) | ||
| 561 | (deftest-overlays-at-1 H 10 (a) (a 10 20) (b 30 40)) | ||
| 562 | (deftest-overlays-at-1 I 15 (a) (a 10 20) (b 30 40)) | ||
| 563 | (deftest-overlays-at-1 K 20 () (a 10 20) (b 30 40)) | ||
| 564 | (deftest-overlays-at-1 L 25 () (a 10 20) (b 30 40)) | ||
| 565 | (deftest-overlays-at-1 M 30 (b) (a 10 20) (b 30 40)) | ||
| 566 | (deftest-overlays-at-1 N 35 (b) (a 10 20) (b 30 40)) | ||
| 567 | (deftest-overlays-at-1 O 40 () (a 10 20) (b 30 40)) | ||
| 568 | (deftest-overlays-at-1 P 50 () (a 10 20) (b 30 40)) | ||
| 569 | |||
| 570 | ;; 2 non-empty overlays intersecting | ||
| 571 | (deftest-overlays-at-1 G 1 () (a 10 30) (b 20 40)) | ||
| 572 | (deftest-overlays-at-1 H 10 (a) (a 10 30) (b 20 40)) | ||
| 573 | (deftest-overlays-at-1 I 15 (a) (a 10 30) (b 20 40)) | ||
| 574 | (deftest-overlays-at-1 K 20 (a b) (a 10 30) (b 20 40)) | ||
| 575 | (deftest-overlays-at-1 L 25 (a b) (a 10 30) (b 20 40)) | ||
| 576 | (deftest-overlays-at-1 M 30 (b) (a 10 30) (b 20 40)) | ||
| 577 | (deftest-overlays-at-1 N 35 (b) (a 10 30) (b 20 40)) | ||
| 578 | (deftest-overlays-at-1 O 40 () (a 10 30) (b 20 40)) | ||
| 579 | (deftest-overlays-at-1 P 50 () (a 10 30) (b 20 40)) | ||
| 580 | |||
| 581 | ;; 2 non-empty overlays continuous | ||
| 582 | (deftest-overlays-at-1 G 1 () (a 10 20) (b 20 30)) | ||
| 583 | (deftest-overlays-at-1 H 10 (a) (a 10 20) (b 20 30)) | ||
| 584 | (deftest-overlays-at-1 I 15 (a) (a 10 20) (b 20 30)) | ||
| 585 | (deftest-overlays-at-1 K 20 (b) (a 10 20) (b 20 30)) | ||
| 586 | (deftest-overlays-at-1 L 25 (b) (a 10 20) (b 20 30)) | ||
| 587 | (deftest-overlays-at-1 M 30 () (a 10 20) (b 20 30)) | ||
| 588 | |||
| 589 | ;; overlays-at never returns empty overlays. | ||
| 590 | (deftest-overlays-at-1 N 1 (a) (a 1 60) (c 1 1) (b 30 30) (d 50 50)) | ||
| 591 | (deftest-overlays-at-1 O 20 (a) (a 1 60) (c 1 1) (b 30 30) (d 50 50)) | ||
| 592 | (deftest-overlays-at-1 P 30 (a) (a 1 60) (c 1 1) (b 30 30) (d 50 50)) | ||
| 593 | (deftest-overlays-at-1 Q 40 (a) (a 1 60) (c 1 1) (b 30 30) (d 50 50)) | ||
| 594 | (deftest-overlays-at-1 R 50 (a) (a 1 60) (c 1 1) (b 30 30) (d 50 50)) | ||
| 595 | (deftest-overlays-at-1 S 60 () (a 1 60) (c 1 1) (b 30 30) (d 50 50)) | ||
| 596 | |||
| 597 | ;; behaviour at point-min and point-max | ||
| 598 | (ert-deftest test-overlays-at-2 () | ||
| 599 | (cl-macrolet ((should-length (n list) | ||
| 600 | `(should (= ,n (length ,list))))) | ||
| 601 | (with-temp-buffer | ||
| 602 | (insert (make-string 100 ?\s)) | ||
| 603 | (make-overlay 1 (point-max)) | ||
| 604 | (make-overlay 10 10) | ||
| 605 | (make-overlay 20 20) | ||
| 606 | (make-overlay (point-max) (point-max)) | ||
| 607 | (should-length 1 (overlays-at 1)) | ||
| 608 | (should-length 1 (overlays-at 10)) | ||
| 609 | (should-length 1 (overlays-at 20)) | ||
| 610 | (should-length 0 (overlays-at (point-max))) | ||
| 611 | (narrow-to-region 10 20) | ||
| 612 | (should-length 1 (overlays-at (point-min))) | ||
| 613 | (should-length 1 (overlays-at 15)) | ||
| 614 | (should-length 1 (overlays-at (point-max)))))) | ||
| 615 | |||
| 616 | |||
| 617 | ;; +===================================================================================+ | ||
| 618 | ;; | overlay-in | ||
| 619 | ;; +===================================================================================+ | ||
| 620 | |||
| 621 | |||
| 622 | ;; Test whether overlays-in returns RES in BEG,END after overlays OVL were | ||
| 623 | ;; created in a buffer. | ||
| 624 | |||
| 625 | (deftest-overlays-in-1 A 1 (point-max) ());;POS RES OVL | ||
| 626 | ;; 1 overlay | ||
| 627 | (deftest-overlays-in-1 B 1 10 () (a 10 20)) | ||
| 628 | (deftest-overlays-in-1 C 5 10 () (a 10 20)) | ||
| 629 | (deftest-overlays-in-1 D 5 15 (a) (a 10 20)) | ||
| 630 | (deftest-overlays-in-1 E 10 15 (a) (a 10 20)) | ||
| 631 | (deftest-overlays-in-1 F 10 20 (a) (a 10 20)) | ||
| 632 | (deftest-overlays-in-1 G 15 20 (a) (a 10 20)) | ||
| 633 | (deftest-overlays-in-1 H 15 25 (a) (a 10 20)) | ||
| 634 | (deftest-overlays-in-1 I 20 25 () (a 10 20)) | ||
| 635 | (deftest-overlays-in-1 J 30 50 () (a 10 20)) | ||
| 636 | |||
| 637 | ;; 2 non-empty overlays non-intersecting | ||
| 638 | (deftest-overlays-in-1 K 1 5 () (a 10 20) (b 30 40)) | ||
| 639 | (deftest-overlays-in-1 L 5 10 () (a 10 20) (b 30 40)) | ||
| 640 | (deftest-overlays-in-1 M 5 15 (a) (a 10 20) (b 30 40)) | ||
| 641 | (deftest-overlays-in-1 N 10 15 (a) (a 10 20) (b 30 40)) | ||
| 642 | (deftest-overlays-in-1 O 15 20 (a) (a 10 20) (b 30 40)) | ||
| 643 | (deftest-overlays-in-1 P 15 25 (a) (a 10 20) (b 30 40)) | ||
| 644 | (deftest-overlays-in-1 Q 20 25 () (a 10 20) (b 30 40)) | ||
| 645 | (deftest-overlays-in-1 R 20 30 () (a 10 20) (b 30 40)) | ||
| 646 | (deftest-overlays-in-1 S 25 30 () (a 10 20) (b 30 40)) | ||
| 647 | (deftest-overlays-in-1 T 25 35 (b) (a 10 20) (b 30 40)) | ||
| 648 | (deftest-overlays-in-1 U 30 35 (b) (a 10 20) (b 30 40)) | ||
| 649 | (deftest-overlays-in-1 V 40 50 () (a 10 20) (b 30 40)) | ||
| 650 | (deftest-overlays-in-1 W 50 60 () (a 10 20) (b 30 40)) | ||
| 651 | (deftest-overlays-in-1 X 1 50 (a b) (a 10 20) (b 30 40)) | ||
| 652 | (deftest-overlays-in-1 Y 10 40 (a b) (a 10 20) (b 30 40)) | ||
| 653 | (deftest-overlays-in-1 Z 10 41 (a b) (a 10 20) (b 30 40)) | ||
| 654 | |||
| 655 | ;; 2 non-empty overlays intersecting | ||
| 656 | (deftest-overlays-in-1 a 1 5 () (a 10 30) (b 20 40)) | ||
| 657 | (deftest-overlays-in-1 b 5 10 () (a 10 30) (b 20 40)) | ||
| 658 | (deftest-overlays-in-1 c 5 15 (a) (a 10 30) (b 20 40)) | ||
| 659 | (deftest-overlays-in-1 d 10 15 (a) (a 10 30) (b 20 40)) | ||
| 660 | (deftest-overlays-in-1 e 10 20 (a) (a 10 30) (b 20 40)) | ||
| 661 | (deftest-overlays-in-1 f 15 20 (a) (a 10 30) (b 20 40)) | ||
| 662 | (deftest-overlays-in-1 g 20 30 (a b) (a 10 30) (b 20 40)) | ||
| 663 | (deftest-overlays-in-1 h 20 40 (a b) (a 10 30) (b 20 40)) | ||
| 664 | (deftest-overlays-in-1 i 25 30 (a b) (a 10 30) (b 20 40)) | ||
| 665 | (deftest-overlays-in-1 j 30 30 (b) (a 10 30) (b 20 40)) | ||
| 666 | (deftest-overlays-in-1 k 30 35 (b) (a 10 30) (b 20 40)) | ||
| 667 | (deftest-overlays-in-1 l 35 40 (b) (a 10 30) (b 20 40)) | ||
| 668 | (deftest-overlays-in-1 m 40 45 () (a 10 30) (b 20 40)) | ||
| 669 | (deftest-overlays-in-1 n 41 45 () (a 10 30) (b 20 40)) | ||
| 670 | (deftest-overlays-in-1 o 50 60 () (a 10 30) (b 20 40)) | ||
| 671 | |||
| 672 | ;; 2 non-empty overlays continuous | ||
| 673 | (deftest-overlays-in-1 p 1 5 () (a 10 20) (b 20 30)) | ||
| 674 | (deftest-overlays-in-1 q 5 10 () (a 10 20) (b 20 30)) | ||
| 675 | (deftest-overlays-in-1 r 15 20 (a) (a 10 20) (b 20 30)) | ||
| 676 | (deftest-overlays-in-1 s 15 25 (a b) (a 10 20) (b 20 30)) | ||
| 677 | (deftest-overlays-in-1 t 20 25 (b) (a 10 20) (b 20 30)) | ||
| 678 | (deftest-overlays-in-1 u 25 30 (b) (a 10 20) (b 20 30)) | ||
| 679 | (deftest-overlays-in-1 v 29 35 (b) (a 10 20) (b 20 30)) | ||
| 680 | (deftest-overlays-in-1 w 30 35 () (a 10 20) (b 20 30)) | ||
| 681 | (deftest-overlays-in-1 x 35 50 () (a 10 20) (b 20 30)) | ||
| 682 | (deftest-overlays-in-1 y 1 50 (a b) (a 10 20) (b 20 30)) | ||
| 683 | (deftest-overlays-in-1 z 15 50 (a b) (a 10 20) (b 20 30)) | ||
| 684 | (deftest-overlays-in-1 aa 1 25 (a b) (a 10 20) (b 20 30)) | ||
| 685 | |||
| 686 | ;; 1 empty overlay | ||
| 687 | (deftest-overlays-in-1 ab 1 10 () (a 10 10)) | ||
| 688 | (deftest-overlays-in-1 ac 10 10 (a) (a 10 10)) | ||
| 689 | (deftest-overlays-in-1 ad 9 10 () (a 10 10)) | ||
| 690 | (deftest-overlays-in-1 ae 9 11 (a) (a 10 10)) | ||
| 691 | (deftest-overlays-in-1 af 10 11 (a) (a 10 10)) | ||
| 692 | |||
| 693 | |||
| 694 | ;; behaviour at point-max | ||
| 695 | (ert-deftest test-overlays-in-2 () | ||
| 696 | (cl-macrolet ((should-length (n list) | ||
| 697 | `(should (= ,n (length ,list))))) | ||
| 698 | (with-temp-buffer | ||
| 699 | (insert (make-string 100 ?\s)) | ||
| 700 | (make-overlay (point-max) (point-max)) | ||
| 701 | (make-overlay 50 50) | ||
| 702 | (should-length 1 (overlays-in 50 50)) | ||
| 703 | (should-length 2 (overlays-in 1 (point-max))) | ||
| 704 | (should-length 1 (overlays-in (point-max) (point-max))) | ||
| 705 | (narrow-to-region 1 50) | ||
| 706 | (should-length 0 (overlays-in 1 (point-max))) | ||
| 707 | (should-length 1 (overlays-in (point-max) (point-max)))))) | ||
| 708 | |||
| 709 | |||
| 710 | ;; +===================================================================================+ | ||
| 711 | ;; | overlay-recenter | ||
| 712 | ;; +===================================================================================+ | ||
| 713 | |||
| 714 | ;; This function is a noop in the overlay tree branch. | ||
| 715 | (ert-deftest test-overlay-recenter () | ||
| 716 | (with-temp-buffer | ||
| 717 | (should-not (overlay-recenter 1)) | ||
| 718 | (insert (make-string 100 ?\s)) | ||
| 719 | (dotimes (i 10) | ||
| 720 | (make-overlay i (1+ i)) | ||
| 721 | (should-not (overlay-recenter i))))) | ||
| 722 | |||
| 723 | |||
| 724 | ;; +===================================================================================+ | ||
| 725 | ;; | move-overlay | ||
| 726 | ;; +===================================================================================+ | ||
| 727 | |||
| 728 | ;; buffer nil with live overlay | ||
| 729 | (ert-deftest test-move-overlay-1 () | ||
| 730 | (test-with-overlay-in-buffer (ov 1 100) | ||
| 731 | (move-overlay ov 50 60) | ||
| 732 | (should (= 50 (overlay-start ov))) | ||
| 733 | (should (= 60 (overlay-end ov))) | ||
| 734 | (should (eq (current-buffer) (overlay-buffer ov))))) | ||
| 735 | |||
| 736 | ;; buffer nil, dead overlay | ||
| 737 | (ert-deftest test-move-overlay-2 () | ||
| 738 | (with-temp-buffer | ||
| 739 | (let ((ov (test-with-overlay-in-buffer (ov 1 100) ov))) | ||
| 740 | (insert (make-string 100 ?\s)) | ||
| 741 | (move-overlay ov 50 60) | ||
| 742 | (should (= 50 (overlay-start ov))) | ||
| 743 | (should (= 60 (overlay-end ov))) | ||
| 744 | (should (eq (current-buffer) (overlay-buffer ov)))))) | ||
| 745 | |||
| 746 | ;; buffer non-nil, live overlay | ||
| 747 | (ert-deftest test-move-overlay-3 () | ||
| 748 | (test-with-overlay-in-buffer (ov 10 100) | ||
| 749 | (with-temp-buffer | ||
| 750 | (move-overlay ov 1 1 (current-buffer)) | ||
| 751 | (should (= 1 (overlay-start ov))) | ||
| 752 | (should (= 1 (overlay-end ov))) | ||
| 753 | (should (eq (current-buffer) (overlay-buffer ov)))) | ||
| 754 | (should-not (overlay-start ov)) | ||
| 755 | (should-not (overlay-end ov)) | ||
| 756 | (should-not (overlay-buffer ov)))) | ||
| 757 | |||
| 758 | ;; buffer non-nil, dead overlay | ||
| 759 | (ert-deftest test-move-overlay-4 () | ||
| 760 | (let ((ov (test-with-overlay-in-buffer (ov 1 1) ov))) | ||
| 761 | (with-temp-buffer | ||
| 762 | (move-overlay ov 1 1 (current-buffer)) | ||
| 763 | (should (= 1 (overlay-start ov))) | ||
| 764 | (should (= 1 (overlay-end ov))) | ||
| 765 | (should (eq (current-buffer) (overlay-buffer ov)))) | ||
| 766 | (should-not (overlay-start ov)) | ||
| 767 | (should-not (overlay-end ov)) | ||
| 768 | (should-not (overlay-buffer ov)))) | ||
| 769 | |||
| 770 | ;; This used to fail. | ||
| 771 | (ert-deftest test-move-overlay-5 () | ||
| 772 | (skip-unless (fboundp 'overlay-tree)) | ||
| 773 | (with-temp-buffer | ||
| 774 | (insert (make-string 1 ?.)) | ||
| 775 | (let ((other (make-overlay 1 1))) | ||
| 776 | (make-overlay 1 1) | ||
| 777 | (insert "()") | ||
| 778 | (move-overlay other (point-max) (1+ (point-max)) (current-buffer)) | ||
| 779 | (delete-overlay other)) | ||
| 780 | (should (= (plist-get (car (with-no-warnings (overlay-tree))) :limit) | ||
| 781 | 1)))) | ||
| 782 | |||
| 783 | |||
| 784 | ;; +===================================================================================+ | ||
| 785 | ;; | delete-(all-)overlay | ||
| 786 | ;; +===================================================================================+ | ||
| 787 | |||
| 788 | ;; delete live overlay | ||
| 789 | (ert-deftest test-delete-overlay-1 () | ||
| 790 | (test-with-overlay-in-buffer (ov 10 100) | ||
| 791 | (should (buffer-live-p (overlay-buffer ov))) | ||
| 792 | (delete-overlay ov) | ||
| 793 | (should-not (overlay-start ov)) | ||
| 794 | (should-not (overlay-end ov)) | ||
| 795 | (should-not (overlay-buffer ov)))) | ||
| 796 | |||
| 797 | ;; delete dead overlay | ||
| 798 | (ert-deftest test-delete-overlay-2 () | ||
| 799 | (let ((ov (test-with-overlay-in-buffer (ov 10 100) ov))) | ||
| 800 | (should-not (overlay-start ov)) | ||
| 801 | (should-not (overlay-end ov)) | ||
| 802 | (should-not (overlay-buffer ov)) | ||
| 803 | (should-not (delete-overlay ov)) | ||
| 804 | (should-not (overlay-start ov)) | ||
| 805 | (should-not (overlay-end ov)) | ||
| 806 | (should-not (overlay-buffer ov)))) | ||
| 807 | |||
| 808 | (ert-deftest test-delete-all-overlay-1 () | ||
| 809 | (with-temp-buffer | ||
| 810 | (should-not (delete-all-overlays)) | ||
| 811 | (should-not (delete-all-overlays (current-buffer))) | ||
| 812 | (insert (make-string 100 ?\s)) | ||
| 813 | (dotimes (i 10) (make-overlay i (1+ i))) | ||
| 814 | (should-not (delete-all-overlays (current-buffer))) | ||
| 815 | (should-not (delete-all-overlays)))) | ||
| 816 | |||
| 817 | |||
| 818 | ;; +===================================================================================+ | ||
| 819 | ;; | get-char-property(-and-overlay) | ||
| 820 | ;; +===================================================================================+ | ||
| 821 | |||
| 822 | ;; FIXME: TBD | ||
| 823 | |||
| 824 | |||
| 825 | ;; +===================================================================================+ | ||
| 826 | ;; | Moving by insertions | ||
| 827 | ;; +===================================================================================+ | ||
| 828 | |||
| 829 | (defmacro deftest-moving-insert-1 (id beg-end insert sbeg-send fa ra) | ||
| 830 | (cl-destructuring-bind (beg end ipos ilen sbeg send fa ra) | ||
| 831 | (append beg-end insert sbeg-send (list fa ra) nil) | ||
| 832 | `(ert-deftest ,(make-overlay-test-name 'moving-insert 1 id) () | ||
| 833 | (test-with-overlay-in-buffer (ov ,beg ,end ,fa ,ra) | ||
| 834 | (should (= ,beg (overlay-start ov))) | ||
| 835 | (should (= ,end (overlay-end ov))) | ||
| 836 | (goto-char ,ipos) | ||
| 837 | (insert (make-string ,ilen ?x)) | ||
| 838 | (should (= ,sbeg (overlay-start ov))) | ||
| 839 | (should (= ,send (overlay-end ov))))))) | ||
| 840 | |||
| 841 | ;; non-empty, no fa, no ra | ||
| 842 | ;; -------------------- OV INS RESULT | ||
| 843 | (deftest-moving-insert-1 A (10 20) (15 3) (10 23) nil nil) | ||
| 844 | (deftest-moving-insert-1 B (10 20) (20 4) (10 20) nil nil) | ||
| 845 | (deftest-moving-insert-1 C (10 20) (5 5) (15 25) nil nil) | ||
| 846 | (deftest-moving-insert-1 D (10 20) (10 3) (10 23) nil nil) | ||
| 847 | (deftest-moving-insert-1 E (10 20) (20 4) (10 20) nil nil) | ||
| 848 | |||
| 849 | ;; non-empty no fa, ra | ||
| 850 | (deftest-moving-insert-1 F (10 20) (15 3) (10 23) nil t) | ||
| 851 | (deftest-moving-insert-1 G (10 20) (20 4) (10 24) nil t) | ||
| 852 | (deftest-moving-insert-1 H (10 20) (5 5) (15 25) nil t) | ||
| 853 | (deftest-moving-insert-1 I (10 20) (10 3) (10 23) nil t) | ||
| 854 | (deftest-moving-insert-1 J (10 20) (20 4) (10 24) nil t) | ||
| 855 | |||
| 856 | ;; non-empty, fa, no r | ||
| 857 | (deftest-moving-insert-1 K (10 20) (15 3) (10 23) t nil) | ||
| 858 | (deftest-moving-insert-1 L (10 20) (20 4) (10 20) t nil) | ||
| 859 | (deftest-moving-insert-1 M (10 20) (5 5) (15 25) t nil) | ||
| 860 | (deftest-moving-insert-1 N (10 20) (10 3) (13 23) t nil) | ||
| 861 | (deftest-moving-insert-1 O (10 20) (20 4) (10 20) t nil) | ||
| 862 | |||
| 863 | ;; This used to fail. | ||
| 864 | (ert-deftest test-moving-insert-2-a () | ||
| 865 | (with-temp-buffer | ||
| 866 | (insert (make-string 1 ?.)) | ||
| 867 | (let ((ov (make-overlay 1 1 nil t nil))) | ||
| 868 | (insert "()") | ||
| 869 | (should (= 1 (overlay-end ov)))))) | ||
| 870 | |||
| 871 | ;; non-empty, fa, ra | ||
| 872 | (deftest-moving-insert-1 P (10 20) (15 3) (10 23) t t) | ||
| 873 | (deftest-moving-insert-1 Q (10 20) (20 4) (10 24) t t) | ||
| 874 | (deftest-moving-insert-1 R (10 20) (5 5) (15 25) t t) | ||
| 875 | (deftest-moving-insert-1 S (10 20) (10 3) (13 23) t t) | ||
| 876 | (deftest-moving-insert-1 T (10 20) (20 4) (10 24) t t) | ||
| 877 | |||
| 878 | ;; empty, no fa, no ra | ||
| 879 | (deftest-moving-insert-1 U (15 15) (20 4) (15 15) nil nil) | ||
| 880 | (deftest-moving-insert-1 V (15 15) (5 5) (20 20) nil nil) | ||
| 881 | (deftest-moving-insert-1 W (15 15) (15 3) (15 15) nil nil) | ||
| 882 | |||
| 883 | ;; empty no fa, ra | ||
| 884 | (deftest-moving-insert-1 X (15 15) (20 4) (15 15) nil t) | ||
| 885 | (deftest-moving-insert-1 Y (15 15) (5 5) (20 20) nil t) | ||
| 886 | (deftest-moving-insert-1 Z (15 15) (15 3) (15 18) nil t) | ||
| 887 | |||
| 888 | ;; empty, fa, no ra | ||
| 889 | (deftest-moving-insert-1 a (15 15) (20 4) (15 15) t nil) | ||
| 890 | (deftest-moving-insert-1 b (15 15) (5 5) (20 20) t nil) | ||
| 891 | (deftest-moving-insert-1 c (15 15) (15 3) (15 15) t nil) | ||
| 892 | |||
| 893 | ;; empty, fa, ra | ||
| 894 | (deftest-moving-insert-1 d (15 15) (20 4) (15 15) t t) | ||
| 895 | (deftest-moving-insert-1 e (15 15) (5 5) (20 20) t t) | ||
| 896 | (deftest-moving-insert-1 f (15 15) (15 3) (18 18) t t) | ||
| 897 | |||
| 898 | ;; Try to trigger a pathological case where the tree could become | ||
| 899 | ;; unordered due to an insert operation. | ||
| 900 | |||
| 901 | (ert-deftest test-moving-insert-2 () | ||
| 902 | (with-temp-buffer | ||
| 903 | (insert (make-string 1000 ?x)) | ||
| 904 | (let ((root (make-overlay 50 75 nil nil 'rear-advance)) | ||
| 905 | (left (make-overlay 25 50 nil 'front-advance 'rear-advance)) | ||
| 906 | (right (make-overlay 75 100 nil nil nil))) | ||
| 907 | ;; [50] <--- start | ||
| 908 | ;; / \ | ||
| 909 | ;; (25) (75) | ||
| 910 | (delete-region 25 75) | ||
| 911 | ;; [25] | ||
| 912 | ;; / \ | ||
| 913 | ;; (25) (25) | ||
| 914 | (should (= 25 (overlay-start root))) | ||
| 915 | (should (= 25 (overlay-end root))) | ||
| 916 | (should (= 25 (overlay-start left))) | ||
| 917 | (should (= 25 (overlay-end left))) | ||
| 918 | (should (= 25 (overlay-start right))) | ||
| 919 | (should (= 50 (overlay-end right))) | ||
| 920 | ;; Inserting at start should make left advance while right and | ||
| 921 | ;; root stay, thus we would have left > right . | ||
| 922 | (goto-char 25) | ||
| 923 | (insert (make-string 25 ?x)) | ||
| 924 | ;; [25] | ||
| 925 | ;; / \ | ||
| 926 | ;; (50) (25) | ||
| 927 | (should (= 25 (overlay-start root))) | ||
| 928 | (should (= 50 (overlay-end root))) | ||
| 929 | (should (= 50 (overlay-start left))) | ||
| 930 | (should (= 50 (overlay-end left))) | ||
| 931 | (should (= 25 (overlay-start right))) | ||
| 932 | (should (= 75 (overlay-end right))) | ||
| 933 | ;; Try to detect the error, by removing left. The should fail | ||
| 934 | ;; an eassert, since it won't be found by a reular tree | ||
| 935 | ;; traversal - in theory. | ||
| 936 | (delete-overlay left) | ||
| 937 | (should (= 2 (length (overlays-in 1 (point-max)))))))) | ||
| 938 | |||
| 939 | |||
| 940 | |||
| 941 | ;; +===================================================================================+ | ||
| 942 | ;; | Moving by deletions | ||
| 943 | ;; +===================================================================================+ | ||
| 944 | |||
| 945 | (defmacro deftest-moving-delete-1 (id beg-end delete sbeg-send fa ra) | ||
| 946 | (cl-destructuring-bind (beg end dpos dlen sbeg send fa ra) | ||
| 947 | (append beg-end delete sbeg-send (list fa ra) nil) | ||
| 948 | `(ert-deftest ,(make-overlay-test-name 'moving-delete 1 id) () | ||
| 949 | (test-with-overlay-in-buffer (ov ,beg ,end ,fa ,ra) | ||
| 950 | (should (= ,beg (overlay-start ov))) | ||
| 951 | (should (= ,end (overlay-end ov))) | ||
| 952 | (delete-region ,dpos (+ ,dpos ,dlen)) | ||
| 953 | (should (= ,sbeg (overlay-start ov))) | ||
| 954 | (should (= ,send (overlay-end ov))))))) | ||
| 955 | |||
| 956 | ;; non-empty, no fa, no ra | ||
| 957 | ;; -------------------- OV DEL RESULT | ||
| 958 | (deftest-moving-delete-1 A (10 20) (15 3) (10 17) nil nil) | ||
| 959 | (deftest-moving-delete-1 B (10 20) (20 4) (10 20) nil nil) | ||
| 960 | (deftest-moving-delete-1 C (10 20) (5 5) (5 15) nil nil) | ||
| 961 | (deftest-moving-delete-1 D (10 20) (10 3) (10 17) nil nil) | ||
| 962 | (deftest-moving-delete-1 E (10 20) (20 4) (10 20) nil nil) | ||
| 963 | |||
| 964 | ;; non-empty no fa, ra | ||
| 965 | (deftest-moving-delete-1 F (10 20) (15 3) (10 17) nil t) | ||
| 966 | (deftest-moving-delete-1 G (10 20) (20 4) (10 20) nil t) | ||
| 967 | (deftest-moving-delete-1 H (10 20) (5 5) (5 15) nil t) | ||
| 968 | (deftest-moving-delete-1 I (10 20) (10 3) (10 17) nil t) | ||
| 969 | (deftest-moving-delete-1 J (10 20) (20 4) (10 20) nil t) | ||
| 970 | |||
| 971 | ;; non-empty, fa, no ra | ||
| 972 | (deftest-moving-delete-1 K (10 20) (15 3) (10 17) t nil) | ||
| 973 | (deftest-moving-delete-1 L (10 20) (20 4) (10 20) t nil) | ||
| 974 | (deftest-moving-delete-1 M (10 20) (5 5) (5 15) t nil) | ||
| 975 | (deftest-moving-delete-1 N (10 20) (10 3) (10 17) t nil) | ||
| 976 | (deftest-moving-delete-1 O (10 20) (20 4) (10 20) t nil) | ||
| 977 | |||
| 978 | ;; non-empty, fa, ra | ||
| 979 | (deftest-moving-delete-1 P (10 20) (15 3) (10 17) t t) | ||
| 980 | (deftest-moving-delete-1 Q (10 20) (20 4) (10 20) t t) | ||
| 981 | (deftest-moving-delete-1 R (10 20) (5 5) (5 15) t t) | ||
| 982 | (deftest-moving-delete-1 S (10 20) (10 3) (10 17) t t) | ||
| 983 | (deftest-moving-delete-1 T (10 20) (20 4) (10 20) t t) | ||
| 984 | |||
| 985 | ;; empty, no fa, no ra | ||
| 986 | (deftest-moving-delete-1 U (15 15) (20 4) (15 15) nil nil) | ||
| 987 | (deftest-moving-delete-1 V (15 15) (5 5) (10 10) nil nil) | ||
| 988 | (deftest-moving-delete-1 W (15 15) (15 3) (15 15) nil nil) | ||
| 989 | |||
| 990 | ;; empty no fa, ra | ||
| 991 | (deftest-moving-delete-1 X (15 15) (20 4) (15 15) nil t) | ||
| 992 | (deftest-moving-delete-1 Y (15 15) (5 5) (10 10) nil t) | ||
| 993 | (deftest-moving-delete-1 Z (15 15) (15 3) (15 15) nil t) | ||
| 994 | |||
| 995 | ;; empty, fa, no ra | ||
| 996 | (deftest-moving-delete-1 a (15 15) (20 4) (15 15) t nil) | ||
| 997 | (deftest-moving-delete-1 b (15 15) (5 5) (10 10) t nil) | ||
| 998 | (deftest-moving-delete-1 c (15 15) (15 3) (15 15) t nil) | ||
| 999 | |||
| 1000 | ;; empty, fa, ra | ||
| 1001 | (deftest-moving-delete-1 d (15 15) (20 4) (15 15) t t) | ||
| 1002 | (deftest-moving-delete-1 e (15 15) (5 5) (10 10) t t) | ||
| 1003 | (deftest-moving-delete-1 f (15 15) (15 3) (15 15) t t) | ||
| 1004 | |||
| 1005 | |||
| 1006 | ;; +===================================================================================+ | ||
| 1007 | ;; | make-indirect-buffer | ||
| 1008 | ;; +===================================================================================+ | ||
| 1009 | |||
| 1010 | ;; Check if overlays are cloned/seperate from indirect buffer. | ||
| 1011 | (ert-deftest test-make-indirect-buffer-1 () | ||
| 1012 | (with-temp-buffer | ||
| 1013 | (dotimes (_ 10) (make-overlay 1 1)) | ||
| 1014 | (let (indirect clone) | ||
| 1015 | (unwind-protect | ||
| 1016 | (progn | ||
| 1017 | (setq indirect (make-indirect-buffer | ||
| 1018 | (current-buffer) "indirect")) | ||
| 1019 | (with-current-buffer indirect | ||
| 1020 | (should-not (overlays-in (point-min) (point-max))) | ||
| 1021 | (dotimes (_ 20) (make-overlay 1 1)) | ||
| 1022 | (should (= 20 (length (overlays-in (point-min) (point-max))))) | ||
| 1023 | (delete-all-overlays) | ||
| 1024 | (should-not (overlays-in (point-min) (point-max)))) | ||
| 1025 | (should (= 10 (length (overlays-in (point-min) (point-max))))) | ||
| 1026 | (setq clone (make-indirect-buffer | ||
| 1027 | (current-buffer) "clone" 'clone)) | ||
| 1028 | (with-current-buffer clone | ||
| 1029 | (should (= 10 (length (overlays-in (point-min) (point-max))))) | ||
| 1030 | (dotimes (_ 30) (make-overlay 1 1)) | ||
| 1031 | (should (= 40 (length (overlays-in (point-min) (point-max)))))) | ||
| 1032 | ;; back in temp buffer | ||
| 1033 | (should (= 10 (length (overlays-in (point-min) (point-max))))) | ||
| 1034 | (with-current-buffer clone | ||
| 1035 | (mapc #'delete-overlay | ||
| 1036 | (seq-take (overlays-in (point-min) (point-max)) 10)) | ||
| 1037 | (should (= 30 (length (overlays-in (point-min) (point-max)))))) | ||
| 1038 | (should (= 10 (length (overlays-in (point-min) (point-max))))) | ||
| 1039 | (delete-all-overlays) | ||
| 1040 | (with-current-buffer clone | ||
| 1041 | (should (= 30 (length (overlays-in (point-min) (point-max))))))) | ||
| 1042 | (when (buffer-live-p clone) | ||
| 1043 | (kill-buffer clone)) | ||
| 1044 | (when (buffer-live-p indirect) | ||
| 1045 | (kill-buffer indirect)))))) | ||
| 1046 | |||
| 1047 | |||
| 1048 | |||
| 1049 | ;; +===================================================================================+ | ||
| 1050 | ;; | buffer-swap-text | ||
| 1051 | ;; +===================================================================================+ | ||
| 1052 | |||
| 1053 | (defmacro test-with-temp-buffers (vars &rest body) | ||
| 1054 | (declare (indent 1) (debug (sexp &rest form))) | ||
| 1055 | (if (null vars) | ||
| 1056 | `(progn ,@body) | ||
| 1057 | `(with-temp-buffer | ||
| 1058 | (let ((,(car vars) (current-buffer))) | ||
| 1059 | (test-with-temp-buffers ,(cdr vars) ,@body))))) | ||
| 1060 | |||
| 1061 | ;; basic | ||
| 1062 | (ert-deftest test-buffer-swap-text-1 () | ||
| 1063 | (test-with-temp-buffers (buffer other) | ||
| 1064 | (with-current-buffer buffer | ||
| 1065 | (let ((ov (make-overlay 1 1))) | ||
| 1066 | (buffer-swap-text other) | ||
| 1067 | (should-not (overlays-in 1 1)) | ||
| 1068 | (with-current-buffer other | ||
| 1069 | (should (overlays-in 1 1)) | ||
| 1070 | (should (eq ov (car (overlays-in 1 1))))))))) | ||
| 1071 | |||
| 1072 | ;; properties | ||
| 1073 | (ert-deftest test-buffer-swap-text-1 () | ||
| 1074 | (test-with-temp-buffers (buffer other) | ||
| 1075 | (with-current-buffer other | ||
| 1076 | (overlay-put (make-overlay 1 1) 'buffer 'other)) | ||
| 1077 | (with-current-buffer buffer | ||
| 1078 | (overlay-put (make-overlay 1 1) 'buffer 'buffer) | ||
| 1079 | (buffer-swap-text other) | ||
| 1080 | (should (= 1 (length (overlays-in 1 1)))) | ||
| 1081 | (should (eq (overlay-get (car (overlays-in 1 1)) 'buffer) 'other))) | ||
| 1082 | (with-current-buffer other | ||
| 1083 | (should (= 1 (length (overlays-in 1 1)))) | ||
| 1084 | (should (eq (overlay-get (car (overlays-in 1 1)) 'buffer) 'buffer))))) | ||
| 1085 | |||
| 1086 | |||
| 1087 | ;; +===================================================================================+ | ||
| 1088 | ;; | priorities | ||
| 1089 | ;; +===================================================================================+ | ||
| 1090 | |||
| 1091 | (ert-deftest test-overlay-priorities-1 () | ||
| 1092 | (with-temp-buffer | ||
| 1093 | (insert " ") | ||
| 1094 | (dotimes (i 10) | ||
| 1095 | (let ((ov (make-overlay 1 2))) | ||
| 1096 | (overlay-put ov 'priority i) | ||
| 1097 | (overlay-put ov 'value i))) | ||
| 1098 | (should (eq 9 (get-char-property 1 'value))))) | ||
| 1099 | |||
| 1100 | (ert-deftest test-overlay-priorities-2 () | ||
| 1101 | (with-temp-buffer | ||
| 1102 | (insert " ") | ||
| 1103 | (dotimes (j 10) | ||
| 1104 | (let* ((i (- 9 j)) | ||
| 1105 | (ov (make-overlay 1 2))) | ||
| 1106 | (overlay-put ov 'priority i) | ||
| 1107 | (overlay-put ov 'value i))) | ||
| 1108 | (should (eq 9 (get-char-property 1 'value))))) | ||
| 1109 | |||
| 1110 | |||
| 1111 | ;; +===================================================================================+ | ||
| 1112 | ;; | Other | ||
| 1113 | ;; +===================================================================================+ | ||
| 1114 | |||
| 1115 | (defun test-overlay-regions () | ||
| 1116 | (sort (mapcar (lambda (ov) | ||
| 1117 | (cons (overlay-start ov) | ||
| 1118 | (overlay-end ov))) | ||
| 1119 | (overlays-in (point-min) | ||
| 1120 | (point-max))) | ||
| 1121 | (lambda (o1 o2) | ||
| 1122 | (or (< (car o1) (car o2)) | ||
| 1123 | (and (= (car o1) (car o2)) | ||
| 1124 | (< (cdr o1) (cdr o2))))))) | ||
| 1125 | |||
| 1126 | ;; This test used to fail. | ||
| 1127 | (ert-deftest overlay-complex-delete-with-offset () | ||
| 1128 | (with-temp-buffer | ||
| 1129 | (let (todelete) | ||
| 1130 | (insert (make-string 1000 ?\s)) | ||
| 1131 | (make-overlay 1 2 nil t nil) | ||
| 1132 | (make-overlay 2 3 nil t nil) | ||
| 1133 | (make-overlay 3 4 nil t nil) | ||
| 1134 | (make-overlay 4 5 nil t nil) | ||
| 1135 | (setq todelete (make-overlay 280 287 nil t nil)) | ||
| 1136 | (make-overlay 265 275 nil t nil) | ||
| 1137 | (make-overlay 329 386 nil t nil) | ||
| 1138 | (make-overlay 386 390 nil t nil) | ||
| 1139 | (goto-char 50) | ||
| 1140 | (delete-char 50) | ||
| 1141 | (goto-char 1) | ||
| 1142 | (delete-char 2) | ||
| 1143 | (delete-overlay todelete) | ||
| 1144 | (should (equal (test-overlay-regions) | ||
| 1145 | '((1 . 1) (1 . 1) (1 . 2) (2 . 3) (213 . 223) (277 . 334) (334 . 338))))))) | ||
| 1146 | |||
| 1147 | ;; This test used to fail. | ||
| 1148 | (ert-deftest overlay-complex-insert-1 () | ||
| 1149 | (with-temp-buffer | ||
| 1150 | (insert " ") | ||
| 1151 | (make-overlay 8 11 nil nil t) | ||
| 1152 | (make-overlay 2 7 nil nil nil) | ||
| 1153 | (make-overlay 2 4 nil t nil) | ||
| 1154 | (goto-char 1) | ||
| 1155 | (insert " ") | ||
| 1156 | (should (equal (test-overlay-regions) | ||
| 1157 | '((7 . 9) | ||
| 1158 | (7 . 12) | ||
| 1159 | (13 . 16)))))) | ||
| 1160 | |||
| 1161 | ;; This test used to fail. | ||
| 1162 | (ert-deftest overlay-complex-insert-2 () | ||
| 1163 | (with-temp-buffer | ||
| 1164 | (insert (make-string 100 ?\s)) | ||
| 1165 | (make-overlay 77 7 nil nil t) | ||
| 1166 | (make-overlay 21 53 nil t t) | ||
| 1167 | (make-overlay 84 14 nil nil nil) | ||
| 1168 | (make-overlay 38 69 nil t nil) | ||
| 1169 | (make-overlay 93 15 nil nil t) | ||
| 1170 | (make-overlay 73 48 nil t t) | ||
| 1171 | (make-overlay 96 51 nil t t) | ||
| 1172 | (make-overlay 6 43 nil t t) | ||
| 1173 | (make-overlay 15 100 nil t t) | ||
| 1174 | (make-overlay 22 17 nil nil nil) | ||
| 1175 | (make-overlay 72 45 nil t nil) | ||
| 1176 | (make-overlay 2 74 nil nil t) | ||
| 1177 | (make-overlay 15 29 nil t t) | ||
| 1178 | (make-overlay 17 34 nil t t) | ||
| 1179 | (make-overlay 101 66 nil t nil) | ||
| 1180 | (make-overlay 94 24 nil nil nil) | ||
| 1181 | (goto-char 78) | ||
| 1182 | (insert " ") | ||
| 1183 | (narrow-to-region 47 19) | ||
| 1184 | (goto-char 46) | ||
| 1185 | (widen) | ||
| 1186 | (narrow-to-region 13 3) | ||
| 1187 | (goto-char 9) | ||
| 1188 | (delete-char 0) | ||
| 1189 | (goto-char 11) | ||
| 1190 | (insert " ") | ||
| 1191 | (goto-char 3) | ||
| 1192 | (insert " ") | ||
| 1193 | (goto-char 8) | ||
| 1194 | (insert " ") | ||
| 1195 | (goto-char 26) | ||
| 1196 | (insert " ") | ||
| 1197 | (goto-char 14) | ||
| 1198 | (widen) | ||
| 1199 | (narrow-to-region 71 35) | ||
| 1200 | (should | ||
| 1201 | (equal (test-overlay-regions) | ||
| 1202 | '((2 . 104) | ||
| 1203 | (23 . 73) | ||
| 1204 | (24 . 107) | ||
| 1205 | (44 . 125) | ||
| 1206 | (45 . 59) | ||
| 1207 | (45 . 134) | ||
| 1208 | (45 . 141) | ||
| 1209 | (47 . 52) | ||
| 1210 | (47 . 64) | ||
| 1211 | (51 . 83) | ||
| 1212 | (54 . 135) | ||
| 1213 | (68 . 99)))))) | ||
| 1214 | |||
| 1215 | |||
| 1216 | ;; +===================================================================================+ | ||
| 1217 | ;; | Autogenerated insert/delete/narrow tests | ||
| 1218 | ;; +===================================================================================+ | ||
| 1219 | |||
| 1220 | |||
| 1221 | ;; (defun test-overlay-generate-test (name) | ||
| 1222 | ;; (interactive) | ||
| 1223 | ;; (with-temp-buffer | ||
| 1224 | ;; (let ((forms nil) | ||
| 1225 | ;; (buffer-size 64) | ||
| 1226 | ;; (noverlays 16) | ||
| 1227 | ;; (nforms 32) | ||
| 1228 | ;; (dist '(0.5 0.4 0.1))) | ||
| 1229 | ;; (cl-labels ((brand () | ||
| 1230 | ;; (+ (point-min) | ||
| 1231 | ;; (random (1+ (- (point-max) (point-min))))))) | ||
| 1232 | ;; (cl-macrolet ((push-eval (form) | ||
| 1233 | ;; `(cl-destructuring-bind (&rest args) | ||
| 1234 | ;; (list ,@(cdr form)) | ||
| 1235 | ;; (push (cons ',(car form) args) forms) | ||
| 1236 | ;; (apply #',(car form) args)))) | ||
| 1237 | ;; (push-eval (insert (make-string buffer-size ?.))) | ||
| 1238 | ;; (dotimes (_ noverlays) | ||
| 1239 | ;; (push-eval (make-overlay (brand) (brand) | ||
| 1240 | ;; nil | ||
| 1241 | ;; (= 0 (random 2)) | ||
| 1242 | ;; (= 0 (random 2))))) | ||
| 1243 | ;; (dotimes (_ nforms) | ||
| 1244 | ;; (push-eval (goto-char (brand))) | ||
| 1245 | ;; (pcase (/ (random 100) 100.0) | ||
| 1246 | ;; ((and x (guard (< x (nth 0 dist)))) | ||
| 1247 | ;; (push-eval (insert (make-string (random 16) ?.)))) | ||
| 1248 | ;; ((and x (guard (< x (+ (nth 0 dist) (nth 1 dist))))) | ||
| 1249 | ;; (push-eval (delete-char (random (1+ (- (point-max) (point))))))) | ||
| 1250 | ;; (_ | ||
| 1251 | ;; (push-eval (widen)) | ||
| 1252 | ;; (push-eval (narrow-to-region (brand) (brand)))))) | ||
| 1253 | ;; `(ert-deftest ,name () | ||
| 1254 | ;; (with-temp-buffer | ||
| 1255 | ;; ,@(nreverse forms) | ||
| 1256 | ;; (should (equal (test-overlay-regions) | ||
| 1257 | ;; ',(test-overlay-regions)))))))))) | ||
| 1258 | |||
| 1259 | ;; (defun test-overlay-generate-tests (n) | ||
| 1260 | ;; (let ((namefmt "overlay-autogenerated-test-%d") | ||
| 1261 | ;; (standard-output (current-buffer)) | ||
| 1262 | ;; (print-length nil) | ||
| 1263 | ;; (print-level nil) | ||
| 1264 | ;; (print-quoted t)) | ||
| 1265 | ;; (dotimes (i n) | ||
| 1266 | ;; (pp (test-overlay-generate-test (intern (format namefmt i)))) | ||
| 1267 | ;; (terpri)))) | ||
| 1268 | |||
| 1269 | ;; (progn (random "4711") (test-overlay-generate-tests 64)) | ||
| 1270 | |||
| 1271 | (ert-deftest overlay-autogenerated-test-0 nil | ||
| 1272 | (with-temp-buffer | ||
| 1273 | (insert "................................................................") | ||
| 1274 | (make-overlay 63 7 nil t t) | ||
| 1275 | (make-overlay 47 9 nil nil nil) | ||
| 1276 | (make-overlay 50 43 nil nil nil) | ||
| 1277 | (make-overlay 20 53 nil nil t) | ||
| 1278 | (make-overlay 62 4 nil nil t) | ||
| 1279 | (make-overlay 40 27 nil t t) | ||
| 1280 | (make-overlay 58 44 nil t t) | ||
| 1281 | (make-overlay 46 38 nil nil nil) | ||
| 1282 | (make-overlay 51 28 nil t nil) | ||
| 1283 | (make-overlay 12 53 nil t t) | ||
| 1284 | (make-overlay 52 60 nil nil nil) | ||
| 1285 | (make-overlay 13 47 nil nil nil) | ||
| 1286 | (make-overlay 16 31 nil nil nil) | ||
| 1287 | (make-overlay 9 48 nil t t) | ||
| 1288 | (make-overlay 43 29 nil nil t) | ||
| 1289 | (make-overlay 48 13 nil t nil) | ||
| 1290 | (goto-char 44) | ||
| 1291 | (delete-char 15) | ||
| 1292 | (goto-char 19) | ||
| 1293 | (widen) | ||
| 1294 | (narrow-to-region 20 8) | ||
| 1295 | (goto-char 9) | ||
| 1296 | (delete-char 3) | ||
| 1297 | (goto-char 16) | ||
| 1298 | (insert "..............") | ||
| 1299 | (goto-char 12) | ||
| 1300 | (delete-char 15) | ||
| 1301 | (goto-char 12) | ||
| 1302 | (delete-char 4) | ||
| 1303 | (goto-char 12) | ||
| 1304 | (delete-char 0) | ||
| 1305 | (goto-char 12) | ||
| 1306 | (insert "......") | ||
| 1307 | (goto-char 13) | ||
| 1308 | (delete-char 5) | ||
| 1309 | (goto-char 8) | ||
| 1310 | (insert "...") | ||
| 1311 | (goto-char 10) | ||
| 1312 | (insert ".............") | ||
| 1313 | (goto-char 14) | ||
| 1314 | (insert ".......") | ||
| 1315 | (goto-char 25) | ||
| 1316 | (delete-char 4) | ||
| 1317 | (goto-char 26) | ||
| 1318 | (insert "...............") | ||
| 1319 | (goto-char 27) | ||
| 1320 | (insert "...") | ||
| 1321 | (goto-char 29) | ||
| 1322 | (delete-char 7) | ||
| 1323 | (goto-char 24) | ||
| 1324 | (insert "...") | ||
| 1325 | (goto-char 30) | ||
| 1326 | (insert "..........") | ||
| 1327 | (goto-char 29) | ||
| 1328 | (widen) | ||
| 1329 | (narrow-to-region 34 41) | ||
| 1330 | (goto-char 40) | ||
| 1331 | (delete-char 0) | ||
| 1332 | (goto-char 35) | ||
| 1333 | (delete-char 4) | ||
| 1334 | (goto-char 36) | ||
| 1335 | (widen) | ||
| 1336 | (narrow-to-region 80 66) | ||
| 1337 | (goto-char 74) | ||
| 1338 | (delete-char 5) | ||
| 1339 | (goto-char 69) | ||
| 1340 | (delete-char 5) | ||
| 1341 | (goto-char 70) | ||
| 1342 | (widen) | ||
| 1343 | (narrow-to-region 50 71) | ||
| 1344 | (goto-char 66) | ||
| 1345 | (insert "...............") | ||
| 1346 | (goto-char 54) | ||
| 1347 | (insert "...............") | ||
| 1348 | (goto-char 84) | ||
| 1349 | (insert "....") | ||
| 1350 | (goto-char 72) | ||
| 1351 | (insert "...........") | ||
| 1352 | (goto-char 84) | ||
| 1353 | (insert "..........") | ||
| 1354 | (goto-char 102) | ||
| 1355 | (insert "") | ||
| 1356 | (goto-char 80) | ||
| 1357 | (delete-char 25) | ||
| 1358 | (should | ||
| 1359 | (equal | ||
| 1360 | (test-overlay-regions) | ||
| 1361 | '((4 . 99) | ||
| 1362 | (7 . 100) | ||
| 1363 | (48 . 99) | ||
| 1364 | (48 . 99) | ||
| 1365 | (48 . 99) | ||
| 1366 | (49 . 99) | ||
| 1367 | (49 . 99) | ||
| 1368 | (51 . 80) | ||
| 1369 | (51 . 99) | ||
| 1370 | (80 . 99) | ||
| 1371 | (80 . 99) | ||
| 1372 | (80 . 99) | ||
| 1373 | (99 . 99) | ||
| 1374 | (99 . 99) | ||
| 1375 | (99 . 99) | ||
| 1376 | (99 . 99)))))) | ||
| 1377 | |||
| 1378 | (ert-deftest overlay-autogenerated-test-1 nil | ||
| 1379 | (with-temp-buffer | ||
| 1380 | (insert "................................................................") | ||
| 1381 | (make-overlay 17 27 nil nil nil) | ||
| 1382 | (make-overlay 13 28 nil nil t) | ||
| 1383 | (make-overlay 8 56 nil nil nil) | ||
| 1384 | (make-overlay 34 64 nil nil nil) | ||
| 1385 | (make-overlay 51 4 nil t t) | ||
| 1386 | (make-overlay 1 19 nil nil nil) | ||
| 1387 | (make-overlay 53 59 nil nil t) | ||
| 1388 | (make-overlay 25 13 nil nil nil) | ||
| 1389 | (make-overlay 19 28 nil t nil) | ||
| 1390 | (make-overlay 33 23 nil t nil) | ||
| 1391 | (make-overlay 10 46 nil t t) | ||
| 1392 | (make-overlay 18 39 nil nil nil) | ||
| 1393 | (make-overlay 1 49 nil t nil) | ||
| 1394 | (make-overlay 57 21 nil t t) | ||
| 1395 | (make-overlay 10 58 nil t t) | ||
| 1396 | (make-overlay 39 49 nil nil t) | ||
| 1397 | (goto-char 37) | ||
| 1398 | (delete-char 9) | ||
| 1399 | (goto-char 3) | ||
| 1400 | (insert "......") | ||
| 1401 | (goto-char 38) | ||
| 1402 | (delete-char 14) | ||
| 1403 | (goto-char 18) | ||
| 1404 | (insert "..........") | ||
| 1405 | (goto-char 53) | ||
| 1406 | (insert "....") | ||
| 1407 | (goto-char 49) | ||
| 1408 | (delete-char 10) | ||
| 1409 | (goto-char 11) | ||
| 1410 | (delete-char 12) | ||
| 1411 | (goto-char 17) | ||
| 1412 | (delete-char 22) | ||
| 1413 | (goto-char 8) | ||
| 1414 | (insert ".") | ||
| 1415 | (goto-char 16) | ||
| 1416 | (insert "........") | ||
| 1417 | (goto-char 16) | ||
| 1418 | (delete-char 5) | ||
| 1419 | (goto-char 11) | ||
| 1420 | (delete-char 0) | ||
| 1421 | (goto-char 22) | ||
| 1422 | (insert ".......") | ||
| 1423 | (goto-char 18) | ||
| 1424 | (delete-char 11) | ||
| 1425 | (goto-char 16) | ||
| 1426 | (delete-char 0) | ||
| 1427 | (goto-char 9) | ||
| 1428 | (insert "...........") | ||
| 1429 | (goto-char 7) | ||
| 1430 | (insert "...............") | ||
| 1431 | (goto-char 2) | ||
| 1432 | (insert ".......") | ||
| 1433 | (goto-char 21) | ||
| 1434 | (delete-char 11) | ||
| 1435 | (goto-char 13) | ||
| 1436 | (insert "..............") | ||
| 1437 | (goto-char 17) | ||
| 1438 | (delete-char 3) | ||
| 1439 | (goto-char 21) | ||
| 1440 | (insert "......") | ||
| 1441 | (goto-char 15) | ||
| 1442 | (delete-char 32) | ||
| 1443 | (goto-char 10) | ||
| 1444 | (insert "........") | ||
| 1445 | (goto-char 25) | ||
| 1446 | (widen) | ||
| 1447 | (narrow-to-region 15 20) | ||
| 1448 | (goto-char 17) | ||
| 1449 | (insert ".............") | ||
| 1450 | (goto-char 22) | ||
| 1451 | (insert "............") | ||
| 1452 | (goto-char 21) | ||
| 1453 | (delete-char 8) | ||
| 1454 | (goto-char 36) | ||
| 1455 | (delete-char 1) | ||
| 1456 | (goto-char 32) | ||
| 1457 | (delete-char 2) | ||
| 1458 | (goto-char 21) | ||
| 1459 | (insert ".....") | ||
| 1460 | (goto-char 31) | ||
| 1461 | (insert "......") | ||
| 1462 | (should | ||
| 1463 | (equal | ||
| 1464 | (test-overlay-regions) | ||
| 1465 | '((1 . 58) | ||
| 1466 | (1 . 58)))))) | ||
| 1467 | |||
| 1468 | (ert-deftest overlay-autogenerated-test-2 nil | ||
| 1469 | (with-temp-buffer | ||
| 1470 | (insert "................................................................") | ||
| 1471 | (make-overlay 15 59 nil t t) | ||
| 1472 | (make-overlay 56 16 nil nil nil) | ||
| 1473 | (make-overlay 65 51 nil t nil) | ||
| 1474 | (make-overlay 14 24 nil t nil) | ||
| 1475 | (make-overlay 28 9 nil t nil) | ||
| 1476 | (make-overlay 58 50 nil t t) | ||
| 1477 | (make-overlay 13 32 nil t t) | ||
| 1478 | (make-overlay 12 21 nil t nil) | ||
| 1479 | (make-overlay 60 23 nil t nil) | ||
| 1480 | (make-overlay 39 38 nil nil t) | ||
| 1481 | (make-overlay 15 64 nil t nil) | ||
| 1482 | (make-overlay 17 21 nil nil t) | ||
| 1483 | (make-overlay 46 23 nil t t) | ||
| 1484 | (make-overlay 19 40 nil t nil) | ||
| 1485 | (make-overlay 13 48 nil nil t) | ||
| 1486 | (make-overlay 35 11 nil t nil) | ||
| 1487 | (goto-char 41) | ||
| 1488 | (delete-char 19) | ||
| 1489 | (goto-char 45) | ||
| 1490 | (insert "......") | ||
| 1491 | (goto-char 3) | ||
| 1492 | (delete-char 32) | ||
| 1493 | (goto-char 19) | ||
| 1494 | (insert "") | ||
| 1495 | (goto-char 16) | ||
| 1496 | (insert "...............") | ||
| 1497 | (goto-char 2) | ||
| 1498 | (insert "") | ||
| 1499 | (goto-char 30) | ||
| 1500 | (delete-char 0) | ||
| 1501 | (goto-char 18) | ||
| 1502 | (delete-char 17) | ||
| 1503 | (goto-char 2) | ||
| 1504 | (insert "...............") | ||
| 1505 | (goto-char 12) | ||
| 1506 | (insert "...") | ||
| 1507 | (goto-char 2) | ||
| 1508 | (insert ".............") | ||
| 1509 | (goto-char 16) | ||
| 1510 | (insert ".......") | ||
| 1511 | (goto-char 15) | ||
| 1512 | (insert ".......") | ||
| 1513 | (goto-char 43) | ||
| 1514 | (insert "......") | ||
| 1515 | (goto-char 22) | ||
| 1516 | (insert ".........") | ||
| 1517 | (goto-char 25) | ||
| 1518 | (delete-char 1) | ||
| 1519 | (goto-char 38) | ||
| 1520 | (insert "...............") | ||
| 1521 | (goto-char 76) | ||
| 1522 | (delete-char 3) | ||
| 1523 | (goto-char 12) | ||
| 1524 | (delete-char 5) | ||
| 1525 | (goto-char 70) | ||
| 1526 | (delete-char 9) | ||
| 1527 | (goto-char 36) | ||
| 1528 | (delete-char 4) | ||
| 1529 | (goto-char 18) | ||
| 1530 | (insert "...............") | ||
| 1531 | (goto-char 52) | ||
| 1532 | (delete-char 14) | ||
| 1533 | (goto-char 23) | ||
| 1534 | (insert "..........") | ||
| 1535 | (goto-char 64) | ||
| 1536 | (insert "...........") | ||
| 1537 | (goto-char 68) | ||
| 1538 | (delete-char 21) | ||
| 1539 | (goto-char 71) | ||
| 1540 | (insert "........") | ||
| 1541 | (goto-char 28) | ||
| 1542 | (delete-char 43) | ||
| 1543 | (goto-char 25) | ||
| 1544 | (insert "....") | ||
| 1545 | (goto-char 2) | ||
| 1546 | (insert "...............") | ||
| 1547 | (goto-char 40) | ||
| 1548 | (insert "....") | ||
| 1549 | (goto-char 56) | ||
| 1550 | (delete-char 2) | ||
| 1551 | (should | ||
| 1552 | (equal | ||
| 1553 | (test-overlay-regions) | ||
| 1554 | '((51 . 51) | ||
| 1555 | (51 . 51) | ||
| 1556 | (51 . 51) | ||
| 1557 | (51 . 51) | ||
| 1558 | (51 . 51) | ||
| 1559 | (51 . 51) | ||
| 1560 | (51 . 51) | ||
| 1561 | (51 . 51) | ||
| 1562 | (51 . 51) | ||
| 1563 | (51 . 51) | ||
| 1564 | (51 . 51) | ||
| 1565 | (51 . 51) | ||
| 1566 | (51 . 51) | ||
| 1567 | (51 . 51) | ||
| 1568 | (51 . 51) | ||
| 1569 | (51 . 58)))))) | ||
| 1570 | |||
| 1571 | (ert-deftest overlay-autogenerated-test-3 nil | ||
| 1572 | (with-temp-buffer | ||
| 1573 | (insert "................................................................") | ||
| 1574 | (make-overlay 53 38 nil t nil) | ||
| 1575 | (make-overlay 17 40 nil t t) | ||
| 1576 | (make-overlay 64 26 nil t t) | ||
| 1577 | (make-overlay 48 24 nil t nil) | ||
| 1578 | (make-overlay 21 18 nil nil nil) | ||
| 1579 | (make-overlay 2 20 nil nil t) | ||
| 1580 | (make-overlay 43 26 nil t t) | ||
| 1581 | (make-overlay 56 28 nil t nil) | ||
| 1582 | (make-overlay 19 51 nil nil nil) | ||
| 1583 | (make-overlay 39 61 nil t nil) | ||
| 1584 | (make-overlay 59 12 nil t nil) | ||
| 1585 | (make-overlay 65 7 nil t nil) | ||
| 1586 | (make-overlay 41 7 nil t nil) | ||
| 1587 | (make-overlay 62 50 nil t nil) | ||
| 1588 | (make-overlay 7 10 nil t t) | ||
| 1589 | (make-overlay 45 28 nil t nil) | ||
| 1590 | (goto-char 13) | ||
| 1591 | (insert "...") | ||
| 1592 | (goto-char 37) | ||
| 1593 | (widen) | ||
| 1594 | (narrow-to-region 2 10) | ||
| 1595 | (goto-char 8) | ||
| 1596 | (delete-char 1) | ||
| 1597 | (goto-char 3) | ||
| 1598 | (delete-char 6) | ||
| 1599 | (goto-char 2) | ||
| 1600 | (insert "...........") | ||
| 1601 | (goto-char 5) | ||
| 1602 | (widen) | ||
| 1603 | (narrow-to-region 55 70) | ||
| 1604 | (goto-char 55) | ||
| 1605 | (insert "......") | ||
| 1606 | (goto-char 64) | ||
| 1607 | (delete-char 12) | ||
| 1608 | (goto-char 61) | ||
| 1609 | (insert ".....") | ||
| 1610 | (goto-char 64) | ||
| 1611 | (insert "..............") | ||
| 1612 | (goto-char 72) | ||
| 1613 | (delete-char 6) | ||
| 1614 | (goto-char 63) | ||
| 1615 | (delete-char 12) | ||
| 1616 | (goto-char 63) | ||
| 1617 | (delete-char 2) | ||
| 1618 | (goto-char 57) | ||
| 1619 | (insert "..............") | ||
| 1620 | (goto-char 68) | ||
| 1621 | (insert "........") | ||
| 1622 | (goto-char 77) | ||
| 1623 | (delete-char 6) | ||
| 1624 | (goto-char 77) | ||
| 1625 | (insert ".............") | ||
| 1626 | (goto-char 67) | ||
| 1627 | (delete-char 0) | ||
| 1628 | (goto-char 84) | ||
| 1629 | (insert "........") | ||
| 1630 | (goto-char 74) | ||
| 1631 | (delete-char 12) | ||
| 1632 | (goto-char 78) | ||
| 1633 | (insert "...") | ||
| 1634 | (goto-char 80) | ||
| 1635 | (insert "............") | ||
| 1636 | (goto-char 69) | ||
| 1637 | (insert "......") | ||
| 1638 | (goto-char 89) | ||
| 1639 | (insert ".") | ||
| 1640 | (goto-char 56) | ||
| 1641 | (insert "....") | ||
| 1642 | (goto-char 100) | ||
| 1643 | (insert ".............") | ||
| 1644 | (goto-char 114) | ||
| 1645 | (delete-char 0) | ||
| 1646 | (goto-char 61) | ||
| 1647 | (widen) | ||
| 1648 | (narrow-to-region 94 50) | ||
| 1649 | (goto-char 55) | ||
| 1650 | (insert "............") | ||
| 1651 | (goto-char 53) | ||
| 1652 | (insert ".............") | ||
| 1653 | (goto-char 116) | ||
| 1654 | (delete-char 3) | ||
| 1655 | (goto-char 81) | ||
| 1656 | (insert "...............") | ||
| 1657 | (should | ||
| 1658 | (equal | ||
| 1659 | (test-overlay-regions) | ||
| 1660 | '((14 . 166) | ||
| 1661 | (16 . 164) | ||
| 1662 | (26 . 164) | ||
| 1663 | (31 . 68) | ||
| 1664 | (33 . 165) | ||
| 1665 | (35 . 52) | ||
| 1666 | (35 . 164) | ||
| 1667 | (45 . 164) | ||
| 1668 | (46 . 164)))))) | ||
| 1669 | |||
| 1670 | (ert-deftest overlay-autogenerated-test-4 nil | ||
| 1671 | (with-temp-buffer | ||
| 1672 | (insert "................................................................") | ||
| 1673 | (make-overlay 25 15 nil nil t) | ||
| 1674 | (make-overlay 8 13 nil nil nil) | ||
| 1675 | (make-overlay 45 49 nil t t) | ||
| 1676 | (make-overlay 22 13 nil t t) | ||
| 1677 | (make-overlay 34 17 nil nil t) | ||
| 1678 | (make-overlay 42 15 nil nil t) | ||
| 1679 | (make-overlay 43 28 nil t t) | ||
| 1680 | (make-overlay 3 28 nil t nil) | ||
| 1681 | (make-overlay 32 61 nil nil t) | ||
| 1682 | (make-overlay 30 64 nil t t) | ||
| 1683 | (make-overlay 21 39 nil nil t) | ||
| 1684 | (make-overlay 32 62 nil t nil) | ||
| 1685 | (make-overlay 25 29 nil t nil) | ||
| 1686 | (make-overlay 34 43 nil t nil) | ||
| 1687 | (make-overlay 9 11 nil t nil) | ||
| 1688 | (make-overlay 21 65 nil nil t) | ||
| 1689 | (goto-char 21) | ||
| 1690 | (delete-char 4) | ||
| 1691 | (goto-char 25) | ||
| 1692 | (insert "..") | ||
| 1693 | (goto-char 53) | ||
| 1694 | (insert "..") | ||
| 1695 | (goto-char 2) | ||
| 1696 | (insert "...............") | ||
| 1697 | (goto-char 42) | ||
| 1698 | (delete-char 36) | ||
| 1699 | (goto-char 23) | ||
| 1700 | (delete-char 12) | ||
| 1701 | (goto-char 22) | ||
| 1702 | (widen) | ||
| 1703 | (narrow-to-region 30 32) | ||
| 1704 | (goto-char 30) | ||
| 1705 | (delete-char 0) | ||
| 1706 | (goto-char 31) | ||
| 1707 | (delete-char 1) | ||
| 1708 | (goto-char 31) | ||
| 1709 | (widen) | ||
| 1710 | (narrow-to-region 28 27) | ||
| 1711 | (goto-char 27) | ||
| 1712 | (delete-char 1) | ||
| 1713 | (goto-char 27) | ||
| 1714 | (delete-char 0) | ||
| 1715 | (goto-char 27) | ||
| 1716 | (delete-char 0) | ||
| 1717 | (goto-char 27) | ||
| 1718 | (insert ".") | ||
| 1719 | (goto-char 28) | ||
| 1720 | (insert "......") | ||
| 1721 | (goto-char 34) | ||
| 1722 | (delete-char 0) | ||
| 1723 | (goto-char 27) | ||
| 1724 | (delete-char 5) | ||
| 1725 | (goto-char 27) | ||
| 1726 | (delete-char 1) | ||
| 1727 | (goto-char 27) | ||
| 1728 | (insert ".............") | ||
| 1729 | (goto-char 30) | ||
| 1730 | (insert "..............") | ||
| 1731 | (goto-char 37) | ||
| 1732 | (delete-char 15) | ||
| 1733 | (goto-char 32) | ||
| 1734 | (delete-char 2) | ||
| 1735 | (goto-char 36) | ||
| 1736 | (delete-char 1) | ||
| 1737 | (goto-char 34) | ||
| 1738 | (delete-char 0) | ||
| 1739 | (goto-char 34) | ||
| 1740 | (delete-char 1) | ||
| 1741 | (goto-char 32) | ||
| 1742 | (widen) | ||
| 1743 | (narrow-to-region 24 19) | ||
| 1744 | (goto-char 21) | ||
| 1745 | (delete-char 1) | ||
| 1746 | (goto-char 21) | ||
| 1747 | (widen) | ||
| 1748 | (narrow-to-region 11 38) | ||
| 1749 | (goto-char 27) | ||
| 1750 | (widen) | ||
| 1751 | (narrow-to-region 20 22) | ||
| 1752 | (goto-char 20) | ||
| 1753 | (delete-char 1) | ||
| 1754 | (goto-char 20) | ||
| 1755 | (widen) | ||
| 1756 | (narrow-to-region 36 4) | ||
| 1757 | (goto-char 26) | ||
| 1758 | (delete-char 9) | ||
| 1759 | (should | ||
| 1760 | (equal | ||
| 1761 | (test-overlay-regions) | ||
| 1762 | '((18 . 25) | ||
| 1763 | (21 . 21) | ||
| 1764 | (21 . 21) | ||
| 1765 | (21 . 22) | ||
| 1766 | (21 . 22) | ||
| 1767 | (21 . 27) | ||
| 1768 | (21 . 27) | ||
| 1769 | (22 . 25) | ||
| 1770 | (22 . 27) | ||
| 1771 | (22 . 28) | ||
| 1772 | (26 . 27)))))) | ||
| 1773 | |||
| 1774 | (ert-deftest overlay-autogenerated-test-5 nil | ||
| 1775 | (with-temp-buffer | ||
| 1776 | (insert "................................................................") | ||
| 1777 | (make-overlay 64 1 nil nil nil) | ||
| 1778 | (make-overlay 38 43 nil nil nil) | ||
| 1779 | (make-overlay 42 19 nil t nil) | ||
| 1780 | (make-overlay 22 12 nil nil nil) | ||
| 1781 | (make-overlay 12 30 nil t t) | ||
| 1782 | (make-overlay 38 46 nil nil nil) | ||
| 1783 | (make-overlay 18 23 nil nil nil) | ||
| 1784 | (make-overlay 58 65 nil nil t) | ||
| 1785 | (make-overlay 52 41 nil nil nil) | ||
| 1786 | (make-overlay 12 26 nil nil nil) | ||
| 1787 | (make-overlay 39 4 nil nil nil) | ||
| 1788 | (make-overlay 20 1 nil nil t) | ||
| 1789 | (make-overlay 36 60 nil nil nil) | ||
| 1790 | (make-overlay 24 18 nil t nil) | ||
| 1791 | (make-overlay 9 50 nil nil nil) | ||
| 1792 | (make-overlay 19 17 nil t nil) | ||
| 1793 | (goto-char 40) | ||
| 1794 | (insert "") | ||
| 1795 | (goto-char 64) | ||
| 1796 | (insert ".............") | ||
| 1797 | (goto-char 32) | ||
| 1798 | (delete-char 40) | ||
| 1799 | (goto-char 25) | ||
| 1800 | (insert "...") | ||
| 1801 | (goto-char 31) | ||
| 1802 | (delete-char 1) | ||
| 1803 | (goto-char 8) | ||
| 1804 | (delete-char 14) | ||
| 1805 | (goto-char 20) | ||
| 1806 | (delete-char 5) | ||
| 1807 | (goto-char 20) | ||
| 1808 | (insert "...........") | ||
| 1809 | (goto-char 20) | ||
| 1810 | (insert ".........") | ||
| 1811 | (goto-char 17) | ||
| 1812 | (widen) | ||
| 1813 | (narrow-to-region 11 21) | ||
| 1814 | (goto-char 14) | ||
| 1815 | (widen) | ||
| 1816 | (narrow-to-region 9 24) | ||
| 1817 | (goto-char 24) | ||
| 1818 | (insert ".............") | ||
| 1819 | (goto-char 30) | ||
| 1820 | (widen) | ||
| 1821 | (narrow-to-region 47 45) | ||
| 1822 | (goto-char 47) | ||
| 1823 | (insert ".") | ||
| 1824 | (goto-char 46) | ||
| 1825 | (widen) | ||
| 1826 | (narrow-to-region 30 42) | ||
| 1827 | (goto-char 32) | ||
| 1828 | (delete-char 0) | ||
| 1829 | (goto-char 34) | ||
| 1830 | (insert ".......") | ||
| 1831 | (goto-char 42) | ||
| 1832 | (delete-char 4) | ||
| 1833 | (goto-char 39) | ||
| 1834 | (delete-char 6) | ||
| 1835 | (goto-char 31) | ||
| 1836 | (delete-char 6) | ||
| 1837 | (goto-char 31) | ||
| 1838 | (insert "............") | ||
| 1839 | (goto-char 30) | ||
| 1840 | (insert "......") | ||
| 1841 | (goto-char 50) | ||
| 1842 | (delete-char 0) | ||
| 1843 | (goto-char 30) | ||
| 1844 | (insert "....") | ||
| 1845 | (goto-char 53) | ||
| 1846 | (insert "............") | ||
| 1847 | (goto-char 41) | ||
| 1848 | (delete-char 12) | ||
| 1849 | (goto-char 52) | ||
| 1850 | (insert ".......") | ||
| 1851 | (goto-char 56) | ||
| 1852 | (insert "...........") | ||
| 1853 | (goto-char 68) | ||
| 1854 | (insert ".......") | ||
| 1855 | (goto-char 52) | ||
| 1856 | (insert "......") | ||
| 1857 | (goto-char 71) | ||
| 1858 | (delete-char 10) | ||
| 1859 | (goto-char 47) | ||
| 1860 | (insert "") | ||
| 1861 | (should | ||
| 1862 | (equal | ||
| 1863 | (test-overlay-regions) | ||
| 1864 | '((20 . 89)))))) | ||
| 1865 | |||
| 1866 | (ert-deftest overlay-autogenerated-test-6 nil | ||
| 1867 | (with-temp-buffer | ||
| 1868 | (insert "................................................................") | ||
| 1869 | (make-overlay 28 59 nil nil nil) | ||
| 1870 | (make-overlay 36 21 nil t t) | ||
| 1871 | (make-overlay 60 19 nil t nil) | ||
| 1872 | (make-overlay 26 30 nil t nil) | ||
| 1873 | (make-overlay 47 27 nil nil t) | ||
| 1874 | (make-overlay 8 25 nil t t) | ||
| 1875 | (make-overlay 57 43 nil t t) | ||
| 1876 | (make-overlay 28 61 nil nil t) | ||
| 1877 | (make-overlay 42 31 nil nil t) | ||
| 1878 | (make-overlay 15 44 nil t nil) | ||
| 1879 | (make-overlay 56 38 nil nil nil) | ||
| 1880 | (make-overlay 39 44 nil nil t) | ||
| 1881 | (make-overlay 50 6 nil t nil) | ||
| 1882 | (make-overlay 6 19 nil t nil) | ||
| 1883 | (make-overlay 50 44 nil t t) | ||
| 1884 | (make-overlay 34 60 nil nil t) | ||
| 1885 | (goto-char 27) | ||
| 1886 | (insert "...............") | ||
| 1887 | (goto-char 23) | ||
| 1888 | (insert "..............") | ||
| 1889 | (goto-char 50) | ||
| 1890 | (widen) | ||
| 1891 | (narrow-to-region 53 67) | ||
| 1892 | (goto-char 60) | ||
| 1893 | (delete-char 0) | ||
| 1894 | (goto-char 54) | ||
| 1895 | (insert "......") | ||
| 1896 | (goto-char 64) | ||
| 1897 | (delete-char 1) | ||
| 1898 | (goto-char 66) | ||
| 1899 | (delete-char 3) | ||
| 1900 | (goto-char 58) | ||
| 1901 | (insert ".............") | ||
| 1902 | (goto-char 58) | ||
| 1903 | (insert ".........") | ||
| 1904 | (goto-char 76) | ||
| 1905 | (insert "...........") | ||
| 1906 | (goto-char 57) | ||
| 1907 | (insert "....") | ||
| 1908 | (goto-char 106) | ||
| 1909 | (widen) | ||
| 1910 | (narrow-to-region 5 45) | ||
| 1911 | (goto-char 31) | ||
| 1912 | (delete-char 8) | ||
| 1913 | (goto-char 36) | ||
| 1914 | (insert "...") | ||
| 1915 | (goto-char 6) | ||
| 1916 | (insert "........") | ||
| 1917 | (goto-char 33) | ||
| 1918 | (insert ".............") | ||
| 1919 | (goto-char 38) | ||
| 1920 | (delete-char 3) | ||
| 1921 | (goto-char 28) | ||
| 1922 | (delete-char 6) | ||
| 1923 | (goto-char 42) | ||
| 1924 | (widen) | ||
| 1925 | (narrow-to-region 17 25) | ||
| 1926 | (goto-char 19) | ||
| 1927 | (insert "..............") | ||
| 1928 | (goto-char 37) | ||
| 1929 | (delete-char 1) | ||
| 1930 | (goto-char 22) | ||
| 1931 | (delete-char 9) | ||
| 1932 | (goto-char 28) | ||
| 1933 | (insert "..............") | ||
| 1934 | (goto-char 37) | ||
| 1935 | (delete-char 3) | ||
| 1936 | (goto-char 18) | ||
| 1937 | (insert "...............") | ||
| 1938 | (goto-char 30) | ||
| 1939 | (widen) | ||
| 1940 | (narrow-to-region 68 25) | ||
| 1941 | (goto-char 38) | ||
| 1942 | (delete-char 22) | ||
| 1943 | (goto-char 43) | ||
| 1944 | (widen) | ||
| 1945 | (narrow-to-region 47 96) | ||
| 1946 | (goto-char 86) | ||
| 1947 | (insert ".") | ||
| 1948 | (goto-char 63) | ||
| 1949 | (insert "......") | ||
| 1950 | (goto-char 78) | ||
| 1951 | (widen) | ||
| 1952 | (narrow-to-region 61 27) | ||
| 1953 | (goto-char 43) | ||
| 1954 | (delete-char 8) | ||
| 1955 | (should | ||
| 1956 | (equal | ||
| 1957 | (test-overlay-regions) | ||
| 1958 | '((14 . 38) | ||
| 1959 | (14 . 132) | ||
| 1960 | (16 . 43) | ||
| 1961 | (38 . 118) | ||
| 1962 | (38 . 126) | ||
| 1963 | (38 . 142) | ||
| 1964 | (44 . 115) | ||
| 1965 | (45 . 129)))))) | ||
| 1966 | |||
| 1967 | (ert-deftest overlay-autogenerated-test-7 nil | ||
| 1968 | (with-temp-buffer | ||
| 1969 | (insert "................................................................") | ||
| 1970 | (make-overlay 13 50 nil t nil) | ||
| 1971 | (make-overlay 28 44 nil nil t) | ||
| 1972 | (make-overlay 56 27 nil t nil) | ||
| 1973 | (make-overlay 8 34 nil nil nil) | ||
| 1974 | (make-overlay 22 8 nil nil t) | ||
| 1975 | (make-overlay 8 28 nil t nil) | ||
| 1976 | (make-overlay 65 31 nil nil t) | ||
| 1977 | (make-overlay 44 8 nil nil nil) | ||
| 1978 | (make-overlay 52 64 nil nil t) | ||
| 1979 | (make-overlay 52 27 nil t t) | ||
| 1980 | (make-overlay 47 32 nil nil nil) | ||
| 1981 | (make-overlay 18 62 nil nil nil) | ||
| 1982 | (make-overlay 18 24 nil t t) | ||
| 1983 | (make-overlay 33 46 nil nil t) | ||
| 1984 | (make-overlay 20 8 nil t nil) | ||
| 1985 | (make-overlay 51 51 nil t nil) | ||
| 1986 | (goto-char 2) | ||
| 1987 | (delete-char 46) | ||
| 1988 | (goto-char 12) | ||
| 1989 | (delete-char 5) | ||
| 1990 | (goto-char 2) | ||
| 1991 | (delete-char 12) | ||
| 1992 | (goto-char 2) | ||
| 1993 | (insert "..") | ||
| 1994 | (goto-char 2) | ||
| 1995 | (widen) | ||
| 1996 | (narrow-to-region 2 4) | ||
| 1997 | (goto-char 4) | ||
| 1998 | (insert "......") | ||
| 1999 | (goto-char 4) | ||
| 2000 | (widen) | ||
| 2001 | (narrow-to-region 4 6) | ||
| 2002 | (goto-char 5) | ||
| 2003 | (insert "") | ||
| 2004 | (goto-char 6) | ||
| 2005 | (insert "...............") | ||
| 2006 | (goto-char 9) | ||
| 2007 | (insert "...") | ||
| 2008 | (goto-char 7) | ||
| 2009 | (delete-char 13) | ||
| 2010 | (goto-char 8) | ||
| 2011 | (delete-char 1) | ||
| 2012 | (goto-char 9) | ||
| 2013 | (insert "...............") | ||
| 2014 | (goto-char 24) | ||
| 2015 | (delete-char 1) | ||
| 2016 | (goto-char 15) | ||
| 2017 | (insert "...............") | ||
| 2018 | (goto-char 16) | ||
| 2019 | (insert "............") | ||
| 2020 | (goto-char 17) | ||
| 2021 | (delete-char 8) | ||
| 2022 | (goto-char 36) | ||
| 2023 | (widen) | ||
| 2024 | (narrow-to-region 47 38) | ||
| 2025 | (goto-char 43) | ||
| 2026 | (delete-char 0) | ||
| 2027 | (goto-char 46) | ||
| 2028 | (delete-char 0) | ||
| 2029 | (goto-char 40) | ||
| 2030 | (delete-char 4) | ||
| 2031 | (goto-char 39) | ||
| 2032 | (insert ".......") | ||
| 2033 | (goto-char 50) | ||
| 2034 | (delete-char 0) | ||
| 2035 | (goto-char 47) | ||
| 2036 | (insert "...........") | ||
| 2037 | (goto-char 45) | ||
| 2038 | (insert ".....") | ||
| 2039 | (goto-char 38) | ||
| 2040 | (delete-char 3) | ||
| 2041 | (goto-char 59) | ||
| 2042 | (delete-char 1) | ||
| 2043 | (goto-char 42) | ||
| 2044 | (insert "...............") | ||
| 2045 | (goto-char 65) | ||
| 2046 | (insert "...........") | ||
| 2047 | (goto-char 73) | ||
| 2048 | (delete-char 13) | ||
| 2049 | (goto-char 72) | ||
| 2050 | (insert "....") | ||
| 2051 | (goto-char 47) | ||
| 2052 | (insert "..") | ||
| 2053 | (should | ||
| 2054 | (equal | ||
| 2055 | (test-overlay-regions) | ||
| 2056 | '((2 . 81) | ||
| 2057 | (2 . 81) | ||
| 2058 | (2 . 81) | ||
| 2059 | (2 . 81) | ||
| 2060 | (2 . 81) | ||
| 2061 | (81 . 81) | ||
| 2062 | (81 . 81)))))) | ||
| 2063 | |||
| 2064 | (ert-deftest overlay-autogenerated-test-8 nil | ||
| 2065 | (with-temp-buffer | ||
| 2066 | (insert "................................................................") | ||
| 2067 | (make-overlay 20 6 nil t nil) | ||
| 2068 | (make-overlay 48 13 nil t nil) | ||
| 2069 | (make-overlay 58 65 nil nil t) | ||
| 2070 | (make-overlay 63 65 nil nil nil) | ||
| 2071 | (make-overlay 42 40 nil t t) | ||
| 2072 | (make-overlay 40 6 nil nil t) | ||
| 2073 | (make-overlay 37 46 nil t nil) | ||
| 2074 | (make-overlay 4 14 nil nil nil) | ||
| 2075 | (make-overlay 58 44 nil t t) | ||
| 2076 | (make-overlay 14 16 nil nil t) | ||
| 2077 | (make-overlay 31 61 nil t nil) | ||
| 2078 | (make-overlay 34 3 nil nil nil) | ||
| 2079 | (make-overlay 11 16 nil t nil) | ||
| 2080 | (make-overlay 19 42 nil nil t) | ||
| 2081 | (make-overlay 30 9 nil nil t) | ||
| 2082 | (make-overlay 63 52 nil t t) | ||
| 2083 | (goto-char 57) | ||
| 2084 | (delete-char 2) | ||
| 2085 | (goto-char 8) | ||
| 2086 | (insert "........") | ||
| 2087 | (goto-char 30) | ||
| 2088 | (insert "...........") | ||
| 2089 | (goto-char 35) | ||
| 2090 | (insert "...........") | ||
| 2091 | (goto-char 66) | ||
| 2092 | (insert "...............") | ||
| 2093 | (goto-char 53) | ||
| 2094 | (delete-char 15) | ||
| 2095 | (goto-char 75) | ||
| 2096 | (delete-char 10) | ||
| 2097 | (goto-char 62) | ||
| 2098 | (delete-char 21) | ||
| 2099 | (goto-char 52) | ||
| 2100 | (delete-char 10) | ||
| 2101 | (goto-char 10) | ||
| 2102 | (insert "............") | ||
| 2103 | (goto-char 42) | ||
| 2104 | (insert "...........") | ||
| 2105 | (goto-char 68) | ||
| 2106 | (insert ".............") | ||
| 2107 | (goto-char 12) | ||
| 2108 | (insert "........") | ||
| 2109 | (goto-char 1) | ||
| 2110 | (insert "...............") | ||
| 2111 | (goto-char 89) | ||
| 2112 | (insert "") | ||
| 2113 | (goto-char 94) | ||
| 2114 | (insert ".............") | ||
| 2115 | (goto-char 57) | ||
| 2116 | (insert "...........") | ||
| 2117 | (goto-char 130) | ||
| 2118 | (insert "...") | ||
| 2119 | (goto-char 69) | ||
| 2120 | (insert "..") | ||
| 2121 | (goto-char 101) | ||
| 2122 | (insert "......") | ||
| 2123 | (goto-char 128) | ||
| 2124 | (delete-char 13) | ||
| 2125 | (goto-char 19) | ||
| 2126 | (delete-char 100) | ||
| 2127 | (goto-char 22) | ||
| 2128 | (insert "..") | ||
| 2129 | (goto-char 13) | ||
| 2130 | (widen) | ||
| 2131 | (narrow-to-region 30 16) | ||
| 2132 | (goto-char 19) | ||
| 2133 | (insert "..........") | ||
| 2134 | (goto-char 22) | ||
| 2135 | (delete-char 3) | ||
| 2136 | (goto-char 19) | ||
| 2137 | (insert ".........") | ||
| 2138 | (goto-char 17) | ||
| 2139 | (insert "..") | ||
| 2140 | (goto-char 16) | ||
| 2141 | (insert "............") | ||
| 2142 | (goto-char 47) | ||
| 2143 | (insert ".") | ||
| 2144 | (goto-char 50) | ||
| 2145 | (insert "..........") | ||
| 2146 | (goto-char 70) | ||
| 2147 | (delete-char 1) | ||
| 2148 | (should | ||
| 2149 | (equal | ||
| 2150 | (test-overlay-regions) | ||
| 2151 | '((32 . 75) | ||
| 2152 | (33 . 33) | ||
| 2153 | (33 . 33) | ||
| 2154 | (33 . 33) | ||
| 2155 | (33 . 60) | ||
| 2156 | (33 . 75) | ||
| 2157 | (33 . 75) | ||
| 2158 | (33 . 75) | ||
| 2159 | (60 . 75)))))) | ||
| 2160 | |||
| 2161 | (ert-deftest overlay-autogenerated-test-9 nil | ||
| 2162 | (with-temp-buffer | ||
| 2163 | (insert "................................................................") | ||
| 2164 | (make-overlay 58 13 nil nil nil) | ||
| 2165 | (make-overlay 29 4 nil nil t) | ||
| 2166 | (make-overlay 3 53 nil nil nil) | ||
| 2167 | (make-overlay 31 9 nil t t) | ||
| 2168 | (make-overlay 48 30 nil nil nil) | ||
| 2169 | (make-overlay 43 50 nil nil nil) | ||
| 2170 | (make-overlay 7 27 nil nil t) | ||
| 2171 | (make-overlay 30 59 nil nil nil) | ||
| 2172 | (make-overlay 42 25 nil nil t) | ||
| 2173 | (make-overlay 15 13 nil t t) | ||
| 2174 | (make-overlay 39 11 nil t t) | ||
| 2175 | (make-overlay 21 62 nil t t) | ||
| 2176 | (make-overlay 35 2 nil t nil) | ||
| 2177 | (make-overlay 60 53 nil nil t) | ||
| 2178 | (make-overlay 64 8 nil nil t) | ||
| 2179 | (make-overlay 58 59 nil t t) | ||
| 2180 | (goto-char 28) | ||
| 2181 | (insert ".............") | ||
| 2182 | (goto-char 28) | ||
| 2183 | (insert "...............") | ||
| 2184 | (goto-char 71) | ||
| 2185 | (insert ".......") | ||
| 2186 | (goto-char 65) | ||
| 2187 | (insert "......") | ||
| 2188 | (goto-char 3) | ||
| 2189 | (delete-char 12) | ||
| 2190 | (goto-char 79) | ||
| 2191 | (delete-char 11) | ||
| 2192 | (goto-char 65) | ||
| 2193 | (widen) | ||
| 2194 | (narrow-to-region 12 53) | ||
| 2195 | (goto-char 38) | ||
| 2196 | (insert ".......") | ||
| 2197 | (goto-char 20) | ||
| 2198 | (insert ".........") | ||
| 2199 | (goto-char 27) | ||
| 2200 | (insert "...........") | ||
| 2201 | (goto-char 75) | ||
| 2202 | (insert "........") | ||
| 2203 | (goto-char 85) | ||
| 2204 | (insert "............") | ||
| 2205 | (goto-char 52) | ||
| 2206 | (insert "..........") | ||
| 2207 | (goto-char 16) | ||
| 2208 | (delete-char 8) | ||
| 2209 | (goto-char 15) | ||
| 2210 | (insert "...............") | ||
| 2211 | (goto-char 112) | ||
| 2212 | (insert "") | ||
| 2213 | (goto-char 61) | ||
| 2214 | (insert "..") | ||
| 2215 | (goto-char 29) | ||
| 2216 | (delete-char 34) | ||
| 2217 | (goto-char 52) | ||
| 2218 | (delete-char 32) | ||
| 2219 | (goto-char 43) | ||
| 2220 | (insert "........") | ||
| 2221 | (goto-char 45) | ||
| 2222 | (insert "..") | ||
| 2223 | (goto-char 35) | ||
| 2224 | (insert "...........") | ||
| 2225 | (goto-char 29) | ||
| 2226 | (insert ".......") | ||
| 2227 | (goto-char 75) | ||
| 2228 | (widen) | ||
| 2229 | (narrow-to-region 69 55) | ||
| 2230 | (goto-char 67) | ||
| 2231 | (delete-char 2) | ||
| 2232 | (goto-char 66) | ||
| 2233 | (delete-char 0) | ||
| 2234 | (goto-char 62) | ||
| 2235 | (delete-char 1) | ||
| 2236 | (goto-char 61) | ||
| 2237 | (delete-char 3) | ||
| 2238 | (goto-char 63) | ||
| 2239 | (insert ".") | ||
| 2240 | (goto-char 56) | ||
| 2241 | (insert ".....") | ||
| 2242 | (goto-char 67) | ||
| 2243 | (insert ".............") | ||
| 2244 | (goto-char 76) | ||
| 2245 | (delete-char 3) | ||
| 2246 | (should | ||
| 2247 | (equal | ||
| 2248 | (test-overlay-regions) | ||
| 2249 | '((2 . 90) | ||
| 2250 | (3 . 90) | ||
| 2251 | (3 . 90) | ||
| 2252 | (3 . 99) | ||
| 2253 | (3 . 117) | ||
| 2254 | (3 . 117) | ||
| 2255 | (3 . 120) | ||
| 2256 | (9 . 118) | ||
| 2257 | (13 . 102)))))) | ||
| 2258 | |||
| 2259 | (ert-deftest overlay-autogenerated-test-10 nil | ||
| 2260 | (with-temp-buffer | ||
| 2261 | (insert "................................................................") | ||
| 2262 | (make-overlay 16 60 nil nil nil) | ||
| 2263 | (make-overlay 36 53 nil nil nil) | ||
| 2264 | (make-overlay 44 39 nil t t) | ||
| 2265 | (make-overlay 61 47 nil t t) | ||
| 2266 | (make-overlay 58 39 nil nil t) | ||
| 2267 | (make-overlay 23 54 nil nil t) | ||
| 2268 | (make-overlay 65 59 nil t t) | ||
| 2269 | (make-overlay 13 57 nil nil t) | ||
| 2270 | (make-overlay 22 64 nil nil t) | ||
| 2271 | (make-overlay 16 19 nil nil nil) | ||
| 2272 | (make-overlay 16 1 nil nil t) | ||
| 2273 | (make-overlay 28 21 nil t t) | ||
| 2274 | (make-overlay 10 62 nil nil nil) | ||
| 2275 | (make-overlay 12 18 nil nil t) | ||
| 2276 | (make-overlay 15 5 nil nil t) | ||
| 2277 | (make-overlay 36 31 nil nil t) | ||
| 2278 | (goto-char 42) | ||
| 2279 | (insert "...") | ||
| 2280 | (goto-char 25) | ||
| 2281 | (delete-char 28) | ||
| 2282 | (goto-char 30) | ||
| 2283 | (delete-char 10) | ||
| 2284 | (goto-char 8) | ||
| 2285 | (delete-char 9) | ||
| 2286 | (goto-char 5) | ||
| 2287 | (insert "........") | ||
| 2288 | (goto-char 6) | ||
| 2289 | (delete-char 2) | ||
| 2290 | (goto-char 4) | ||
| 2291 | (insert "") | ||
| 2292 | (goto-char 21) | ||
| 2293 | (insert ".............") | ||
| 2294 | (goto-char 6) | ||
| 2295 | (delete-char 33) | ||
| 2296 | (goto-char 1) | ||
| 2297 | (delete-char 1) | ||
| 2298 | (goto-char 6) | ||
| 2299 | (insert "..........") | ||
| 2300 | (goto-char 8) | ||
| 2301 | (insert "...........") | ||
| 2302 | (goto-char 21) | ||
| 2303 | (insert "........") | ||
| 2304 | (goto-char 16) | ||
| 2305 | (delete-char 18) | ||
| 2306 | (goto-char 5) | ||
| 2307 | (insert "...") | ||
| 2308 | (goto-char 5) | ||
| 2309 | (delete-char 8) | ||
| 2310 | (goto-char 11) | ||
| 2311 | (insert ".") | ||
| 2312 | (goto-char 1) | ||
| 2313 | (insert ".......") | ||
| 2314 | (goto-char 9) | ||
| 2315 | (delete-char 9) | ||
| 2316 | (goto-char 5) | ||
| 2317 | (insert "") | ||
| 2318 | (goto-char 8) | ||
| 2319 | (delete-char 0) | ||
| 2320 | (goto-char 11) | ||
| 2321 | (insert "..............") | ||
| 2322 | (goto-char 12) | ||
| 2323 | (insert "") | ||
| 2324 | (goto-char 11) | ||
| 2325 | (delete-char 8) | ||
| 2326 | (goto-char 7) | ||
| 2327 | (delete-char 3) | ||
| 2328 | (goto-char 5) | ||
| 2329 | (delete-char 3) | ||
| 2330 | (goto-char 1) | ||
| 2331 | (delete-char 8) | ||
| 2332 | (goto-char 1) | ||
| 2333 | (insert "....") | ||
| 2334 | (goto-char 1) | ||
| 2335 | (insert "..") | ||
| 2336 | (goto-char 7) | ||
| 2337 | (insert "...") | ||
| 2338 | (goto-char 8) | ||
| 2339 | (widen) | ||
| 2340 | (narrow-to-region 9 11) | ||
| 2341 | (goto-char 11) | ||
| 2342 | (delete-char 0) | ||
| 2343 | (should | ||
| 2344 | (equal | ||
| 2345 | (test-overlay-regions) | ||
| 2346 | '((1 . 10) | ||
| 2347 | (1 . 10) | ||
| 2348 | (1 . 10) | ||
| 2349 | (1 . 10) | ||
| 2350 | (1 . 10) | ||
| 2351 | (1 . 12) | ||
| 2352 | (1 . 12) | ||
| 2353 | (1 . 12) | ||
| 2354 | (10 . 10) | ||
| 2355 | (10 . 10) | ||
| 2356 | (10 . 12)))))) | ||
| 2357 | |||
| 2358 | (ert-deftest overlay-autogenerated-test-11 nil | ||
| 2359 | (with-temp-buffer | ||
| 2360 | (insert "................................................................") | ||
| 2361 | (make-overlay 33 18 nil nil nil) | ||
| 2362 | (make-overlay 56 38 nil t nil) | ||
| 2363 | (make-overlay 2 45 nil nil t) | ||
| 2364 | (make-overlay 19 55 nil nil t) | ||
| 2365 | (make-overlay 28 42 nil t t) | ||
| 2366 | (make-overlay 50 29 nil t nil) | ||
| 2367 | (make-overlay 40 63 nil nil nil) | ||
| 2368 | (make-overlay 13 2 nil nil t) | ||
| 2369 | (make-overlay 26 7 nil t t) | ||
| 2370 | (make-overlay 22 25 nil nil nil) | ||
| 2371 | (make-overlay 14 14 nil t nil) | ||
| 2372 | (make-overlay 15 39 nil t t) | ||
| 2373 | (make-overlay 51 22 nil t t) | ||
| 2374 | (make-overlay 58 5 nil t nil) | ||
| 2375 | (make-overlay 16 10 nil nil nil) | ||
| 2376 | (make-overlay 32 33 nil t nil) | ||
| 2377 | (goto-char 40) | ||
| 2378 | (delete-char 20) | ||
| 2379 | (goto-char 45) | ||
| 2380 | (delete-char 0) | ||
| 2381 | (goto-char 6) | ||
| 2382 | (insert "..") | ||
| 2383 | (goto-char 45) | ||
| 2384 | (insert "...") | ||
| 2385 | (goto-char 26) | ||
| 2386 | (insert "...............") | ||
| 2387 | (goto-char 27) | ||
| 2388 | (insert "...........") | ||
| 2389 | (goto-char 38) | ||
| 2390 | (insert "......") | ||
| 2391 | (goto-char 62) | ||
| 2392 | (insert "...............") | ||
| 2393 | (goto-char 18) | ||
| 2394 | (insert "...........") | ||
| 2395 | (goto-char 99) | ||
| 2396 | (widen) | ||
| 2397 | (narrow-to-region 37 17) | ||
| 2398 | (goto-char 29) | ||
| 2399 | (delete-char 2) | ||
| 2400 | (goto-char 28) | ||
| 2401 | (delete-char 2) | ||
| 2402 | (goto-char 17) | ||
| 2403 | (insert ".....") | ||
| 2404 | (goto-char 21) | ||
| 2405 | (widen) | ||
| 2406 | (narrow-to-region 34 96) | ||
| 2407 | (goto-char 44) | ||
| 2408 | (delete-char 22) | ||
| 2409 | (goto-char 39) | ||
| 2410 | (insert "..") | ||
| 2411 | (goto-char 53) | ||
| 2412 | (insert "...............") | ||
| 2413 | (goto-char 58) | ||
| 2414 | (insert ".............") | ||
| 2415 | (goto-char 93) | ||
| 2416 | (insert ".........") | ||
| 2417 | (goto-char 78) | ||
| 2418 | (widen) | ||
| 2419 | (narrow-to-region 27 104) | ||
| 2420 | (goto-char 93) | ||
| 2421 | (delete-char 11) | ||
| 2422 | (goto-char 59) | ||
| 2423 | (insert "....") | ||
| 2424 | (goto-char 59) | ||
| 2425 | (insert "..............") | ||
| 2426 | (goto-char 74) | ||
| 2427 | (delete-char 5) | ||
| 2428 | (goto-char 70) | ||
| 2429 | (insert ".") | ||
| 2430 | (goto-char 37) | ||
| 2431 | (insert "...........") | ||
| 2432 | (goto-char 34) | ||
| 2433 | (delete-char 46) | ||
| 2434 | (goto-char 49) | ||
| 2435 | (insert "......") | ||
| 2436 | (goto-char 55) | ||
| 2437 | (insert "...") | ||
| 2438 | (goto-char 42) | ||
| 2439 | (insert "...") | ||
| 2440 | (goto-char 70) | ||
| 2441 | (delete-char 8) | ||
| 2442 | (goto-char 48) | ||
| 2443 | (delete-char 28) | ||
| 2444 | (should | ||
| 2445 | (equal | ||
| 2446 | (test-overlay-regions) | ||
| 2447 | '((2 . 62) | ||
| 2448 | (5 . 62) | ||
| 2449 | (9 . 34) | ||
| 2450 | (22 . 61) | ||
| 2451 | (33 . 55) | ||
| 2452 | (33 . 62) | ||
| 2453 | (34 . 34) | ||
| 2454 | (34 . 62)))))) | ||
| 2455 | |||
| 2456 | (ert-deftest overlay-autogenerated-test-12 nil | ||
| 2457 | (with-temp-buffer | ||
| 2458 | (insert "................................................................") | ||
| 2459 | (make-overlay 18 50 nil nil nil) | ||
| 2460 | (make-overlay 63 3 nil nil t) | ||
| 2461 | (make-overlay 44 20 nil t t) | ||
| 2462 | (make-overlay 58 38 nil nil t) | ||
| 2463 | (make-overlay 3 17 nil t nil) | ||
| 2464 | (make-overlay 31 62 nil t nil) | ||
| 2465 | (make-overlay 12 17 nil t nil) | ||
| 2466 | (make-overlay 17 52 nil nil nil) | ||
| 2467 | (make-overlay 9 35 nil nil nil) | ||
| 2468 | (make-overlay 17 38 nil nil nil) | ||
| 2469 | (make-overlay 53 54 nil nil t) | ||
| 2470 | (make-overlay 65 34 nil t nil) | ||
| 2471 | (make-overlay 12 33 nil t nil) | ||
| 2472 | (make-overlay 54 58 nil nil nil) | ||
| 2473 | (make-overlay 42 26 nil t nil) | ||
| 2474 | (make-overlay 2 4 nil t nil) | ||
| 2475 | (goto-char 4) | ||
| 2476 | (delete-char 26) | ||
| 2477 | (goto-char 39) | ||
| 2478 | (insert ".") | ||
| 2479 | (goto-char 2) | ||
| 2480 | (delete-char 14) | ||
| 2481 | (goto-char 16) | ||
| 2482 | (widen) | ||
| 2483 | (narrow-to-region 19 1) | ||
| 2484 | (goto-char 7) | ||
| 2485 | (delete-char 9) | ||
| 2486 | (goto-char 6) | ||
| 2487 | (insert ".........") | ||
| 2488 | (goto-char 6) | ||
| 2489 | (insert "..........") | ||
| 2490 | (goto-char 16) | ||
| 2491 | (insert ".............") | ||
| 2492 | (goto-char 36) | ||
| 2493 | (delete-char 1) | ||
| 2494 | (goto-char 4) | ||
| 2495 | (insert "..........") | ||
| 2496 | (goto-char 49) | ||
| 2497 | (delete-char 2) | ||
| 2498 | (goto-char 16) | ||
| 2499 | (insert "............") | ||
| 2500 | (goto-char 52) | ||
| 2501 | (widen) | ||
| 2502 | (narrow-to-region 36 38) | ||
| 2503 | (goto-char 37) | ||
| 2504 | (delete-char 1) | ||
| 2505 | (goto-char 37) | ||
| 2506 | (insert ".............") | ||
| 2507 | (goto-char 46) | ||
| 2508 | (insert ".") | ||
| 2509 | (goto-char 40) | ||
| 2510 | (delete-char 5) | ||
| 2511 | (goto-char 45) | ||
| 2512 | (delete-char 0) | ||
| 2513 | (goto-char 46) | ||
| 2514 | (delete-char 0) | ||
| 2515 | (goto-char 40) | ||
| 2516 | (insert "..........") | ||
| 2517 | (goto-char 39) | ||
| 2518 | (delete-char 4) | ||
| 2519 | (goto-char 39) | ||
| 2520 | (delete-char 3) | ||
| 2521 | (goto-char 40) | ||
| 2522 | (widen) | ||
| 2523 | (narrow-to-region 8 9) | ||
| 2524 | (goto-char 8) | ||
| 2525 | (delete-char 1) | ||
| 2526 | (goto-char 8) | ||
| 2527 | (delete-char 0) | ||
| 2528 | (goto-char 8) | ||
| 2529 | (widen) | ||
| 2530 | (narrow-to-region 45 15) | ||
| 2531 | (goto-char 40) | ||
| 2532 | (insert "...............") | ||
| 2533 | (goto-char 29) | ||
| 2534 | (delete-char 7) | ||
| 2535 | (goto-char 30) | ||
| 2536 | (delete-char 6) | ||
| 2537 | (goto-char 21) | ||
| 2538 | (delete-char 9) | ||
| 2539 | (goto-char 22) | ||
| 2540 | (insert "...............") | ||
| 2541 | (goto-char 51) | ||
| 2542 | (insert "..............") | ||
| 2543 | (should | ||
| 2544 | (equal | ||
| 2545 | (test-overlay-regions) | ||
| 2546 | '((2 . 92) | ||
| 2547 | (2 . 92) | ||
| 2548 | (2 . 93) | ||
| 2549 | (2 . 96) | ||
| 2550 | (2 . 97) | ||
| 2551 | (2 . 99)))))) | ||
| 2552 | |||
| 2553 | (ert-deftest overlay-autogenerated-test-13 nil | ||
| 2554 | (with-temp-buffer | ||
| 2555 | (insert "................................................................") | ||
| 2556 | (make-overlay 18 30 nil t t) | ||
| 2557 | (make-overlay 54 37 nil nil t) | ||
| 2558 | (make-overlay 16 61 nil nil t) | ||
| 2559 | (make-overlay 58 7 nil nil t) | ||
| 2560 | (make-overlay 27 39 nil nil t) | ||
| 2561 | (make-overlay 39 31 nil nil t) | ||
| 2562 | (make-overlay 11 47 nil nil nil) | ||
| 2563 | (make-overlay 47 40 nil t t) | ||
| 2564 | (make-overlay 27 18 nil nil nil) | ||
| 2565 | (make-overlay 33 26 nil nil t) | ||
| 2566 | (make-overlay 55 4 nil t t) | ||
| 2567 | (make-overlay 62 50 nil t t) | ||
| 2568 | (make-overlay 47 65 nil t t) | ||
| 2569 | (make-overlay 17 23 nil nil t) | ||
| 2570 | (make-overlay 30 31 nil t nil) | ||
| 2571 | (make-overlay 10 37 nil t nil) | ||
| 2572 | (goto-char 8) | ||
| 2573 | (delete-char 6) | ||
| 2574 | (goto-char 56) | ||
| 2575 | (delete-char 0) | ||
| 2576 | (goto-char 28) | ||
| 2577 | (insert ".........") | ||
| 2578 | (goto-char 19) | ||
| 2579 | (insert "..............") | ||
| 2580 | (goto-char 4) | ||
| 2581 | (delete-char 28) | ||
| 2582 | (goto-char 49) | ||
| 2583 | (delete-char 4) | ||
| 2584 | (goto-char 2) | ||
| 2585 | (insert "............") | ||
| 2586 | (goto-char 10) | ||
| 2587 | (delete-char 37) | ||
| 2588 | (goto-char 19) | ||
| 2589 | (delete-char 2) | ||
| 2590 | (goto-char 20) | ||
| 2591 | (delete-char 0) | ||
| 2592 | (goto-char 16) | ||
| 2593 | (insert "..") | ||
| 2594 | (goto-char 8) | ||
| 2595 | (widen) | ||
| 2596 | (narrow-to-region 12 3) | ||
| 2597 | (goto-char 10) | ||
| 2598 | (delete-char 2) | ||
| 2599 | (goto-char 9) | ||
| 2600 | (insert "..") | ||
| 2601 | (goto-char 12) | ||
| 2602 | (insert "...............") | ||
| 2603 | (goto-char 25) | ||
| 2604 | (insert ".....") | ||
| 2605 | (goto-char 10) | ||
| 2606 | (widen) | ||
| 2607 | (narrow-to-region 42 18) | ||
| 2608 | (goto-char 20) | ||
| 2609 | (insert ".......") | ||
| 2610 | (goto-char 18) | ||
| 2611 | (insert ".........") | ||
| 2612 | (goto-char 55) | ||
| 2613 | (delete-char 3) | ||
| 2614 | (goto-char 48) | ||
| 2615 | (insert ".......") | ||
| 2616 | (goto-char 52) | ||
| 2617 | (delete-char 6) | ||
| 2618 | (goto-char 45) | ||
| 2619 | (delete-char 11) | ||
| 2620 | (goto-char 27) | ||
| 2621 | (delete-char 13) | ||
| 2622 | (goto-char 22) | ||
| 2623 | (insert "...........") | ||
| 2624 | (goto-char 19) | ||
| 2625 | (delete-char 15) | ||
| 2626 | (goto-char 20) | ||
| 2627 | (delete-char 0) | ||
| 2628 | (goto-char 23) | ||
| 2629 | (widen) | ||
| 2630 | (narrow-to-region 12 25) | ||
| 2631 | (goto-char 16) | ||
| 2632 | (insert "..........") | ||
| 2633 | (goto-char 25) | ||
| 2634 | (widen) | ||
| 2635 | (narrow-to-region 2 38) | ||
| 2636 | (goto-char 34) | ||
| 2637 | (delete-char 0) | ||
| 2638 | (goto-char 31) | ||
| 2639 | (insert "...............") | ||
| 2640 | (should | ||
| 2641 | (equal | ||
| 2642 | (test-overlay-regions) | ||
| 2643 | '((12 . 12) | ||
| 2644 | (12 . 12) | ||
| 2645 | (12 . 12) | ||
| 2646 | (12 . 12) | ||
| 2647 | (12 . 53) | ||
| 2648 | (12 . 53) | ||
| 2649 | (12 . 53) | ||
| 2650 | (12 . 53) | ||
| 2651 | (12 . 53) | ||
| 2652 | (12 . 53) | ||
| 2653 | (12 . 55)))))) | ||
| 2654 | |||
| 2655 | (ert-deftest overlay-autogenerated-test-14 nil | ||
| 2656 | (with-temp-buffer | ||
| 2657 | (insert "................................................................") | ||
| 2658 | (make-overlay 29 37 nil t nil) | ||
| 2659 | (make-overlay 15 44 nil nil nil) | ||
| 2660 | (make-overlay 31 34 nil nil t) | ||
| 2661 | (make-overlay 35 33 nil t t) | ||
| 2662 | (make-overlay 4 27 nil t t) | ||
| 2663 | (make-overlay 37 5 nil nil t) | ||
| 2664 | (make-overlay 58 19 nil nil t) | ||
| 2665 | (make-overlay 57 47 nil nil t) | ||
| 2666 | (make-overlay 49 5 nil t t) | ||
| 2667 | (make-overlay 21 59 nil t t) | ||
| 2668 | (make-overlay 42 33 nil t nil) | ||
| 2669 | (make-overlay 22 16 nil t t) | ||
| 2670 | (make-overlay 9 51 nil t nil) | ||
| 2671 | (make-overlay 20 24 nil nil t) | ||
| 2672 | (make-overlay 21 7 nil t t) | ||
| 2673 | (make-overlay 58 52 nil t t) | ||
| 2674 | (goto-char 39) | ||
| 2675 | (widen) | ||
| 2676 | (narrow-to-region 55 54) | ||
| 2677 | (goto-char 54) | ||
| 2678 | (insert ".............") | ||
| 2679 | (goto-char 55) | ||
| 2680 | (insert "............") | ||
| 2681 | (goto-char 66) | ||
| 2682 | (delete-char 10) | ||
| 2683 | (goto-char 62) | ||
| 2684 | (insert "...............") | ||
| 2685 | (goto-char 82) | ||
| 2686 | (delete-char 2) | ||
| 2687 | (goto-char 82) | ||
| 2688 | (delete-char 0) | ||
| 2689 | (goto-char 76) | ||
| 2690 | (insert "..............") | ||
| 2691 | (goto-char 60) | ||
| 2692 | (insert ".............") | ||
| 2693 | (goto-char 71) | ||
| 2694 | (insert "...............") | ||
| 2695 | (goto-char 122) | ||
| 2696 | (delete-char 0) | ||
| 2697 | (goto-char 93) | ||
| 2698 | (delete-char 3) | ||
| 2699 | (goto-char 108) | ||
| 2700 | (delete-char 1) | ||
| 2701 | (goto-char 121) | ||
| 2702 | (insert "........") | ||
| 2703 | (goto-char 92) | ||
| 2704 | (insert "") | ||
| 2705 | (goto-char 103) | ||
| 2706 | (insert "..........") | ||
| 2707 | (goto-char 85) | ||
| 2708 | (delete-char 13) | ||
| 2709 | (goto-char 116) | ||
| 2710 | (delete-char 7) | ||
| 2711 | (goto-char 103) | ||
| 2712 | (widen) | ||
| 2713 | (narrow-to-region 60 27) | ||
| 2714 | (goto-char 28) | ||
| 2715 | (delete-char 16) | ||
| 2716 | (goto-char 35) | ||
| 2717 | (insert ".......") | ||
| 2718 | (goto-char 47) | ||
| 2719 | (insert "........") | ||
| 2720 | (goto-char 38) | ||
| 2721 | (delete-char 1) | ||
| 2722 | (goto-char 43) | ||
| 2723 | (insert "..........") | ||
| 2724 | (goto-char 59) | ||
| 2725 | (insert "........") | ||
| 2726 | (goto-char 57) | ||
| 2727 | (insert "........") | ||
| 2728 | (goto-char 36) | ||
| 2729 | (insert "...........") | ||
| 2730 | (goto-char 82) | ||
| 2731 | (delete-char 11) | ||
| 2732 | (goto-char 67) | ||
| 2733 | (insert "..........") | ||
| 2734 | (goto-char 46) | ||
| 2735 | (delete-char 1) | ||
| 2736 | (goto-char 47) | ||
| 2737 | (insert "......") | ||
| 2738 | (goto-char 69) | ||
| 2739 | (delete-char 7) | ||
| 2740 | (should | ||
| 2741 | (equal | ||
| 2742 | (test-overlay-regions) | ||
| 2743 | '((5 . 28) | ||
| 2744 | (5 . 33) | ||
| 2745 | (9 . 35) | ||
| 2746 | (15 . 28) | ||
| 2747 | (19 . 154) | ||
| 2748 | (21 . 155) | ||
| 2749 | (28 . 28) | ||
| 2750 | (28 . 28) | ||
| 2751 | (28 . 28) | ||
| 2752 | (28 . 28) | ||
| 2753 | (31 . 153) | ||
| 2754 | (58 . 154)))))) | ||
| 2755 | |||
| 2756 | (ert-deftest overlay-autogenerated-test-15 nil | ||
| 2757 | (with-temp-buffer | ||
| 2758 | (insert "................................................................") | ||
| 2759 | (make-overlay 3 19 nil t t) | ||
| 2760 | (make-overlay 11 18 nil t nil) | ||
| 2761 | (make-overlay 28 51 nil nil t) | ||
| 2762 | (make-overlay 29 15 nil t t) | ||
| 2763 | (make-overlay 46 57 nil t t) | ||
| 2764 | (make-overlay 26 24 nil nil nil) | ||
| 2765 | (make-overlay 29 43 nil nil nil) | ||
| 2766 | (make-overlay 54 29 nil nil nil) | ||
| 2767 | (make-overlay 34 52 nil t nil) | ||
| 2768 | (make-overlay 10 32 nil nil nil) | ||
| 2769 | (make-overlay 28 34 nil nil t) | ||
| 2770 | (make-overlay 11 43 nil nil nil) | ||
| 2771 | (make-overlay 18 50 nil t t) | ||
| 2772 | (make-overlay 28 39 nil nil nil) | ||
| 2773 | (make-overlay 62 62 nil t t) | ||
| 2774 | (make-overlay 30 62 nil t nil) | ||
| 2775 | (goto-char 30) | ||
| 2776 | (widen) | ||
| 2777 | (narrow-to-region 6 22) | ||
| 2778 | (goto-char 9) | ||
| 2779 | (insert "..") | ||
| 2780 | (goto-char 12) | ||
| 2781 | (insert ".............") | ||
| 2782 | (goto-char 29) | ||
| 2783 | (insert "..............") | ||
| 2784 | (goto-char 47) | ||
| 2785 | (insert "........") | ||
| 2786 | (goto-char 46) | ||
| 2787 | (insert ".............") | ||
| 2788 | (goto-char 55) | ||
| 2789 | (insert "..........") | ||
| 2790 | (goto-char 62) | ||
| 2791 | (insert "...............") | ||
| 2792 | (goto-char 47) | ||
| 2793 | (delete-char 49) | ||
| 2794 | (goto-char 11) | ||
| 2795 | (insert "...........") | ||
| 2796 | (goto-char 40) | ||
| 2797 | (delete-char 1) | ||
| 2798 | (goto-char 27) | ||
| 2799 | (insert "..............") | ||
| 2800 | (goto-char 51) | ||
| 2801 | (insert "......") | ||
| 2802 | (goto-char 60) | ||
| 2803 | (delete-char 10) | ||
| 2804 | (goto-char 37) | ||
| 2805 | (insert ".........") | ||
| 2806 | (goto-char 69) | ||
| 2807 | (insert ".") | ||
| 2808 | (goto-char 36) | ||
| 2809 | (insert "............") | ||
| 2810 | (goto-char 75) | ||
| 2811 | (insert ".............") | ||
| 2812 | (goto-char 21) | ||
| 2813 | (widen) | ||
| 2814 | (narrow-to-region 44 21) | ||
| 2815 | (goto-char 37) | ||
| 2816 | (insert ".............") | ||
| 2817 | (goto-char 55) | ||
| 2818 | (widen) | ||
| 2819 | (narrow-to-region 84 28) | ||
| 2820 | (goto-char 58) | ||
| 2821 | (widen) | ||
| 2822 | (narrow-to-region 96 49) | ||
| 2823 | (goto-char 62) | ||
| 2824 | (delete-char 0) | ||
| 2825 | (goto-char 72) | ||
| 2826 | (delete-char 24) | ||
| 2827 | (goto-char 61) | ||
| 2828 | (widen) | ||
| 2829 | (narrow-to-region 105 83) | ||
| 2830 | (goto-char 96) | ||
| 2831 | (widen) | ||
| 2832 | (narrow-to-region 109 46) | ||
| 2833 | (goto-char 95) | ||
| 2834 | (delete-char 4) | ||
| 2835 | (goto-char 81) | ||
| 2836 | (insert ".") | ||
| 2837 | (goto-char 51) | ||
| 2838 | (delete-char 8) | ||
| 2839 | (goto-char 52) | ||
| 2840 | (insert ".") | ||
| 2841 | (goto-char 60) | ||
| 2842 | (delete-char 10) | ||
| 2843 | (goto-char 50) | ||
| 2844 | (insert "......") | ||
| 2845 | (should | ||
| 2846 | (equal | ||
| 2847 | (test-overlay-regions) | ||
| 2848 | '((3 . 81) | ||
| 2849 | (23 . 88) | ||
| 2850 | (66 . 99) | ||
| 2851 | (69 . 81) | ||
| 2852 | (78 . 85) | ||
| 2853 | (81 . 106) | ||
| 2854 | (84 . 85) | ||
| 2855 | (85 . 90) | ||
| 2856 | (85 . 95) | ||
| 2857 | (85 . 99) | ||
| 2858 | (85 . 107) | ||
| 2859 | (85 . 110) | ||
| 2860 | (86 . 118) | ||
| 2861 | (90 . 108)))))) | ||
| 2862 | |||
| 2863 | (ert-deftest overlay-autogenerated-test-16 nil | ||
| 2864 | (with-temp-buffer | ||
| 2865 | (insert "................................................................") | ||
| 2866 | (make-overlay 3 55 nil t nil) | ||
| 2867 | (make-overlay 45 47 nil nil nil) | ||
| 2868 | (make-overlay 23 57 nil t t) | ||
| 2869 | (make-overlay 64 55 nil nil nil) | ||
| 2870 | (make-overlay 37 26 nil t t) | ||
| 2871 | (make-overlay 29 38 nil nil t) | ||
| 2872 | (make-overlay 33 3 nil t t) | ||
| 2873 | (make-overlay 49 16 nil t nil) | ||
| 2874 | (make-overlay 35 56 nil t t) | ||
| 2875 | (make-overlay 9 39 nil nil nil) | ||
| 2876 | (make-overlay 2 61 nil nil nil) | ||
| 2877 | (make-overlay 59 26 nil nil t) | ||
| 2878 | (make-overlay 5 50 nil t t) | ||
| 2879 | (make-overlay 19 19 nil nil t) | ||
| 2880 | (make-overlay 64 21 nil t nil) | ||
| 2881 | (make-overlay 21 8 nil nil t) | ||
| 2882 | (goto-char 17) | ||
| 2883 | (insert ".....") | ||
| 2884 | (goto-char 29) | ||
| 2885 | (insert "............") | ||
| 2886 | (goto-char 42) | ||
| 2887 | (delete-char 38) | ||
| 2888 | (goto-char 24) | ||
| 2889 | (insert "") | ||
| 2890 | (goto-char 9) | ||
| 2891 | (delete-char 2) | ||
| 2892 | (goto-char 20) | ||
| 2893 | (insert "..") | ||
| 2894 | (goto-char 27) | ||
| 2895 | (delete-char 8) | ||
| 2896 | (goto-char 25) | ||
| 2897 | (delete-char 6) | ||
| 2898 | (goto-char 8) | ||
| 2899 | (delete-char 21) | ||
| 2900 | (goto-char 9) | ||
| 2901 | (insert "..............") | ||
| 2902 | (goto-char 3) | ||
| 2903 | (insert "....") | ||
| 2904 | (goto-char 8) | ||
| 2905 | (delete-char 18) | ||
| 2906 | (goto-char 6) | ||
| 2907 | (widen) | ||
| 2908 | (narrow-to-region 5 8) | ||
| 2909 | (goto-char 5) | ||
| 2910 | (delete-char 3) | ||
| 2911 | (goto-char 5) | ||
| 2912 | (insert "...") | ||
| 2913 | (goto-char 8) | ||
| 2914 | (insert "..........") | ||
| 2915 | (goto-char 5) | ||
| 2916 | (insert "") | ||
| 2917 | (goto-char 7) | ||
| 2918 | (delete-char 8) | ||
| 2919 | (goto-char 8) | ||
| 2920 | (widen) | ||
| 2921 | (narrow-to-region 2 2) | ||
| 2922 | (goto-char 2) | ||
| 2923 | (delete-char 0) | ||
| 2924 | (goto-char 2) | ||
| 2925 | (delete-char 0) | ||
| 2926 | (goto-char 2) | ||
| 2927 | (delete-char 0) | ||
| 2928 | (goto-char 2) | ||
| 2929 | (delete-char 0) | ||
| 2930 | (goto-char 2) | ||
| 2931 | (widen) | ||
| 2932 | (narrow-to-region 10 3) | ||
| 2933 | (goto-char 8) | ||
| 2934 | (delete-char 2) | ||
| 2935 | (goto-char 7) | ||
| 2936 | (insert ".......") | ||
| 2937 | (goto-char 8) | ||
| 2938 | (delete-char 3) | ||
| 2939 | (goto-char 12) | ||
| 2940 | (insert "..") | ||
| 2941 | (goto-char 9) | ||
| 2942 | (delete-char 2) | ||
| 2943 | (goto-char 7) | ||
| 2944 | (insert "......") | ||
| 2945 | (goto-char 15) | ||
| 2946 | (insert "..........") | ||
| 2947 | (goto-char 4) | ||
| 2948 | (insert "........") | ||
| 2949 | (should | ||
| 2950 | (equal | ||
| 2951 | (test-overlay-regions) | ||
| 2952 | '((2 . 13) | ||
| 2953 | (13 . 13) | ||
| 2954 | (13 . 13) | ||
| 2955 | (13 . 13) | ||
| 2956 | (13 . 13) | ||
| 2957 | (13 . 13) | ||
| 2958 | (13 . 13) | ||
| 2959 | (13 . 36) | ||
| 2960 | (13 . 36) | ||
| 2961 | (13 . 36) | ||
| 2962 | (13 . 36)))))) | ||
| 2963 | |||
| 2964 | (ert-deftest overlay-autogenerated-test-17 nil | ||
| 2965 | (with-temp-buffer | ||
| 2966 | (insert "................................................................") | ||
| 2967 | (make-overlay 15 37 nil t nil) | ||
| 2968 | (make-overlay 40 3 nil t t) | ||
| 2969 | (make-overlay 61 19 nil t t) | ||
| 2970 | (make-overlay 46 9 nil nil t) | ||
| 2971 | (make-overlay 64 39 nil nil t) | ||
| 2972 | (make-overlay 50 58 nil nil t) | ||
| 2973 | (make-overlay 21 30 nil t nil) | ||
| 2974 | (make-overlay 44 54 nil t nil) | ||
| 2975 | (make-overlay 32 2 nil t nil) | ||
| 2976 | (make-overlay 14 9 nil t t) | ||
| 2977 | (make-overlay 41 40 nil t nil) | ||
| 2978 | (make-overlay 17 26 nil t nil) | ||
| 2979 | (make-overlay 57 50 nil t t) | ||
| 2980 | (make-overlay 16 65 nil nil t) | ||
| 2981 | (make-overlay 13 61 nil t t) | ||
| 2982 | (make-overlay 39 64 nil nil t) | ||
| 2983 | (goto-char 37) | ||
| 2984 | (widen) | ||
| 2985 | (narrow-to-region 12 1) | ||
| 2986 | (goto-char 12) | ||
| 2987 | (insert "......") | ||
| 2988 | (goto-char 8) | ||
| 2989 | (delete-char 4) | ||
| 2990 | (goto-char 11) | ||
| 2991 | (delete-char 3) | ||
| 2992 | (goto-char 6) | ||
| 2993 | (insert ".....") | ||
| 2994 | (goto-char 6) | ||
| 2995 | (widen) | ||
| 2996 | (narrow-to-region 53 48) | ||
| 2997 | (goto-char 48) | ||
| 2998 | (delete-char 5) | ||
| 2999 | (goto-char 48) | ||
| 3000 | (widen) | ||
| 3001 | (narrow-to-region 59 58) | ||
| 3002 | (goto-char 59) | ||
| 3003 | (delete-char 0) | ||
| 3004 | (goto-char 58) | ||
| 3005 | (insert "...") | ||
| 3006 | (goto-char 60) | ||
| 3007 | (insert "...............") | ||
| 3008 | (goto-char 58) | ||
| 3009 | (insert ".............") | ||
| 3010 | (goto-char 67) | ||
| 3011 | (insert ".....") | ||
| 3012 | (goto-char 73) | ||
| 3013 | (insert "") | ||
| 3014 | (goto-char 68) | ||
| 3015 | (insert ".....") | ||
| 3016 | (goto-char 64) | ||
| 3017 | (insert "....") | ||
| 3018 | (goto-char 62) | ||
| 3019 | (insert "..") | ||
| 3020 | (goto-char 91) | ||
| 3021 | (insert "..........") | ||
| 3022 | (goto-char 80) | ||
| 3023 | (insert "............") | ||
| 3024 | (goto-char 100) | ||
| 3025 | (delete-char 21) | ||
| 3026 | (goto-char 74) | ||
| 3027 | (insert "...") | ||
| 3028 | (goto-char 60) | ||
| 3029 | (delete-char 30) | ||
| 3030 | (goto-char 64) | ||
| 3031 | (widen) | ||
| 3032 | (narrow-to-region 71 23) | ||
| 3033 | (goto-char 53) | ||
| 3034 | (delete-char 11) | ||
| 3035 | (goto-char 23) | ||
| 3036 | (delete-char 21) | ||
| 3037 | (goto-char 39) | ||
| 3038 | (delete-char 0) | ||
| 3039 | (goto-char 35) | ||
| 3040 | (insert "") | ||
| 3041 | (goto-char 35) | ||
| 3042 | (insert ".........") | ||
| 3043 | (goto-char 30) | ||
| 3044 | (insert "...........") | ||
| 3045 | (goto-char 35) | ||
| 3046 | (insert "..") | ||
| 3047 | (goto-char 37) | ||
| 3048 | (delete-char 1) | ||
| 3049 | (goto-char 28) | ||
| 3050 | (delete-char 3) | ||
| 3051 | (should | ||
| 3052 | (equal | ||
| 3053 | (test-overlay-regions) | ||
| 3054 | '((13 . 27) | ||
| 3055 | (17 . 67) | ||
| 3056 | (20 . 71) | ||
| 3057 | (23 . 23) | ||
| 3058 | (23 . 24) | ||
| 3059 | (23 . 67) | ||
| 3060 | (23 . 70) | ||
| 3061 | (23 . 70) | ||
| 3062 | (27 . 41) | ||
| 3063 | (28 . 41) | ||
| 3064 | (28 . 41)))))) | ||
| 3065 | |||
| 3066 | (ert-deftest overlay-autogenerated-test-18 nil | ||
| 3067 | (with-temp-buffer | ||
| 3068 | (insert "................................................................") | ||
| 3069 | (make-overlay 43 52 nil nil t) | ||
| 3070 | (make-overlay 27 29 nil nil t) | ||
| 3071 | (make-overlay 24 18 nil nil nil) | ||
| 3072 | (make-overlay 39 52 nil nil nil) | ||
| 3073 | (make-overlay 33 62 nil t t) | ||
| 3074 | (make-overlay 16 7 nil t nil) | ||
| 3075 | (make-overlay 47 39 nil nil t) | ||
| 3076 | (make-overlay 59 41 nil nil nil) | ||
| 3077 | (make-overlay 22 55 nil nil t) | ||
| 3078 | (make-overlay 60 16 nil t t) | ||
| 3079 | (make-overlay 55 20 nil nil t) | ||
| 3080 | (make-overlay 25 12 nil nil t) | ||
| 3081 | (make-overlay 26 2 nil nil t) | ||
| 3082 | (make-overlay 17 35 nil nil t) | ||
| 3083 | (make-overlay 46 41 nil t nil) | ||
| 3084 | (make-overlay 57 53 nil t t) | ||
| 3085 | (goto-char 52) | ||
| 3086 | (insert "") | ||
| 3087 | (goto-char 4) | ||
| 3088 | (delete-char 21) | ||
| 3089 | (goto-char 17) | ||
| 3090 | (insert "") | ||
| 3091 | (goto-char 35) | ||
| 3092 | (insert "...............") | ||
| 3093 | (goto-char 8) | ||
| 3094 | (insert "...............") | ||
| 3095 | (goto-char 9) | ||
| 3096 | (insert "........") | ||
| 3097 | (goto-char 73) | ||
| 3098 | (delete-char 9) | ||
| 3099 | (goto-char 62) | ||
| 3100 | (insert "...............") | ||
| 3101 | (goto-char 27) | ||
| 3102 | (widen) | ||
| 3103 | (narrow-to-region 34 84) | ||
| 3104 | (goto-char 81) | ||
| 3105 | (insert "...........") | ||
| 3106 | (goto-char 48) | ||
| 3107 | (insert "...") | ||
| 3108 | (goto-char 74) | ||
| 3109 | (insert ".......") | ||
| 3110 | (goto-char 41) | ||
| 3111 | (widen) | ||
| 3112 | (narrow-to-region 37 105) | ||
| 3113 | (goto-char 75) | ||
| 3114 | (insert "...............") | ||
| 3115 | (goto-char 47) | ||
| 3116 | (insert "..........") | ||
| 3117 | (goto-char 99) | ||
| 3118 | (delete-char 13) | ||
| 3119 | (goto-char 105) | ||
| 3120 | (delete-char 4) | ||
| 3121 | (goto-char 94) | ||
| 3122 | (delete-char 5) | ||
| 3123 | (goto-char 96) | ||
| 3124 | (insert "..............") | ||
| 3125 | (goto-char 74) | ||
| 3126 | (insert "") | ||
| 3127 | (goto-char 121) | ||
| 3128 | (insert "...") | ||
| 3129 | (goto-char 102) | ||
| 3130 | (insert "...") | ||
| 3131 | (goto-char 64) | ||
| 3132 | (insert "......") | ||
| 3133 | (goto-char 67) | ||
| 3134 | (insert "...") | ||
| 3135 | (goto-char 95) | ||
| 3136 | (delete-char 19) | ||
| 3137 | (goto-char 37) | ||
| 3138 | (insert "..........") | ||
| 3139 | (goto-char 50) | ||
| 3140 | (widen) | ||
| 3141 | (narrow-to-region 67 96) | ||
| 3142 | (goto-char 88) | ||
| 3143 | (insert "..........") | ||
| 3144 | (goto-char 91) | ||
| 3145 | (insert ".............") | ||
| 3146 | (goto-char 70) | ||
| 3147 | (delete-char 8) | ||
| 3148 | (goto-char 111) | ||
| 3149 | (widen) | ||
| 3150 | (narrow-to-region 72 103) | ||
| 3151 | (goto-char 101) | ||
| 3152 | (insert "...............") | ||
| 3153 | (should | ||
| 3154 | (equal | ||
| 3155 | (test-overlay-regions) | ||
| 3156 | '((4 . 119) | ||
| 3157 | (4 . 119) | ||
| 3158 | (4 . 162) | ||
| 3159 | (35 . 162) | ||
| 3160 | (51 . 78) | ||
| 3161 | (53 . 162) | ||
| 3162 | (55 . 78) | ||
| 3163 | (79 . 162)))))) | ||
| 3164 | |||
| 3165 | (ert-deftest overlay-autogenerated-test-19 nil | ||
| 3166 | (with-temp-buffer | ||
| 3167 | (insert "................................................................") | ||
| 3168 | (make-overlay 19 31 nil t t) | ||
| 3169 | (make-overlay 40 5 nil nil nil) | ||
| 3170 | (make-overlay 13 41 nil t t) | ||
| 3171 | (make-overlay 41 43 nil nil t) | ||
| 3172 | (make-overlay 7 60 nil t nil) | ||
| 3173 | (make-overlay 40 23 nil t nil) | ||
| 3174 | (make-overlay 32 15 nil t t) | ||
| 3175 | (make-overlay 12 45 nil nil nil) | ||
| 3176 | (make-overlay 18 1 nil nil nil) | ||
| 3177 | (make-overlay 58 32 nil t t) | ||
| 3178 | (make-overlay 30 3 nil t t) | ||
| 3179 | (make-overlay 43 61 nil t nil) | ||
| 3180 | (make-overlay 54 57 nil nil t) | ||
| 3181 | (make-overlay 34 14 nil t t) | ||
| 3182 | (make-overlay 26 49 nil nil t) | ||
| 3183 | (make-overlay 54 49 nil nil t) | ||
| 3184 | (goto-char 28) | ||
| 3185 | (insert "........") | ||
| 3186 | (goto-char 32) | ||
| 3187 | (insert "...........") | ||
| 3188 | (goto-char 78) | ||
| 3189 | (delete-char 6) | ||
| 3190 | (goto-char 37) | ||
| 3191 | (delete-char 0) | ||
| 3192 | (goto-char 49) | ||
| 3193 | (insert ".........") | ||
| 3194 | (goto-char 40) | ||
| 3195 | (widen) | ||
| 3196 | (narrow-to-region 8 30) | ||
| 3197 | (goto-char 20) | ||
| 3198 | (delete-char 4) | ||
| 3199 | (goto-char 23) | ||
| 3200 | (delete-char 1) | ||
| 3201 | (goto-char 10) | ||
| 3202 | (insert ".") | ||
| 3203 | (goto-char 22) | ||
| 3204 | (delete-char 2) | ||
| 3205 | (goto-char 22) | ||
| 3206 | (insert "......") | ||
| 3207 | (goto-char 17) | ||
| 3208 | (insert "..........") | ||
| 3209 | (goto-char 34) | ||
| 3210 | (delete-char 0) | ||
| 3211 | (goto-char 21) | ||
| 3212 | (insert "............") | ||
| 3213 | (goto-char 45) | ||
| 3214 | (delete-char 7) | ||
| 3215 | (goto-char 39) | ||
| 3216 | (insert "...............") | ||
| 3217 | (goto-char 29) | ||
| 3218 | (insert "........") | ||
| 3219 | (goto-char 9) | ||
| 3220 | (delete-char 3) | ||
| 3221 | (goto-char 63) | ||
| 3222 | (delete-char 1) | ||
| 3223 | (goto-char 33) | ||
| 3224 | (insert "........") | ||
| 3225 | (goto-char 16) | ||
| 3226 | (delete-char 36) | ||
| 3227 | (goto-char 20) | ||
| 3228 | (delete-char 2) | ||
| 3229 | (goto-char 28) | ||
| 3230 | (delete-char 0) | ||
| 3231 | (goto-char 24) | ||
| 3232 | (insert "...........") | ||
| 3233 | (goto-char 43) | ||
| 3234 | (insert "..........") | ||
| 3235 | (goto-char 30) | ||
| 3236 | (delete-char 1) | ||
| 3237 | (goto-char 40) | ||
| 3238 | (delete-char 13) | ||
| 3239 | (goto-char 22) | ||
| 3240 | (delete-char 19) | ||
| 3241 | (goto-char 10) | ||
| 3242 | (delete-char 8) | ||
| 3243 | (goto-char 14) | ||
| 3244 | (delete-char 0) | ||
| 3245 | (goto-char 12) | ||
| 3246 | (delete-char 2) | ||
| 3247 | (goto-char 11) | ||
| 3248 | (delete-char 0) | ||
| 3249 | (should | ||
| 3250 | (equal | ||
| 3251 | (test-overlay-regions) | ||
| 3252 | '((1 . 12) | ||
| 3253 | (3 . 40) | ||
| 3254 | (5 . 50) | ||
| 3255 | (7 . 69) | ||
| 3256 | (10 . 42) | ||
| 3257 | (10 . 44) | ||
| 3258 | (10 . 51) | ||
| 3259 | (10 . 55)))))) | ||
| 3260 | |||
| 3261 | (ert-deftest overlay-autogenerated-test-20 nil | ||
| 3262 | (with-temp-buffer | ||
| 3263 | (insert "................................................................") | ||
| 3264 | (make-overlay 44 42 nil t t) | ||
| 3265 | (make-overlay 47 1 nil nil nil) | ||
| 3266 | (make-overlay 24 48 nil nil nil) | ||
| 3267 | (make-overlay 62 50 nil nil t) | ||
| 3268 | (make-overlay 54 38 nil nil nil) | ||
| 3269 | (make-overlay 3 9 nil nil nil) | ||
| 3270 | (make-overlay 61 28 nil t nil) | ||
| 3271 | (make-overlay 33 33 nil nil t) | ||
| 3272 | (make-overlay 37 37 nil t nil) | ||
| 3273 | (make-overlay 20 13 nil nil t) | ||
| 3274 | (make-overlay 54 36 nil t nil) | ||
| 3275 | (make-overlay 18 58 nil nil t) | ||
| 3276 | (make-overlay 55 3 nil nil t) | ||
| 3277 | (make-overlay 23 21 nil t t) | ||
| 3278 | (make-overlay 47 55 nil t t) | ||
| 3279 | (make-overlay 50 12 nil nil nil) | ||
| 3280 | (goto-char 11) | ||
| 3281 | (delete-char 46) | ||
| 3282 | (goto-char 7) | ||
| 3283 | (delete-char 3) | ||
| 3284 | (goto-char 14) | ||
| 3285 | (delete-char 1) | ||
| 3286 | (goto-char 14) | ||
| 3287 | (insert "......") | ||
| 3288 | (goto-char 14) | ||
| 3289 | (delete-char 4) | ||
| 3290 | (goto-char 12) | ||
| 3291 | (widen) | ||
| 3292 | (narrow-to-region 11 12) | ||
| 3293 | (goto-char 11) | ||
| 3294 | (insert "...") | ||
| 3295 | (goto-char 13) | ||
| 3296 | (delete-char 1) | ||
| 3297 | (goto-char 14) | ||
| 3298 | (insert ".") | ||
| 3299 | (goto-char 13) | ||
| 3300 | (delete-char 2) | ||
| 3301 | (goto-char 11) | ||
| 3302 | (delete-char 2) | ||
| 3303 | (goto-char 11) | ||
| 3304 | (insert "") | ||
| 3305 | (goto-char 11) | ||
| 3306 | (delete-char 0) | ||
| 3307 | (goto-char 11) | ||
| 3308 | (delete-char 0) | ||
| 3309 | (goto-char 11) | ||
| 3310 | (delete-char 0) | ||
| 3311 | (goto-char 11) | ||
| 3312 | (insert ".") | ||
| 3313 | (goto-char 11) | ||
| 3314 | (insert ".") | ||
| 3315 | (goto-char 12) | ||
| 3316 | (insert "......") | ||
| 3317 | (goto-char 14) | ||
| 3318 | (delete-char 2) | ||
| 3319 | (goto-char 11) | ||
| 3320 | (delete-char 2) | ||
| 3321 | (goto-char 14) | ||
| 3322 | (insert "............") | ||
| 3323 | (goto-char 19) | ||
| 3324 | (insert "..............") | ||
| 3325 | (goto-char 29) | ||
| 3326 | (insert ".....") | ||
| 3327 | (goto-char 42) | ||
| 3328 | (delete-char 1) | ||
| 3329 | (goto-char 22) | ||
| 3330 | (insert ".....") | ||
| 3331 | (goto-char 19) | ||
| 3332 | (insert "..............") | ||
| 3333 | (goto-char 42) | ||
| 3334 | (insert ".....") | ||
| 3335 | (goto-char 63) | ||
| 3336 | (widen) | ||
| 3337 | (narrow-to-region 26 42) | ||
| 3338 | (goto-char 36) | ||
| 3339 | (insert "..........") | ||
| 3340 | (goto-char 40) | ||
| 3341 | (delete-char 11) | ||
| 3342 | (goto-char 26) | ||
| 3343 | (delete-char 13) | ||
| 3344 | (goto-char 28) | ||
| 3345 | (delete-char 0) | ||
| 3346 | (should | ||
| 3347 | (equal | ||
| 3348 | (test-overlay-regions) | ||
| 3349 | '((8 . 56)))))) | ||
| 3350 | |||
| 3351 | (ert-deftest overlay-autogenerated-test-21 nil | ||
| 3352 | (with-temp-buffer | ||
| 3353 | (insert "................................................................") | ||
| 3354 | (make-overlay 65 15 nil nil nil) | ||
| 3355 | (make-overlay 52 31 nil nil nil) | ||
| 3356 | (make-overlay 12 51 nil t t) | ||
| 3357 | (make-overlay 42 20 nil nil t) | ||
| 3358 | (make-overlay 51 48 nil nil nil) | ||
| 3359 | (make-overlay 59 28 nil t t) | ||
| 3360 | (make-overlay 51 53 nil t nil) | ||
| 3361 | (make-overlay 50 59 nil nil t) | ||
| 3362 | (make-overlay 24 40 nil t nil) | ||
| 3363 | (make-overlay 51 61 nil nil nil) | ||
| 3364 | (make-overlay 12 58 nil nil t) | ||
| 3365 | (make-overlay 64 17 nil t t) | ||
| 3366 | (make-overlay 26 38 nil t t) | ||
| 3367 | (make-overlay 23 36 nil nil nil) | ||
| 3368 | (make-overlay 57 50 nil nil nil) | ||
| 3369 | (make-overlay 42 15 nil nil t) | ||
| 3370 | (goto-char 14) | ||
| 3371 | (insert "............") | ||
| 3372 | (goto-char 37) | ||
| 3373 | (insert ".") | ||
| 3374 | (goto-char 73) | ||
| 3375 | (insert "..........") | ||
| 3376 | (goto-char 17) | ||
| 3377 | (delete-char 31) | ||
| 3378 | (goto-char 21) | ||
| 3379 | (delete-char 35) | ||
| 3380 | (goto-char 9) | ||
| 3381 | (delete-char 0) | ||
| 3382 | (goto-char 7) | ||
| 3383 | (delete-char 2) | ||
| 3384 | (goto-char 1) | ||
| 3385 | (insert "") | ||
| 3386 | (goto-char 5) | ||
| 3387 | (insert ".......") | ||
| 3388 | (goto-char 8) | ||
| 3389 | (insert "....") | ||
| 3390 | (goto-char 27) | ||
| 3391 | (delete-char 0) | ||
| 3392 | (goto-char 10) | ||
| 3393 | (insert ".............") | ||
| 3394 | (goto-char 24) | ||
| 3395 | (delete-char 16) | ||
| 3396 | (goto-char 14) | ||
| 3397 | (insert ".............") | ||
| 3398 | (goto-char 25) | ||
| 3399 | (delete-char 11) | ||
| 3400 | (goto-char 3) | ||
| 3401 | (insert "........") | ||
| 3402 | (goto-char 38) | ||
| 3403 | (insert "............") | ||
| 3404 | (goto-char 41) | ||
| 3405 | (insert "..............") | ||
| 3406 | (goto-char 56) | ||
| 3407 | (delete-char 3) | ||
| 3408 | (goto-char 15) | ||
| 3409 | (widen) | ||
| 3410 | (narrow-to-region 16 53) | ||
| 3411 | (goto-char 19) | ||
| 3412 | (widen) | ||
| 3413 | (narrow-to-region 18 33) | ||
| 3414 | (goto-char 32) | ||
| 3415 | (insert "......") | ||
| 3416 | (goto-char 38) | ||
| 3417 | (delete-char 1) | ||
| 3418 | (goto-char 19) | ||
| 3419 | (widen) | ||
| 3420 | (narrow-to-region 11 11) | ||
| 3421 | (goto-char 11) | ||
| 3422 | (insert ".........") | ||
| 3423 | (goto-char 11) | ||
| 3424 | (insert ".........") | ||
| 3425 | (goto-char 20) | ||
| 3426 | (widen) | ||
| 3427 | (narrow-to-region 22 69) | ||
| 3428 | (goto-char 49) | ||
| 3429 | (insert ".........") | ||
| 3430 | (goto-char 54) | ||
| 3431 | (delete-char 22) | ||
| 3432 | (goto-char 44) | ||
| 3433 | (insert "........") | ||
| 3434 | (goto-char 40) | ||
| 3435 | (delete-char 7) | ||
| 3436 | (goto-char 29) | ||
| 3437 | (delete-char 22) | ||
| 3438 | (should | ||
| 3439 | (equal | ||
| 3440 | (test-overlay-regions) | ||
| 3441 | '((33 . 33) | ||
| 3442 | (33 . 33) | ||
| 3443 | (33 . 33) | ||
| 3444 | (33 . 33) | ||
| 3445 | (33 . 33) | ||
| 3446 | (33 . 33) | ||
| 3447 | (33 . 33) | ||
| 3448 | (33 . 33) | ||
| 3449 | (33 . 33) | ||
| 3450 | (33 . 33) | ||
| 3451 | (33 . 33) | ||
| 3452 | (33 . 33) | ||
| 3453 | (33 . 33) | ||
| 3454 | (33 . 33) | ||
| 3455 | (33 . 33) | ||
| 3456 | (33 . 33)))))) | ||
| 3457 | |||
| 3458 | (ert-deftest overlay-autogenerated-test-22 nil | ||
| 3459 | (with-temp-buffer | ||
| 3460 | (insert "................................................................") | ||
| 3461 | (make-overlay 12 14 nil nil t) | ||
| 3462 | (make-overlay 54 7 nil nil t) | ||
| 3463 | (make-overlay 8 3 nil nil nil) | ||
| 3464 | (make-overlay 42 32 nil nil nil) | ||
| 3465 | (make-overlay 10 27 nil t t) | ||
| 3466 | (make-overlay 50 28 nil t t) | ||
| 3467 | (make-overlay 39 35 nil nil nil) | ||
| 3468 | (make-overlay 12 4 nil t t) | ||
| 3469 | (make-overlay 29 54 nil nil nil) | ||
| 3470 | (make-overlay 14 52 nil t t) | ||
| 3471 | (make-overlay 9 15 nil t nil) | ||
| 3472 | (make-overlay 44 11 nil nil nil) | ||
| 3473 | (make-overlay 46 29 nil t t) | ||
| 3474 | (make-overlay 40 58 nil t t) | ||
| 3475 | (make-overlay 40 61 nil t nil) | ||
| 3476 | (make-overlay 13 59 nil nil t) | ||
| 3477 | (goto-char 32) | ||
| 3478 | (insert ".............") | ||
| 3479 | (goto-char 25) | ||
| 3480 | (delete-char 10) | ||
| 3481 | (goto-char 3) | ||
| 3482 | (insert ".............") | ||
| 3483 | (goto-char 33) | ||
| 3484 | (delete-char 32) | ||
| 3485 | (goto-char 39) | ||
| 3486 | (widen) | ||
| 3487 | (narrow-to-region 41 46) | ||
| 3488 | (goto-char 43) | ||
| 3489 | (delete-char 2) | ||
| 3490 | (goto-char 42) | ||
| 3491 | (delete-char 2) | ||
| 3492 | (goto-char 42) | ||
| 3493 | (insert "...") | ||
| 3494 | (goto-char 43) | ||
| 3495 | (delete-char 1) | ||
| 3496 | (goto-char 42) | ||
| 3497 | (widen) | ||
| 3498 | (narrow-to-region 8 46) | ||
| 3499 | (goto-char 25) | ||
| 3500 | (delete-char 7) | ||
| 3501 | (goto-char 12) | ||
| 3502 | (delete-char 10) | ||
| 3503 | (goto-char 23) | ||
| 3504 | (insert "...............") | ||
| 3505 | (goto-char 41) | ||
| 3506 | (delete-char 3) | ||
| 3507 | (goto-char 17) | ||
| 3508 | (insert ".........") | ||
| 3509 | (goto-char 37) | ||
| 3510 | (insert "...............") | ||
| 3511 | (goto-char 53) | ||
| 3512 | (delete-char 7) | ||
| 3513 | (goto-char 53) | ||
| 3514 | (delete-char 0) | ||
| 3515 | (goto-char 42) | ||
| 3516 | (widen) | ||
| 3517 | (narrow-to-region 20 54) | ||
| 3518 | (goto-char 20) | ||
| 3519 | (delete-char 28) | ||
| 3520 | (goto-char 23) | ||
| 3521 | (insert "..........") | ||
| 3522 | (goto-char 30) | ||
| 3523 | (insert "......") | ||
| 3524 | (goto-char 26) | ||
| 3525 | (delete-char 1) | ||
| 3526 | (goto-char 27) | ||
| 3527 | (widen) | ||
| 3528 | (narrow-to-region 40 37) | ||
| 3529 | (goto-char 37) | ||
| 3530 | (insert ".....") | ||
| 3531 | (goto-char 41) | ||
| 3532 | (widen) | ||
| 3533 | (narrow-to-region 13 37) | ||
| 3534 | (goto-char 29) | ||
| 3535 | (insert "...........") | ||
| 3536 | (goto-char 33) | ||
| 3537 | (delete-char 7) | ||
| 3538 | (goto-char 33) | ||
| 3539 | (delete-char 8) | ||
| 3540 | (goto-char 20) | ||
| 3541 | (insert "") | ||
| 3542 | (goto-char 23) | ||
| 3543 | (delete-char 7) | ||
| 3544 | (goto-char 14) | ||
| 3545 | (widen) | ||
| 3546 | (narrow-to-region 33 33) | ||
| 3547 | (should | ||
| 3548 | (equal | ||
| 3549 | (test-overlay-regions) | ||
| 3550 | '((15 . 39) | ||
| 3551 | (16 . 38) | ||
| 3552 | (16 . 39)))))) | ||
| 3553 | |||
| 3554 | (ert-deftest overlay-autogenerated-test-23 nil | ||
| 3555 | (with-temp-buffer | ||
| 3556 | (insert "................................................................") | ||
| 3557 | (make-overlay 51 32 nil t t) | ||
| 3558 | (make-overlay 13 61 nil t nil) | ||
| 3559 | (make-overlay 47 19 nil nil t) | ||
| 3560 | (make-overlay 11 30 nil nil nil) | ||
| 3561 | (make-overlay 50 26 nil t t) | ||
| 3562 | (make-overlay 64 13 nil t t) | ||
| 3563 | (make-overlay 29 8 nil t t) | ||
| 3564 | (make-overlay 25 42 nil t t) | ||
| 3565 | (make-overlay 33 28 nil t t) | ||
| 3566 | (make-overlay 54 7 nil nil nil) | ||
| 3567 | (make-overlay 30 59 nil nil nil) | ||
| 3568 | (make-overlay 65 50 nil t t) | ||
| 3569 | (make-overlay 64 15 nil t nil) | ||
| 3570 | (make-overlay 16 35 nil nil nil) | ||
| 3571 | (make-overlay 40 36 nil nil t) | ||
| 3572 | (make-overlay 31 35 nil t nil) | ||
| 3573 | (goto-char 61) | ||
| 3574 | (insert "......") | ||
| 3575 | (goto-char 55) | ||
| 3576 | (delete-char 2) | ||
| 3577 | (goto-char 20) | ||
| 3578 | (insert "..............") | ||
| 3579 | (goto-char 56) | ||
| 3580 | (insert "............") | ||
| 3581 | (goto-char 48) | ||
| 3582 | (delete-char 6) | ||
| 3583 | (goto-char 9) | ||
| 3584 | (delete-char 54) | ||
| 3585 | (goto-char 20) | ||
| 3586 | (delete-char 2) | ||
| 3587 | (goto-char 16) | ||
| 3588 | (delete-char 12) | ||
| 3589 | (goto-char 18) | ||
| 3590 | (insert ".............") | ||
| 3591 | (goto-char 24) | ||
| 3592 | (delete-char 7) | ||
| 3593 | (goto-char 5) | ||
| 3594 | (delete-char 2) | ||
| 3595 | (goto-char 1) | ||
| 3596 | (insert ".......") | ||
| 3597 | (goto-char 1) | ||
| 3598 | (insert ".......") | ||
| 3599 | (goto-char 33) | ||
| 3600 | (insert "") | ||
| 3601 | (goto-char 4) | ||
| 3602 | (insert "..") | ||
| 3603 | (goto-char 5) | ||
| 3604 | (widen) | ||
| 3605 | (narrow-to-region 17 4) | ||
| 3606 | (goto-char 13) | ||
| 3607 | (insert ".") | ||
| 3608 | (goto-char 8) | ||
| 3609 | (insert "............") | ||
| 3610 | (goto-char 9) | ||
| 3611 | (delete-char 3) | ||
| 3612 | (goto-char 4) | ||
| 3613 | (widen) | ||
| 3614 | (narrow-to-region 32 32) | ||
| 3615 | (goto-char 32) | ||
| 3616 | (delete-char 0) | ||
| 3617 | (goto-char 32) | ||
| 3618 | (delete-char 0) | ||
| 3619 | (goto-char 32) | ||
| 3620 | (delete-char 0) | ||
| 3621 | (goto-char 32) | ||
| 3622 | (insert "...............") | ||
| 3623 | (goto-char 43) | ||
| 3624 | (delete-char 4) | ||
| 3625 | (goto-char 32) | ||
| 3626 | (delete-char 1) | ||
| 3627 | (goto-char 40) | ||
| 3628 | (widen) | ||
| 3629 | (narrow-to-region 33 19) | ||
| 3630 | (goto-char 27) | ||
| 3631 | (insert "........") | ||
| 3632 | (goto-char 38) | ||
| 3633 | (delete-char 2) | ||
| 3634 | (goto-char 26) | ||
| 3635 | (insert "") | ||
| 3636 | (goto-char 33) | ||
| 3637 | (delete-char 1) | ||
| 3638 | (goto-char 27) | ||
| 3639 | (insert ".") | ||
| 3640 | (should | ||
| 3641 | (equal | ||
| 3642 | (test-overlay-regions) | ||
| 3643 | '((38 . 56)))))) | ||
| 3644 | |||
| 3645 | (ert-deftest overlay-autogenerated-test-24 nil | ||
| 3646 | (with-temp-buffer | ||
| 3647 | (insert "................................................................") | ||
| 3648 | (make-overlay 63 8 nil t t) | ||
| 3649 | (make-overlay 10 13 nil nil t) | ||
| 3650 | (make-overlay 40 38 nil nil nil) | ||
| 3651 | (make-overlay 21 34 nil t t) | ||
| 3652 | (make-overlay 55 29 nil nil nil) | ||
| 3653 | (make-overlay 36 65 nil t t) | ||
| 3654 | (make-overlay 29 12 nil t nil) | ||
| 3655 | (make-overlay 41 3 nil nil t) | ||
| 3656 | (make-overlay 20 9 nil t t) | ||
| 3657 | (make-overlay 52 42 nil t t) | ||
| 3658 | (make-overlay 21 56 nil nil t) | ||
| 3659 | (make-overlay 25 65 nil nil nil) | ||
| 3660 | (make-overlay 38 4 nil t t) | ||
| 3661 | (make-overlay 48 23 nil t t) | ||
| 3662 | (make-overlay 52 9 nil nil t) | ||
| 3663 | (make-overlay 48 19 nil nil nil) | ||
| 3664 | (goto-char 43) | ||
| 3665 | (delete-char 8) | ||
| 3666 | (goto-char 30) | ||
| 3667 | (delete-char 16) | ||
| 3668 | (goto-char 7) | ||
| 3669 | (insert "...") | ||
| 3670 | (goto-char 14) | ||
| 3671 | (delete-char 5) | ||
| 3672 | (goto-char 36) | ||
| 3673 | (delete-char 0) | ||
| 3674 | (goto-char 9) | ||
| 3675 | (insert "...............") | ||
| 3676 | (goto-char 13) | ||
| 3677 | (delete-char 17) | ||
| 3678 | (goto-char 16) | ||
| 3679 | (delete-char 2) | ||
| 3680 | (goto-char 9) | ||
| 3681 | (insert "") | ||
| 3682 | (goto-char 11) | ||
| 3683 | (delete-char 5) | ||
| 3684 | (goto-char 18) | ||
| 3685 | (insert "........") | ||
| 3686 | (goto-char 15) | ||
| 3687 | (insert "....") | ||
| 3688 | (goto-char 16) | ||
| 3689 | (delete-char 14) | ||
| 3690 | (goto-char 20) | ||
| 3691 | (insert ".") | ||
| 3692 | (goto-char 25) | ||
| 3693 | (delete-char 1) | ||
| 3694 | (goto-char 14) | ||
| 3695 | (delete-char 14) | ||
| 3696 | (goto-char 3) | ||
| 3697 | (delete-char 7) | ||
| 3698 | (goto-char 3) | ||
| 3699 | (delete-char 4) | ||
| 3700 | (goto-char 1) | ||
| 3701 | (insert "...........") | ||
| 3702 | (goto-char 9) | ||
| 3703 | (insert ".......") | ||
| 3704 | (goto-char 5) | ||
| 3705 | (delete-char 7) | ||
| 3706 | (goto-char 12) | ||
| 3707 | (insert ".........") | ||
| 3708 | (goto-char 2) | ||
| 3709 | (delete-char 4) | ||
| 3710 | (goto-char 3) | ||
| 3711 | (widen) | ||
| 3712 | (narrow-to-region 14 6) | ||
| 3713 | (goto-char 9) | ||
| 3714 | (insert "..........") | ||
| 3715 | (goto-char 13) | ||
| 3716 | (delete-char 8) | ||
| 3717 | (goto-char 7) | ||
| 3718 | (delete-char 7) | ||
| 3719 | (goto-char 7) | ||
| 3720 | (insert "..") | ||
| 3721 | (goto-char 9) | ||
| 3722 | (insert ".............") | ||
| 3723 | (goto-char 9) | ||
| 3724 | (insert "..........") | ||
| 3725 | (goto-char 21) | ||
| 3726 | (insert "...............") | ||
| 3727 | (goto-char 42) | ||
| 3728 | (insert ".........") | ||
| 3729 | (should | ||
| 3730 | (equal | ||
| 3731 | (test-overlay-regions) | ||
| 3732 | 'nil)))) | ||
| 3733 | |||
| 3734 | (ert-deftest overlay-autogenerated-test-25 nil | ||
| 3735 | (with-temp-buffer | ||
| 3736 | (insert "................................................................") | ||
| 3737 | (make-overlay 24 8 nil nil t) | ||
| 3738 | (make-overlay 41 16 nil t nil) | ||
| 3739 | (make-overlay 3 16 nil nil nil) | ||
| 3740 | (make-overlay 26 42 nil nil nil) | ||
| 3741 | (make-overlay 32 45 nil nil t) | ||
| 3742 | (make-overlay 34 19 nil nil nil) | ||
| 3743 | (make-overlay 37 54 nil nil t) | ||
| 3744 | (make-overlay 44 34 nil t nil) | ||
| 3745 | (make-overlay 49 40 nil t t) | ||
| 3746 | (make-overlay 29 34 nil t nil) | ||
| 3747 | (make-overlay 54 16 nil t t) | ||
| 3748 | (make-overlay 29 4 nil t nil) | ||
| 3749 | (make-overlay 44 57 nil nil nil) | ||
| 3750 | (make-overlay 5 32 nil nil nil) | ||
| 3751 | (make-overlay 12 33 nil nil t) | ||
| 3752 | (make-overlay 38 29 nil t nil) | ||
| 3753 | (goto-char 12) | ||
| 3754 | (delete-char 53) | ||
| 3755 | (goto-char 1) | ||
| 3756 | (delete-char 6) | ||
| 3757 | (goto-char 5) | ||
| 3758 | (widen) | ||
| 3759 | (narrow-to-region 6 1) | ||
| 3760 | (goto-char 6) | ||
| 3761 | (insert "......") | ||
| 3762 | (goto-char 10) | ||
| 3763 | (insert "...............") | ||
| 3764 | (goto-char 17) | ||
| 3765 | (delete-char 5) | ||
| 3766 | (goto-char 7) | ||
| 3767 | (insert ".....") | ||
| 3768 | (goto-char 8) | ||
| 3769 | (insert "...............") | ||
| 3770 | (goto-char 4) | ||
| 3771 | (insert ".....") | ||
| 3772 | (goto-char 44) | ||
| 3773 | (widen) | ||
| 3774 | (narrow-to-region 18 11) | ||
| 3775 | (goto-char 15) | ||
| 3776 | (delete-char 1) | ||
| 3777 | (goto-char 17) | ||
| 3778 | (delete-char 0) | ||
| 3779 | (goto-char 13) | ||
| 3780 | (delete-char 3) | ||
| 3781 | (goto-char 14) | ||
| 3782 | (insert "..") | ||
| 3783 | (goto-char 16) | ||
| 3784 | (insert "..") | ||
| 3785 | (goto-char 15) | ||
| 3786 | (delete-char 3) | ||
| 3787 | (goto-char 13) | ||
| 3788 | (delete-char 0) | ||
| 3789 | (goto-char 14) | ||
| 3790 | (insert "..........") | ||
| 3791 | (goto-char 19) | ||
| 3792 | (insert ".") | ||
| 3793 | (goto-char 23) | ||
| 3794 | (delete-char 1) | ||
| 3795 | (goto-char 12) | ||
| 3796 | (widen) | ||
| 3797 | (narrow-to-region 23 40) | ||
| 3798 | (goto-char 35) | ||
| 3799 | (insert "....") | ||
| 3800 | (goto-char 33) | ||
| 3801 | (insert "..........") | ||
| 3802 | (goto-char 37) | ||
| 3803 | (delete-char 16) | ||
| 3804 | (goto-char 37) | ||
| 3805 | (delete-char 0) | ||
| 3806 | (goto-char 23) | ||
| 3807 | (widen) | ||
| 3808 | (narrow-to-region 30 8) | ||
| 3809 | (goto-char 29) | ||
| 3810 | (delete-char 0) | ||
| 3811 | (goto-char 15) | ||
| 3812 | (delete-char 15) | ||
| 3813 | (goto-char 9) | ||
| 3814 | (insert "...........") | ||
| 3815 | (goto-char 9) | ||
| 3816 | (delete-char 1) | ||
| 3817 | (goto-char 22) | ||
| 3818 | (delete-char 3) | ||
| 3819 | (goto-char 10) | ||
| 3820 | (insert ".........") | ||
| 3821 | (should | ||
| 3822 | (equal | ||
| 3823 | (test-overlay-regions) | ||
| 3824 | '((1 . 30) | ||
| 3825 | (1 . 30) | ||
| 3826 | (1 . 30) | ||
| 3827 | (2 . 53) | ||
| 3828 | (30 . 30) | ||
| 3829 | (30 . 30) | ||
| 3830 | (30 . 30) | ||
| 3831 | (30 . 30) | ||
| 3832 | (30 . 30) | ||
| 3833 | (30 . 30) | ||
| 3834 | (30 . 30) | ||
| 3835 | (30 . 53) | ||
| 3836 | (30 . 53) | ||
| 3837 | (30 . 53)))))) | ||
| 3838 | |||
| 3839 | (ert-deftest overlay-autogenerated-test-26 nil | ||
| 3840 | (with-temp-buffer | ||
| 3841 | (insert "................................................................") | ||
| 3842 | (make-overlay 60 59 nil t nil) | ||
| 3843 | (make-overlay 18 11 nil nil t) | ||
| 3844 | (make-overlay 4 44 nil nil nil) | ||
| 3845 | (make-overlay 7 22 nil nil nil) | ||
| 3846 | (make-overlay 54 50 nil t nil) | ||
| 3847 | (make-overlay 59 28 nil nil nil) | ||
| 3848 | (make-overlay 49 23 nil nil t) | ||
| 3849 | (make-overlay 21 5 nil t nil) | ||
| 3850 | (make-overlay 17 39 nil t nil) | ||
| 3851 | (make-overlay 16 14 nil nil nil) | ||
| 3852 | (make-overlay 50 26 nil nil nil) | ||
| 3853 | (make-overlay 37 14 nil nil nil) | ||
| 3854 | (make-overlay 6 59 nil nil t) | ||
| 3855 | (make-overlay 30 17 nil nil t) | ||
| 3856 | (make-overlay 17 34 nil nil t) | ||
| 3857 | (make-overlay 7 22 nil t nil) | ||
| 3858 | (goto-char 35) | ||
| 3859 | (delete-char 25) | ||
| 3860 | (goto-char 30) | ||
| 3861 | (delete-char 7) | ||
| 3862 | (goto-char 25) | ||
| 3863 | (widen) | ||
| 3864 | (narrow-to-region 3 19) | ||
| 3865 | (goto-char 6) | ||
| 3866 | (insert ".........") | ||
| 3867 | (goto-char 21) | ||
| 3868 | (insert "...............") | ||
| 3869 | (goto-char 12) | ||
| 3870 | (insert ".............") | ||
| 3871 | (goto-char 34) | ||
| 3872 | (widen) | ||
| 3873 | (narrow-to-region 64 37) | ||
| 3874 | (goto-char 62) | ||
| 3875 | (insert ".............") | ||
| 3876 | (goto-char 50) | ||
| 3877 | (widen) | ||
| 3878 | (narrow-to-region 72 38) | ||
| 3879 | (goto-char 66) | ||
| 3880 | (insert "") | ||
| 3881 | (goto-char 54) | ||
| 3882 | (insert "...") | ||
| 3883 | (goto-char 70) | ||
| 3884 | (delete-char 4) | ||
| 3885 | (goto-char 49) | ||
| 3886 | (delete-char 13) | ||
| 3887 | (goto-char 38) | ||
| 3888 | (insert "....") | ||
| 3889 | (goto-char 46) | ||
| 3890 | (insert ".") | ||
| 3891 | (goto-char 43) | ||
| 3892 | (widen) | ||
| 3893 | (narrow-to-region 74 53) | ||
| 3894 | (goto-char 60) | ||
| 3895 | (delete-char 10) | ||
| 3896 | (goto-char 53) | ||
| 3897 | (insert "..............") | ||
| 3898 | (goto-char 72) | ||
| 3899 | (insert "............") | ||
| 3900 | (goto-char 87) | ||
| 3901 | (delete-char 2) | ||
| 3902 | (goto-char 73) | ||
| 3903 | (insert "............") | ||
| 3904 | (goto-char 81) | ||
| 3905 | (insert "........") | ||
| 3906 | (goto-char 106) | ||
| 3907 | (insert "...") | ||
| 3908 | (goto-char 95) | ||
| 3909 | (widen) | ||
| 3910 | (narrow-to-region 77 39) | ||
| 3911 | (goto-char 43) | ||
| 3912 | (insert "..........") | ||
| 3913 | (goto-char 40) | ||
| 3914 | (insert "...............") | ||
| 3915 | (goto-char 101) | ||
| 3916 | (insert "") | ||
| 3917 | (goto-char 53) | ||
| 3918 | (insert "....") | ||
| 3919 | (goto-char 79) | ||
| 3920 | (delete-char 21) | ||
| 3921 | (goto-char 85) | ||
| 3922 | (insert "........") | ||
| 3923 | (goto-char 52) | ||
| 3924 | (delete-char 41) | ||
| 3925 | (goto-char 43) | ||
| 3926 | (insert ".....") | ||
| 3927 | (should | ||
| 3928 | (equal | ||
| 3929 | (test-overlay-regions) | ||
| 3930 | '((4 . 90) | ||
| 3931 | (5 . 57) | ||
| 3932 | (6 . 90) | ||
| 3933 | (29 . 57) | ||
| 3934 | (29 . 57) | ||
| 3935 | (33 . 57)))))) | ||
| 3936 | |||
| 3937 | (ert-deftest overlay-autogenerated-test-27 nil | ||
| 3938 | (with-temp-buffer | ||
| 3939 | (insert "................................................................") | ||
| 3940 | (make-overlay 20 12 nil t nil) | ||
| 3941 | (make-overlay 3 10 nil t t) | ||
| 3942 | (make-overlay 11 53 nil t nil) | ||
| 3943 | (make-overlay 59 3 nil t nil) | ||
| 3944 | (make-overlay 28 19 nil t t) | ||
| 3945 | (make-overlay 16 30 nil t t) | ||
| 3946 | (make-overlay 39 19 nil t t) | ||
| 3947 | (make-overlay 33 50 nil t nil) | ||
| 3948 | (make-overlay 36 54 nil nil nil) | ||
| 3949 | (make-overlay 42 59 nil nil nil) | ||
| 3950 | (make-overlay 30 48 nil t nil) | ||
| 3951 | (make-overlay 20 13 nil nil t) | ||
| 3952 | (make-overlay 63 48 nil t nil) | ||
| 3953 | (make-overlay 48 12 nil t t) | ||
| 3954 | (make-overlay 64 50 nil nil nil) | ||
| 3955 | (make-overlay 7 7 nil nil nil) | ||
| 3956 | (goto-char 20) | ||
| 3957 | (widen) | ||
| 3958 | (narrow-to-region 21 54) | ||
| 3959 | (goto-char 40) | ||
| 3960 | (insert "..........") | ||
| 3961 | (goto-char 21) | ||
| 3962 | (delete-char 2) | ||
| 3963 | (goto-char 35) | ||
| 3964 | (widen) | ||
| 3965 | (narrow-to-region 70 11) | ||
| 3966 | (goto-char 45) | ||
| 3967 | (insert "...............") | ||
| 3968 | (goto-char 74) | ||
| 3969 | (insert ".") | ||
| 3970 | (goto-char 28) | ||
| 3971 | (widen) | ||
| 3972 | (narrow-to-region 77 67) | ||
| 3973 | (goto-char 72) | ||
| 3974 | (insert "..........") | ||
| 3975 | (goto-char 85) | ||
| 3976 | (delete-char 1) | ||
| 3977 | (goto-char 82) | ||
| 3978 | (widen) | ||
| 3979 | (narrow-to-region 83 86) | ||
| 3980 | (goto-char 83) | ||
| 3981 | (delete-char 0) | ||
| 3982 | (goto-char 86) | ||
| 3983 | (delete-char 0) | ||
| 3984 | (goto-char 86) | ||
| 3985 | (insert "...........") | ||
| 3986 | (goto-char 97) | ||
| 3987 | (insert ".......") | ||
| 3988 | (goto-char 103) | ||
| 3989 | (widen) | ||
| 3990 | (narrow-to-region 44 68) | ||
| 3991 | (goto-char 49) | ||
| 3992 | (insert "..") | ||
| 3993 | (goto-char 65) | ||
| 3994 | (insert ".............") | ||
| 3995 | (goto-char 59) | ||
| 3996 | (delete-char 0) | ||
| 3997 | (goto-char 57) | ||
| 3998 | (insert "........") | ||
| 3999 | (goto-char 55) | ||
| 4000 | (delete-char 30) | ||
| 4001 | (goto-char 45) | ||
| 4002 | (insert "...............") | ||
| 4003 | (goto-char 44) | ||
| 4004 | (insert "") | ||
| 4005 | (goto-char 62) | ||
| 4006 | (insert "............") | ||
| 4007 | (goto-char 63) | ||
| 4008 | (widen) | ||
| 4009 | (narrow-to-region 12 5) | ||
| 4010 | (goto-char 8) | ||
| 4011 | (delete-char 4) | ||
| 4012 | (goto-char 6) | ||
| 4013 | (delete-char 0) | ||
| 4014 | (goto-char 7) | ||
| 4015 | (insert "..........") | ||
| 4016 | (goto-char 15) | ||
| 4017 | (delete-char 0) | ||
| 4018 | (goto-char 16) | ||
| 4019 | (insert "............") | ||
| 4020 | (goto-char 20) | ||
| 4021 | (insert ".........") | ||
| 4022 | (goto-char 13) | ||
| 4023 | (insert "..") | ||
| 4024 | (goto-char 32) | ||
| 4025 | (insert "..............") | ||
| 4026 | (should | ||
| 4027 | (equal | ||
| 4028 | (test-overlay-regions) | ||
| 4029 | '((3 . 55) | ||
| 4030 | (3 . 173) | ||
| 4031 | (7 . 7)))))) | ||
| 4032 | |||
| 4033 | (ert-deftest overlay-autogenerated-test-28 nil | ||
| 4034 | (with-temp-buffer | ||
| 4035 | (insert "................................................................") | ||
| 4036 | (make-overlay 59 48 nil t nil) | ||
| 4037 | (make-overlay 59 4 nil nil t) | ||
| 4038 | (make-overlay 45 35 nil t nil) | ||
| 4039 | (make-overlay 13 18 nil t t) | ||
| 4040 | (make-overlay 10 7 nil t t) | ||
| 4041 | (make-overlay 9 8 nil nil nil) | ||
| 4042 | (make-overlay 33 47 nil nil t) | ||
| 4043 | (make-overlay 1 57 nil t nil) | ||
| 4044 | (make-overlay 16 59 nil nil t) | ||
| 4045 | (make-overlay 43 58 nil nil t) | ||
| 4046 | (make-overlay 6 11 nil nil nil) | ||
| 4047 | (make-overlay 59 7 nil t nil) | ||
| 4048 | (make-overlay 3 57 nil t t) | ||
| 4049 | (make-overlay 61 35 nil nil nil) | ||
| 4050 | (make-overlay 57 8 nil nil nil) | ||
| 4051 | (make-overlay 5 32 nil t nil) | ||
| 4052 | (goto-char 18) | ||
| 4053 | (insert "............") | ||
| 4054 | (goto-char 43) | ||
| 4055 | (delete-char 2) | ||
| 4056 | (goto-char 38) | ||
| 4057 | (delete-char 26) | ||
| 4058 | (goto-char 42) | ||
| 4059 | (insert ".....") | ||
| 4060 | (goto-char 52) | ||
| 4061 | (insert "..........") | ||
| 4062 | (goto-char 45) | ||
| 4063 | (delete-char 11) | ||
| 4064 | (goto-char 33) | ||
| 4065 | (insert "....") | ||
| 4066 | (goto-char 23) | ||
| 4067 | (delete-char 14) | ||
| 4068 | (goto-char 33) | ||
| 4069 | (widen) | ||
| 4070 | (narrow-to-region 30 33) | ||
| 4071 | (goto-char 30) | ||
| 4072 | (delete-char 0) | ||
| 4073 | (goto-char 30) | ||
| 4074 | (insert "...........") | ||
| 4075 | (goto-char 30) | ||
| 4076 | (delete-char 7) | ||
| 4077 | (goto-char 30) | ||
| 4078 | (insert ".") | ||
| 4079 | (goto-char 32) | ||
| 4080 | (delete-char 4) | ||
| 4081 | (goto-char 34) | ||
| 4082 | (delete-char 0) | ||
| 4083 | (goto-char 34) | ||
| 4084 | (delete-char 0) | ||
| 4085 | (goto-char 32) | ||
| 4086 | (insert "...............") | ||
| 4087 | (goto-char 46) | ||
| 4088 | (insert ".........") | ||
| 4089 | (goto-char 45) | ||
| 4090 | (delete-char 3) | ||
| 4091 | (goto-char 49) | ||
| 4092 | (delete-char 2) | ||
| 4093 | (goto-char 42) | ||
| 4094 | (delete-char 2) | ||
| 4095 | (goto-char 32) | ||
| 4096 | (insert "..........") | ||
| 4097 | (goto-char 47) | ||
| 4098 | (insert "....") | ||
| 4099 | (goto-char 59) | ||
| 4100 | (insert ".......") | ||
| 4101 | (goto-char 35) | ||
| 4102 | (insert ".") | ||
| 4103 | (goto-char 45) | ||
| 4104 | (insert "..............") | ||
| 4105 | (goto-char 37) | ||
| 4106 | (insert "..") | ||
| 4107 | (goto-char 80) | ||
| 4108 | (insert ".....") | ||
| 4109 | (goto-char 30) | ||
| 4110 | (insert ".............") | ||
| 4111 | (goto-char 102) | ||
| 4112 | (insert "............") | ||
| 4113 | (goto-char 113) | ||
| 4114 | (insert "") | ||
| 4115 | (goto-char 66) | ||
| 4116 | (widen) | ||
| 4117 | (narrow-to-region 47 38) | ||
| 4118 | (should | ||
| 4119 | (equal | ||
| 4120 | (test-overlay-regions) | ||
| 4121 | '((1 . 45) | ||
| 4122 | (3 . 117) | ||
| 4123 | (4 . 121) | ||
| 4124 | (7 . 121) | ||
| 4125 | (8 . 45) | ||
| 4126 | (16 . 121) | ||
| 4127 | (28 . 121) | ||
| 4128 | (28 . 121) | ||
| 4129 | (28 . 121)))))) | ||
| 4130 | |||
| 4131 | (ert-deftest overlay-autogenerated-test-29 nil | ||
| 4132 | (with-temp-buffer | ||
| 4133 | (insert "................................................................") | ||
| 4134 | (make-overlay 5 63 nil nil t) | ||
| 4135 | (make-overlay 20 28 nil t t) | ||
| 4136 | (make-overlay 58 53 nil t nil) | ||
| 4137 | (make-overlay 4 57 nil t t) | ||
| 4138 | (make-overlay 4 16 nil nil nil) | ||
| 4139 | (make-overlay 33 26 nil t nil) | ||
| 4140 | (make-overlay 9 32 nil t t) | ||
| 4141 | (make-overlay 11 8 nil nil nil) | ||
| 4142 | (make-overlay 59 35 nil nil t) | ||
| 4143 | (make-overlay 15 25 nil t t) | ||
| 4144 | (make-overlay 36 16 nil nil nil) | ||
| 4145 | (make-overlay 8 37 nil nil nil) | ||
| 4146 | (make-overlay 65 63 nil nil t) | ||
| 4147 | (make-overlay 3 20 nil nil t) | ||
| 4148 | (make-overlay 44 55 nil t t) | ||
| 4149 | (make-overlay 45 25 nil t nil) | ||
| 4150 | (goto-char 39) | ||
| 4151 | (insert "...") | ||
| 4152 | (goto-char 22) | ||
| 4153 | (insert "........") | ||
| 4154 | (goto-char 60) | ||
| 4155 | (insert ".........") | ||
| 4156 | (goto-char 17) | ||
| 4157 | (insert "............") | ||
| 4158 | (goto-char 13) | ||
| 4159 | (widen) | ||
| 4160 | (narrow-to-region 79 16) | ||
| 4161 | (goto-char 19) | ||
| 4162 | (delete-char 11) | ||
| 4163 | (goto-char 25) | ||
| 4164 | (insert "........") | ||
| 4165 | (goto-char 61) | ||
| 4166 | (insert "....") | ||
| 4167 | (goto-char 45) | ||
| 4168 | (widen) | ||
| 4169 | (narrow-to-region 73 66) | ||
| 4170 | (goto-char 71) | ||
| 4171 | (insert "............") | ||
| 4172 | (goto-char 81) | ||
| 4173 | (delete-char 2) | ||
| 4174 | (goto-char 73) | ||
| 4175 | (insert "..........") | ||
| 4176 | (goto-char 74) | ||
| 4177 | (insert "............") | ||
| 4178 | (goto-char 82) | ||
| 4179 | (delete-char 7) | ||
| 4180 | (goto-char 78) | ||
| 4181 | (delete-char 18) | ||
| 4182 | (goto-char 75) | ||
| 4183 | (insert ".........") | ||
| 4184 | (goto-char 66) | ||
| 4185 | (insert ".........") | ||
| 4186 | (goto-char 86) | ||
| 4187 | (delete-char 12) | ||
| 4188 | (goto-char 77) | ||
| 4189 | (widen) | ||
| 4190 | (narrow-to-region 23 55) | ||
| 4191 | (goto-char 43) | ||
| 4192 | (insert ".") | ||
| 4193 | (goto-char 50) | ||
| 4194 | (insert "..") | ||
| 4195 | (goto-char 25) | ||
| 4196 | (delete-char 18) | ||
| 4197 | (goto-char 33) | ||
| 4198 | (delete-char 7) | ||
| 4199 | (goto-char 26) | ||
| 4200 | (insert "........") | ||
| 4201 | (goto-char 29) | ||
| 4202 | (insert "...........") | ||
| 4203 | (goto-char 33) | ||
| 4204 | (insert "...") | ||
| 4205 | (goto-char 40) | ||
| 4206 | (insert "..........") | ||
| 4207 | (goto-char 26) | ||
| 4208 | (insert "") | ||
| 4209 | (goto-char 35) | ||
| 4210 | (insert ".") | ||
| 4211 | (goto-char 59) | ||
| 4212 | (insert ".") | ||
| 4213 | (goto-char 51) | ||
| 4214 | (insert "..") | ||
| 4215 | (goto-char 59) | ||
| 4216 | (insert ".............") | ||
| 4217 | (should | ||
| 4218 | (equal | ||
| 4219 | (test-overlay-regions) | ||
| 4220 | '((4 . 130) | ||
| 4221 | (5 . 136) | ||
| 4222 | (8 . 82) | ||
| 4223 | (9 . 82) | ||
| 4224 | (15 . 25) | ||
| 4225 | (16 . 82) | ||
| 4226 | (21 . 77) | ||
| 4227 | (25 . 105) | ||
| 4228 | (75 . 82)))))) | ||
| 4229 | |||
| 4230 | (ert-deftest overlay-autogenerated-test-30 nil | ||
| 4231 | (with-temp-buffer | ||
| 4232 | (insert "................................................................") | ||
| 4233 | (make-overlay 27 65 nil t t) | ||
| 4234 | (make-overlay 39 51 nil t t) | ||
| 4235 | (make-overlay 53 2 nil nil nil) | ||
| 4236 | (make-overlay 3 17 nil nil t) | ||
| 4237 | (make-overlay 35 4 nil nil t) | ||
| 4238 | (make-overlay 65 53 nil t nil) | ||
| 4239 | (make-overlay 8 21 nil t t) | ||
| 4240 | (make-overlay 18 62 nil t t) | ||
| 4241 | (make-overlay 42 59 nil nil t) | ||
| 4242 | (make-overlay 12 37 nil t t) | ||
| 4243 | (make-overlay 64 31 nil t nil) | ||
| 4244 | (make-overlay 39 54 nil nil t) | ||
| 4245 | (make-overlay 41 24 nil t nil) | ||
| 4246 | (make-overlay 10 21 nil nil t) | ||
| 4247 | (make-overlay 49 15 nil t nil) | ||
| 4248 | (make-overlay 49 63 nil nil t) | ||
| 4249 | (goto-char 43) | ||
| 4250 | (insert "..........") | ||
| 4251 | (goto-char 44) | ||
| 4252 | (delete-char 29) | ||
| 4253 | (goto-char 32) | ||
| 4254 | (insert "..") | ||
| 4255 | (goto-char 13) | ||
| 4256 | (insert ".") | ||
| 4257 | (goto-char 42) | ||
| 4258 | (insert ".........") | ||
| 4259 | (goto-char 39) | ||
| 4260 | (insert "..........") | ||
| 4261 | (goto-char 15) | ||
| 4262 | (insert "............") | ||
| 4263 | (goto-char 58) | ||
| 4264 | (delete-char 9) | ||
| 4265 | (goto-char 63) | ||
| 4266 | (insert ".........") | ||
| 4267 | (goto-char 49) | ||
| 4268 | (insert ".") | ||
| 4269 | (goto-char 28) | ||
| 4270 | (delete-char 51) | ||
| 4271 | (goto-char 12) | ||
| 4272 | (delete-char 6) | ||
| 4273 | (goto-char 20) | ||
| 4274 | (delete-char 2) | ||
| 4275 | (goto-char 7) | ||
| 4276 | (widen) | ||
| 4277 | (narrow-to-region 2 9) | ||
| 4278 | (goto-char 5) | ||
| 4279 | (insert "...............") | ||
| 4280 | (goto-char 18) | ||
| 4281 | (delete-char 1) | ||
| 4282 | (goto-char 4) | ||
| 4283 | (insert ".............") | ||
| 4284 | (goto-char 13) | ||
| 4285 | (delete-char 22) | ||
| 4286 | (goto-char 12) | ||
| 4287 | (insert "") | ||
| 4288 | (goto-char 3) | ||
| 4289 | (insert ".............") | ||
| 4290 | (goto-char 22) | ||
| 4291 | (insert "...............") | ||
| 4292 | (goto-char 9) | ||
| 4293 | (insert "....") | ||
| 4294 | (goto-char 8) | ||
| 4295 | (insert "...........") | ||
| 4296 | (goto-char 6) | ||
| 4297 | (delete-char 34) | ||
| 4298 | (goto-char 21) | ||
| 4299 | (insert "....") | ||
| 4300 | (goto-char 14) | ||
| 4301 | (insert ".....") | ||
| 4302 | (goto-char 20) | ||
| 4303 | (insert ".......") | ||
| 4304 | (goto-char 34) | ||
| 4305 | (widen) | ||
| 4306 | (narrow-to-region 3 2) | ||
| 4307 | (goto-char 3) | ||
| 4308 | (delete-char 0) | ||
| 4309 | (goto-char 2) | ||
| 4310 | (insert "..............") | ||
| 4311 | (goto-char 15) | ||
| 4312 | (delete-char 2) | ||
| 4313 | (goto-char 11) | ||
| 4314 | (insert "......") | ||
| 4315 | (should | ||
| 4316 | (equal | ||
| 4317 | (test-overlay-regions) | ||
| 4318 | '((2 . 68)))))) | ||
| 4319 | |||
| 4320 | (ert-deftest overlay-autogenerated-test-31 nil | ||
| 4321 | (with-temp-buffer | ||
| 4322 | (insert "................................................................") | ||
| 4323 | (make-overlay 54 64 nil nil nil) | ||
| 4324 | (make-overlay 49 12 nil nil t) | ||
| 4325 | (make-overlay 40 12 nil t nil) | ||
| 4326 | (make-overlay 17 38 nil nil nil) | ||
| 4327 | (make-overlay 21 36 nil t t) | ||
| 4328 | (make-overlay 8 38 nil t nil) | ||
| 4329 | (make-overlay 50 22 nil t nil) | ||
| 4330 | (make-overlay 65 15 nil nil t) | ||
| 4331 | (make-overlay 57 60 nil t t) | ||
| 4332 | (make-overlay 35 11 nil nil t) | ||
| 4333 | (make-overlay 49 44 nil nil t) | ||
| 4334 | (make-overlay 45 31 nil nil t) | ||
| 4335 | (make-overlay 51 24 nil t t) | ||
| 4336 | (make-overlay 20 14 nil nil nil) | ||
| 4337 | (make-overlay 6 18 nil t t) | ||
| 4338 | (make-overlay 25 3 nil nil nil) | ||
| 4339 | (goto-char 18) | ||
| 4340 | (delete-char 10) | ||
| 4341 | (goto-char 36) | ||
| 4342 | (delete-char 13) | ||
| 4343 | (goto-char 8) | ||
| 4344 | (delete-char 4) | ||
| 4345 | (goto-char 2) | ||
| 4346 | (delete-char 8) | ||
| 4347 | (goto-char 12) | ||
| 4348 | (delete-char 10) | ||
| 4349 | (goto-char 15) | ||
| 4350 | (delete-char 4) | ||
| 4351 | (goto-char 16) | ||
| 4352 | (insert ".........") | ||
| 4353 | (goto-char 17) | ||
| 4354 | (insert "...............") | ||
| 4355 | (goto-char 33) | ||
| 4356 | (delete-char 0) | ||
| 4357 | (goto-char 38) | ||
| 4358 | (delete-char 0) | ||
| 4359 | (goto-char 11) | ||
| 4360 | (insert "...........") | ||
| 4361 | (goto-char 8) | ||
| 4362 | (delete-char 14) | ||
| 4363 | (goto-char 32) | ||
| 4364 | (insert "........") | ||
| 4365 | (goto-char 40) | ||
| 4366 | (widen) | ||
| 4367 | (narrow-to-region 14 6) | ||
| 4368 | (goto-char 10) | ||
| 4369 | (delete-char 1) | ||
| 4370 | (goto-char 7) | ||
| 4371 | (widen) | ||
| 4372 | (narrow-to-region 18 39) | ||
| 4373 | (goto-char 36) | ||
| 4374 | (delete-char 1) | ||
| 4375 | (goto-char 34) | ||
| 4376 | (widen) | ||
| 4377 | (narrow-to-region 39 14) | ||
| 4378 | (goto-char 22) | ||
| 4379 | (widen) | ||
| 4380 | (narrow-to-region 25 21) | ||
| 4381 | (goto-char 23) | ||
| 4382 | (delete-char 2) | ||
| 4383 | (goto-char 23) | ||
| 4384 | (delete-char 0) | ||
| 4385 | (goto-char 23) | ||
| 4386 | (insert ".........") | ||
| 4387 | (goto-char 32) | ||
| 4388 | (delete-char 0) | ||
| 4389 | (goto-char 31) | ||
| 4390 | (insert ".........") | ||
| 4391 | (goto-char 32) | ||
| 4392 | (insert "...") | ||
| 4393 | (goto-char 30) | ||
| 4394 | (widen) | ||
| 4395 | (narrow-to-region 10 56) | ||
| 4396 | (goto-char 10) | ||
| 4397 | (insert ".........") | ||
| 4398 | (goto-char 38) | ||
| 4399 | (insert ".........") | ||
| 4400 | (goto-char 19) | ||
| 4401 | (insert "..") | ||
| 4402 | (goto-char 11) | ||
| 4403 | (insert "..............") | ||
| 4404 | (goto-char 66) | ||
| 4405 | (insert "...............") | ||
| 4406 | (goto-char 13) | ||
| 4407 | (insert "......") | ||
| 4408 | (should | ||
| 4409 | (equal | ||
| 4410 | (test-overlay-regions) | ||
| 4411 | '((2 . 41) | ||
| 4412 | (3 . 117) | ||
| 4413 | (6 . 41) | ||
| 4414 | (8 . 41) | ||
| 4415 | (9 . 41) | ||
| 4416 | (10 . 42) | ||
| 4417 | (41 . 42)))))) | ||
| 4418 | |||
| 4419 | (ert-deftest overlay-autogenerated-test-32 nil | ||
| 4420 | (with-temp-buffer | ||
| 4421 | (insert "................................................................") | ||
| 4422 | (make-overlay 35 60 nil nil t) | ||
| 4423 | (make-overlay 45 46 nil nil nil) | ||
| 4424 | (make-overlay 47 11 nil nil t) | ||
| 4425 | (make-overlay 12 51 nil t nil) | ||
| 4426 | (make-overlay 61 17 nil t nil) | ||
| 4427 | (make-overlay 7 24 nil t nil) | ||
| 4428 | (make-overlay 36 37 nil nil t) | ||
| 4429 | (make-overlay 5 39 nil t t) | ||
| 4430 | (make-overlay 5 40 nil nil t) | ||
| 4431 | (make-overlay 38 40 nil t t) | ||
| 4432 | (make-overlay 47 45 nil t nil) | ||
| 4433 | (make-overlay 61 48 nil nil nil) | ||
| 4434 | (make-overlay 23 39 nil t t) | ||
| 4435 | (make-overlay 11 52 nil nil nil) | ||
| 4436 | (make-overlay 37 35 nil nil nil) | ||
| 4437 | (make-overlay 19 20 nil t nil) | ||
| 4438 | (goto-char 43) | ||
| 4439 | (insert "........") | ||
| 4440 | (goto-char 7) | ||
| 4441 | (insert "") | ||
| 4442 | (goto-char 28) | ||
| 4443 | (delete-char 41) | ||
| 4444 | (goto-char 3) | ||
| 4445 | (delete-char 17) | ||
| 4446 | (goto-char 2) | ||
| 4447 | (insert ".") | ||
| 4448 | (goto-char 7) | ||
| 4449 | (insert ".........") | ||
| 4450 | (goto-char 21) | ||
| 4451 | (delete-char 4) | ||
| 4452 | (goto-char 13) | ||
| 4453 | (delete-char 1) | ||
| 4454 | (goto-char 2) | ||
| 4455 | (insert "...............") | ||
| 4456 | (goto-char 7) | ||
| 4457 | (insert "") | ||
| 4458 | (goto-char 14) | ||
| 4459 | (insert ".....") | ||
| 4460 | (goto-char 16) | ||
| 4461 | (insert ".") | ||
| 4462 | (goto-char 10) | ||
| 4463 | (insert "..............") | ||
| 4464 | (goto-char 16) | ||
| 4465 | (delete-char 18) | ||
| 4466 | (goto-char 1) | ||
| 4467 | (delete-char 36) | ||
| 4468 | (goto-char 1) | ||
| 4469 | (delete-char 0) | ||
| 4470 | (goto-char 1) | ||
| 4471 | (delete-char 0) | ||
| 4472 | (goto-char 1) | ||
| 4473 | (insert ".............") | ||
| 4474 | (goto-char 9) | ||
| 4475 | (insert ".") | ||
| 4476 | (goto-char 14) | ||
| 4477 | (insert ".....") | ||
| 4478 | (goto-char 9) | ||
| 4479 | (delete-char 0) | ||
| 4480 | (goto-char 15) | ||
| 4481 | (delete-char 0) | ||
| 4482 | (goto-char 6) | ||
| 4483 | (delete-char 4) | ||
| 4484 | (goto-char 11) | ||
| 4485 | (delete-char 5) | ||
| 4486 | (goto-char 5) | ||
| 4487 | (insert "....") | ||
| 4488 | (goto-char 5) | ||
| 4489 | (insert ".....") | ||
| 4490 | (goto-char 12) | ||
| 4491 | (insert "") | ||
| 4492 | (goto-char 13) | ||
| 4493 | (insert ".......") | ||
| 4494 | (goto-char 14) | ||
| 4495 | (insert "......") | ||
| 4496 | (goto-char 9) | ||
| 4497 | (delete-char 3) | ||
| 4498 | (goto-char 17) | ||
| 4499 | (delete-char 0) | ||
| 4500 | (goto-char 7) | ||
| 4501 | (delete-char 12) | ||
| 4502 | (should | ||
| 4503 | (equal | ||
| 4504 | (test-overlay-regions) | ||
| 4505 | '((1 . 1) | ||
| 4506 | (1 . 1) | ||
| 4507 | (1 . 1) | ||
| 4508 | (1 . 1) | ||
| 4509 | (1 . 1) | ||
| 4510 | (1 . 1) | ||
| 4511 | (1 . 1) | ||
| 4512 | (1 . 1) | ||
| 4513 | (1 . 1) | ||
| 4514 | (1 . 18) | ||
| 4515 | (1 . 18) | ||
| 4516 | (1 . 18) | ||
| 4517 | (1 . 18) | ||
| 4518 | (18 . 18) | ||
| 4519 | (18 . 18) | ||
| 4520 | (18 . 18)))))) | ||
| 4521 | |||
| 4522 | (ert-deftest overlay-autogenerated-test-33 nil | ||
| 4523 | (with-temp-buffer | ||
| 4524 | (insert "................................................................") | ||
| 4525 | (make-overlay 65 33 nil t nil) | ||
| 4526 | (make-overlay 45 54 nil t t) | ||
| 4527 | (make-overlay 17 38 nil t nil) | ||
| 4528 | (make-overlay 58 46 nil nil t) | ||
| 4529 | (make-overlay 21 36 nil t t) | ||
| 4530 | (make-overlay 31 63 nil nil t) | ||
| 4531 | (make-overlay 37 64 nil t t) | ||
| 4532 | (make-overlay 42 19 nil nil nil) | ||
| 4533 | (make-overlay 51 60 nil t nil) | ||
| 4534 | (make-overlay 47 15 nil t t) | ||
| 4535 | (make-overlay 57 47 nil nil nil) | ||
| 4536 | (make-overlay 40 45 nil nil nil) | ||
| 4537 | (make-overlay 44 47 nil t nil) | ||
| 4538 | (make-overlay 42 35 nil t nil) | ||
| 4539 | (make-overlay 1 65 nil nil t) | ||
| 4540 | (make-overlay 29 63 nil t nil) | ||
| 4541 | (goto-char 33) | ||
| 4542 | (insert "...........") | ||
| 4543 | (goto-char 56) | ||
| 4544 | (insert ".........") | ||
| 4545 | (goto-char 67) | ||
| 4546 | (insert "....") | ||
| 4547 | (goto-char 28) | ||
| 4548 | (delete-char 35) | ||
| 4549 | (goto-char 9) | ||
| 4550 | (insert "......") | ||
| 4551 | (goto-char 43) | ||
| 4552 | (delete-char 17) | ||
| 4553 | (goto-char 29) | ||
| 4554 | (insert ".......") | ||
| 4555 | (goto-char 20) | ||
| 4556 | (insert "....") | ||
| 4557 | (goto-char 53) | ||
| 4558 | (insert ".......") | ||
| 4559 | (goto-char 14) | ||
| 4560 | (widen) | ||
| 4561 | (narrow-to-region 38 57) | ||
| 4562 | (goto-char 51) | ||
| 4563 | (insert "") | ||
| 4564 | (goto-char 57) | ||
| 4565 | (insert ".......") | ||
| 4566 | (goto-char 64) | ||
| 4567 | (insert ".....") | ||
| 4568 | (goto-char 59) | ||
| 4569 | (delete-char 3) | ||
| 4570 | (goto-char 45) | ||
| 4571 | (delete-char 12) | ||
| 4572 | (goto-char 43) | ||
| 4573 | (insert "......") | ||
| 4574 | (goto-char 48) | ||
| 4575 | (insert "......") | ||
| 4576 | (goto-char 52) | ||
| 4577 | (insert "........") | ||
| 4578 | (goto-char 57) | ||
| 4579 | (delete-char 16) | ||
| 4580 | (goto-char 43) | ||
| 4581 | (delete-char 9) | ||
| 4582 | (goto-char 40) | ||
| 4583 | (insert "") | ||
| 4584 | (goto-char 39) | ||
| 4585 | (insert "..........") | ||
| 4586 | (goto-char 50) | ||
| 4587 | (widen) | ||
| 4588 | (narrow-to-region 31 27) | ||
| 4589 | (goto-char 27) | ||
| 4590 | (insert "..........") | ||
| 4591 | (goto-char 33) | ||
| 4592 | (delete-char 0) | ||
| 4593 | (goto-char 37) | ||
| 4594 | (insert "..") | ||
| 4595 | (goto-char 38) | ||
| 4596 | (delete-char 4) | ||
| 4597 | (goto-char 38) | ||
| 4598 | (insert "..........") | ||
| 4599 | (goto-char 45) | ||
| 4600 | (insert ".....") | ||
| 4601 | (goto-char 53) | ||
| 4602 | (insert "...") | ||
| 4603 | (goto-char 51) | ||
| 4604 | (insert ".") | ||
| 4605 | (goto-char 28) | ||
| 4606 | (insert "...") | ||
| 4607 | (should | ||
| 4608 | (equal | ||
| 4609 | (test-overlay-regions) | ||
| 4610 | '((1 . 93) | ||
| 4611 | (25 . 92) | ||
| 4612 | (41 . 88) | ||
| 4613 | (60 . 88)))))) | ||
| 4614 | |||
| 4615 | (ert-deftest overlay-autogenerated-test-34 nil | ||
| 4616 | (with-temp-buffer | ||
| 4617 | (insert "................................................................") | ||
| 4618 | (make-overlay 2 63 nil nil t) | ||
| 4619 | (make-overlay 54 30 nil t nil) | ||
| 4620 | (make-overlay 21 57 nil t nil) | ||
| 4621 | (make-overlay 61 19 nil nil nil) | ||
| 4622 | (make-overlay 55 8 nil nil t) | ||
| 4623 | (make-overlay 14 51 nil nil nil) | ||
| 4624 | (make-overlay 33 13 nil t t) | ||
| 4625 | (make-overlay 36 25 nil t t) | ||
| 4626 | (make-overlay 22 21 nil nil t) | ||
| 4627 | (make-overlay 21 48 nil nil t) | ||
| 4628 | (make-overlay 36 7 nil nil t) | ||
| 4629 | (make-overlay 2 40 nil nil nil) | ||
| 4630 | (make-overlay 21 27 nil nil t) | ||
| 4631 | (make-overlay 26 2 nil nil nil) | ||
| 4632 | (make-overlay 60 43 nil nil nil) | ||
| 4633 | (make-overlay 12 50 nil t t) | ||
| 4634 | (goto-char 44) | ||
| 4635 | (delete-char 6) | ||
| 4636 | (goto-char 5) | ||
| 4637 | (insert "..") | ||
| 4638 | (goto-char 17) | ||
| 4639 | (insert "........") | ||
| 4640 | (goto-char 48) | ||
| 4641 | (insert "..") | ||
| 4642 | (goto-char 27) | ||
| 4643 | (delete-char 29) | ||
| 4644 | (goto-char 10) | ||
| 4645 | (delete-char 2) | ||
| 4646 | (goto-char 35) | ||
| 4647 | (insert ".............") | ||
| 4648 | (goto-char 20) | ||
| 4649 | (delete-char 0) | ||
| 4650 | (goto-char 6) | ||
| 4651 | (insert ".") | ||
| 4652 | (goto-char 9) | ||
| 4653 | (delete-char 6) | ||
| 4654 | (goto-char 38) | ||
| 4655 | (insert ".........") | ||
| 4656 | (goto-char 5) | ||
| 4657 | (insert ".........") | ||
| 4658 | (goto-char 10) | ||
| 4659 | (delete-char 20) | ||
| 4660 | (goto-char 6) | ||
| 4661 | (delete-char 6) | ||
| 4662 | (goto-char 14) | ||
| 4663 | (insert ".............") | ||
| 4664 | (goto-char 31) | ||
| 4665 | (delete-char 10) | ||
| 4666 | (goto-char 20) | ||
| 4667 | (widen) | ||
| 4668 | (narrow-to-region 27 39) | ||
| 4669 | (goto-char 34) | ||
| 4670 | (delete-char 5) | ||
| 4671 | (goto-char 32) | ||
| 4672 | (delete-char 1) | ||
| 4673 | (goto-char 27) | ||
| 4674 | (insert "..") | ||
| 4675 | (goto-char 28) | ||
| 4676 | (insert "........") | ||
| 4677 | (goto-char 39) | ||
| 4678 | (insert "........") | ||
| 4679 | (goto-char 38) | ||
| 4680 | (delete-char 7) | ||
| 4681 | (goto-char 44) | ||
| 4682 | (delete-char 0) | ||
| 4683 | (goto-char 30) | ||
| 4684 | (insert "...............") | ||
| 4685 | (goto-char 43) | ||
| 4686 | (insert "............") | ||
| 4687 | (goto-char 56) | ||
| 4688 | (delete-char 1) | ||
| 4689 | (goto-char 65) | ||
| 4690 | (delete-char 3) | ||
| 4691 | (goto-char 36) | ||
| 4692 | (insert ".........") | ||
| 4693 | (goto-char 74) | ||
| 4694 | (insert ".....") | ||
| 4695 | (goto-char 67) | ||
| 4696 | (delete-char 5) | ||
| 4697 | (goto-char 38) | ||
| 4698 | (insert "..") | ||
| 4699 | (should | ||
| 4700 | (equal | ||
| 4701 | (test-overlay-regions) | ||
| 4702 | '((2 . 80) | ||
| 4703 | (6 . 78)))))) | ||
| 4704 | |||
| 4705 | (ert-deftest overlay-autogenerated-test-35 nil | ||
| 4706 | (with-temp-buffer | ||
| 4707 | (insert "................................................................") | ||
| 4708 | (make-overlay 38 16 nil nil nil) | ||
| 4709 | (make-overlay 19 22 nil t nil) | ||
| 4710 | (make-overlay 16 43 nil nil t) | ||
| 4711 | (make-overlay 27 5 nil nil nil) | ||
| 4712 | (make-overlay 43 34 nil t nil) | ||
| 4713 | (make-overlay 47 4 nil nil t) | ||
| 4714 | (make-overlay 1 47 nil nil t) | ||
| 4715 | (make-overlay 27 35 nil t nil) | ||
| 4716 | (make-overlay 41 41 nil nil t) | ||
| 4717 | (make-overlay 21 19 nil nil nil) | ||
| 4718 | (make-overlay 16 38 nil nil t) | ||
| 4719 | (make-overlay 33 39 nil t nil) | ||
| 4720 | (make-overlay 34 51 nil nil t) | ||
| 4721 | (make-overlay 45 36 nil t nil) | ||
| 4722 | (make-overlay 42 18 nil t t) | ||
| 4723 | (make-overlay 12 30 nil nil nil) | ||
| 4724 | (goto-char 18) | ||
| 4725 | (insert "") | ||
| 4726 | (goto-char 58) | ||
| 4727 | (delete-char 3) | ||
| 4728 | (goto-char 58) | ||
| 4729 | (delete-char 0) | ||
| 4730 | (goto-char 1) | ||
| 4731 | (insert ".......") | ||
| 4732 | (goto-char 48) | ||
| 4733 | (delete-char 17) | ||
| 4734 | (goto-char 39) | ||
| 4735 | (delete-char 6) | ||
| 4736 | (goto-char 33) | ||
| 4737 | (widen) | ||
| 4738 | (narrow-to-region 45 46) | ||
| 4739 | (goto-char 46) | ||
| 4740 | (insert "") | ||
| 4741 | (goto-char 46) | ||
| 4742 | (delete-char 0) | ||
| 4743 | (goto-char 46) | ||
| 4744 | (insert ".....") | ||
| 4745 | (goto-char 51) | ||
| 4746 | (widen) | ||
| 4747 | (narrow-to-region 17 26) | ||
| 4748 | (goto-char 25) | ||
| 4749 | (widen) | ||
| 4750 | (narrow-to-region 50 41) | ||
| 4751 | (goto-char 45) | ||
| 4752 | (insert "..............") | ||
| 4753 | (goto-char 59) | ||
| 4754 | (insert "...........") | ||
| 4755 | (goto-char 47) | ||
| 4756 | (delete-char 9) | ||
| 4757 | (goto-char 59) | ||
| 4758 | (insert "") | ||
| 4759 | (goto-char 46) | ||
| 4760 | (insert "") | ||
| 4761 | (goto-char 54) | ||
| 4762 | (delete-char 5) | ||
| 4763 | (goto-char 57) | ||
| 4764 | (widen) | ||
| 4765 | (narrow-to-region 57 31) | ||
| 4766 | (goto-char 42) | ||
| 4767 | (delete-char 2) | ||
| 4768 | (goto-char 52) | ||
| 4769 | (insert "....") | ||
| 4770 | (goto-char 44) | ||
| 4771 | (insert "..") | ||
| 4772 | (goto-char 44) | ||
| 4773 | (insert "...............") | ||
| 4774 | (goto-char 72) | ||
| 4775 | (delete-char 1) | ||
| 4776 | (goto-char 66) | ||
| 4777 | (delete-char 6) | ||
| 4778 | (goto-char 64) | ||
| 4779 | (delete-char 5) | ||
| 4780 | (goto-char 49) | ||
| 4781 | (delete-char 12) | ||
| 4782 | (goto-char 32) | ||
| 4783 | (insert "......") | ||
| 4784 | (goto-char 44) | ||
| 4785 | (delete-char 2) | ||
| 4786 | (goto-char 39) | ||
| 4787 | (delete-char 12) | ||
| 4788 | (goto-char 42) | ||
| 4789 | (insert "......") | ||
| 4790 | (goto-char 36) | ||
| 4791 | (widen) | ||
| 4792 | (narrow-to-region 14 47) | ||
| 4793 | (should | ||
| 4794 | (equal | ||
| 4795 | (test-overlay-regions) | ||
| 4796 | '((1 . 39) | ||
| 4797 | (11 . 39) | ||
| 4798 | (12 . 39) | ||
| 4799 | (19 . 39) | ||
| 4800 | (23 . 39) | ||
| 4801 | (23 . 39) | ||
| 4802 | (23 . 39) | ||
| 4803 | (25 . 39) | ||
| 4804 | (26 . 28) | ||
| 4805 | (26 . 29) | ||
| 4806 | (39 . 39) | ||
| 4807 | (39 . 39) | ||
| 4808 | (39 . 39) | ||
| 4809 | (39 . 39) | ||
| 4810 | (39 . 39) | ||
| 4811 | (39 . 39)))))) | ||
| 4812 | |||
| 4813 | (ert-deftest overlay-autogenerated-test-36 nil | ||
| 4814 | (with-temp-buffer | ||
| 4815 | (insert "................................................................") | ||
| 4816 | (make-overlay 1 38 nil t t) | ||
| 4817 | (make-overlay 58 34 nil t nil) | ||
| 4818 | (make-overlay 6 33 nil nil t) | ||
| 4819 | (make-overlay 63 54 nil nil t) | ||
| 4820 | (make-overlay 54 54 nil t t) | ||
| 4821 | (make-overlay 21 61 nil nil nil) | ||
| 4822 | (make-overlay 64 55 nil nil t) | ||
| 4823 | (make-overlay 28 65 nil nil t) | ||
| 4824 | (make-overlay 32 51 nil t nil) | ||
| 4825 | (make-overlay 36 38 nil nil nil) | ||
| 4826 | (make-overlay 35 21 nil nil nil) | ||
| 4827 | (make-overlay 65 48 nil nil nil) | ||
| 4828 | (make-overlay 32 27 nil nil t) | ||
| 4829 | (make-overlay 27 55 nil t t) | ||
| 4830 | (make-overlay 30 22 nil t nil) | ||
| 4831 | (make-overlay 14 58 nil t nil) | ||
| 4832 | (goto-char 40) | ||
| 4833 | (delete-char 7) | ||
| 4834 | (goto-char 42) | ||
| 4835 | (insert "......") | ||
| 4836 | (goto-char 11) | ||
| 4837 | (widen) | ||
| 4838 | (narrow-to-region 64 9) | ||
| 4839 | (goto-char 21) | ||
| 4840 | (delete-char 23) | ||
| 4841 | (goto-char 24) | ||
| 4842 | (insert "...") | ||
| 4843 | (goto-char 13) | ||
| 4844 | (insert "..........") | ||
| 4845 | (goto-char 12) | ||
| 4846 | (delete-char 5) | ||
| 4847 | (goto-char 10) | ||
| 4848 | (delete-char 0) | ||
| 4849 | (goto-char 21) | ||
| 4850 | (widen) | ||
| 4851 | (narrow-to-region 9 5) | ||
| 4852 | (goto-char 6) | ||
| 4853 | (delete-char 0) | ||
| 4854 | (goto-char 9) | ||
| 4855 | (delete-char 0) | ||
| 4856 | (goto-char 9) | ||
| 4857 | (delete-char 0) | ||
| 4858 | (goto-char 7) | ||
| 4859 | (insert "............") | ||
| 4860 | (goto-char 9) | ||
| 4861 | (insert "...") | ||
| 4862 | (goto-char 18) | ||
| 4863 | (insert ".") | ||
| 4864 | (goto-char 23) | ||
| 4865 | (delete-char 1) | ||
| 4866 | (goto-char 9) | ||
| 4867 | (insert "....") | ||
| 4868 | (goto-char 6) | ||
| 4869 | (insert ".....") | ||
| 4870 | (goto-char 23) | ||
| 4871 | (widen) | ||
| 4872 | (narrow-to-region 28 1) | ||
| 4873 | (goto-char 6) | ||
| 4874 | (insert "...........") | ||
| 4875 | (goto-char 30) | ||
| 4876 | (delete-char 8) | ||
| 4877 | (goto-char 2) | ||
| 4878 | (insert ".") | ||
| 4879 | (goto-char 18) | ||
| 4880 | (insert "......") | ||
| 4881 | (goto-char 5) | ||
| 4882 | (delete-char 9) | ||
| 4883 | (goto-char 5) | ||
| 4884 | (delete-char 20) | ||
| 4885 | (goto-char 4) | ||
| 4886 | (delete-char 3) | ||
| 4887 | (goto-char 3) | ||
| 4888 | (delete-char 2) | ||
| 4889 | (goto-char 3) | ||
| 4890 | (delete-char 0) | ||
| 4891 | (goto-char 1) | ||
| 4892 | (insert "......") | ||
| 4893 | (goto-char 8) | ||
| 4894 | (widen) | ||
| 4895 | (narrow-to-region 39 2) | ||
| 4896 | (goto-char 13) | ||
| 4897 | (delete-char 12) | ||
| 4898 | (goto-char 24) | ||
| 4899 | (delete-char 0) | ||
| 4900 | (should | ||
| 4901 | (equal | ||
| 4902 | (test-overlay-regions) | ||
| 4903 | '((7 . 20) | ||
| 4904 | (9 . 20) | ||
| 4905 | (13 . 36) | ||
| 4906 | (20 . 20) | ||
| 4907 | (20 . 20) | ||
| 4908 | (20 . 20) | ||
| 4909 | (20 . 20) | ||
| 4910 | (20 . 29) | ||
| 4911 | (20 . 33) | ||
| 4912 | (20 . 36) | ||
| 4913 | (20 . 39) | ||
| 4914 | (20 . 43) | ||
| 4915 | (20 . 43)))))) | ||
| 4916 | |||
| 4917 | (ert-deftest overlay-autogenerated-test-37 nil | ||
| 4918 | (with-temp-buffer | ||
| 4919 | (insert "................................................................") | ||
| 4920 | (make-overlay 26 30 nil nil nil) | ||
| 4921 | (make-overlay 55 50 nil nil t) | ||
| 4922 | (make-overlay 43 54 nil nil t) | ||
| 4923 | (make-overlay 53 48 nil nil nil) | ||
| 4924 | (make-overlay 37 51 nil nil t) | ||
| 4925 | (make-overlay 15 30 nil nil nil) | ||
| 4926 | (make-overlay 2 24 nil t t) | ||
| 4927 | (make-overlay 56 61 nil t nil) | ||
| 4928 | (make-overlay 65 46 nil t nil) | ||
| 4929 | (make-overlay 28 47 nil t nil) | ||
| 4930 | (make-overlay 21 24 nil t t) | ||
| 4931 | (make-overlay 17 13 nil t t) | ||
| 4932 | (make-overlay 7 44 nil t nil) | ||
| 4933 | (make-overlay 28 63 nil nil nil) | ||
| 4934 | (make-overlay 22 16 nil t t) | ||
| 4935 | (make-overlay 26 44 nil t t) | ||
| 4936 | (goto-char 57) | ||
| 4937 | (delete-char 6) | ||
| 4938 | (goto-char 42) | ||
| 4939 | (insert ".....") | ||
| 4940 | (goto-char 63) | ||
| 4941 | (insert ".............") | ||
| 4942 | (goto-char 17) | ||
| 4943 | (insert "") | ||
| 4944 | (goto-char 57) | ||
| 4945 | (insert "...........") | ||
| 4946 | (goto-char 3) | ||
| 4947 | (delete-char 47) | ||
| 4948 | (goto-char 15) | ||
| 4949 | (insert ".............") | ||
| 4950 | (goto-char 28) | ||
| 4951 | (insert "") | ||
| 4952 | (goto-char 17) | ||
| 4953 | (delete-char 31) | ||
| 4954 | (goto-char 7) | ||
| 4955 | (delete-char 16) | ||
| 4956 | (goto-char 2) | ||
| 4957 | (insert "...........") | ||
| 4958 | (goto-char 2) | ||
| 4959 | (insert "..") | ||
| 4960 | (goto-char 18) | ||
| 4961 | (widen) | ||
| 4962 | (narrow-to-region 20 8) | ||
| 4963 | (goto-char 13) | ||
| 4964 | (widen) | ||
| 4965 | (narrow-to-region 12 10) | ||
| 4966 | (goto-char 10) | ||
| 4967 | (delete-char 1) | ||
| 4968 | (goto-char 11) | ||
| 4969 | (delete-char 0) | ||
| 4970 | (goto-char 10) | ||
| 4971 | (insert "...") | ||
| 4972 | (goto-char 11) | ||
| 4973 | (delete-char 0) | ||
| 4974 | (goto-char 13) | ||
| 4975 | (insert "..") | ||
| 4976 | (goto-char 16) | ||
| 4977 | (delete-char 0) | ||
| 4978 | (goto-char 10) | ||
| 4979 | (delete-char 2) | ||
| 4980 | (goto-char 11) | ||
| 4981 | (insert ".....") | ||
| 4982 | (goto-char 16) | ||
| 4983 | (widen) | ||
| 4984 | (narrow-to-region 6 13) | ||
| 4985 | (goto-char 10) | ||
| 4986 | (insert "..") | ||
| 4987 | (goto-char 6) | ||
| 4988 | (delete-char 6) | ||
| 4989 | (goto-char 8) | ||
| 4990 | (insert "...............") | ||
| 4991 | (goto-char 21) | ||
| 4992 | (delete-char 0) | ||
| 4993 | (goto-char 21) | ||
| 4994 | (widen) | ||
| 4995 | (narrow-to-region 36 11) | ||
| 4996 | (goto-char 12) | ||
| 4997 | (insert "...............") | ||
| 4998 | (goto-char 19) | ||
| 4999 | (insert ".......") | ||
| 5000 | (goto-char 56) | ||
| 5001 | (delete-char 2) | ||
| 5002 | (goto-char 42) | ||
| 5003 | (delete-char 11) | ||
| 5004 | (should | ||
| 5005 | (equal | ||
| 5006 | (test-overlay-regions) | ||
| 5007 | '((44 . 45)))))) | ||
| 5008 | |||
| 5009 | (ert-deftest overlay-autogenerated-test-38 nil | ||
| 5010 | (with-temp-buffer | ||
| 5011 | (insert "................................................................") | ||
| 5012 | (make-overlay 29 13 nil t t) | ||
| 5013 | (make-overlay 19 28 nil nil t) | ||
| 5014 | (make-overlay 47 33 nil nil nil) | ||
| 5015 | (make-overlay 8 44 nil t nil) | ||
| 5016 | (make-overlay 48 4 nil t nil) | ||
| 5017 | (make-overlay 8 20 nil t t) | ||
| 5018 | (make-overlay 38 31 nil nil t) | ||
| 5019 | (make-overlay 17 65 nil nil t) | ||
| 5020 | (make-overlay 49 31 nil nil nil) | ||
| 5021 | (make-overlay 39 19 nil nil t) | ||
| 5022 | (make-overlay 40 49 nil t t) | ||
| 5023 | (make-overlay 24 16 nil t t) | ||
| 5024 | (make-overlay 4 41 nil t nil) | ||
| 5025 | (make-overlay 61 42 nil t nil) | ||
| 5026 | (make-overlay 46 11 nil nil nil) | ||
| 5027 | (make-overlay 1 43 nil nil t) | ||
| 5028 | (goto-char 62) | ||
| 5029 | (delete-char 2) | ||
| 5030 | (goto-char 25) | ||
| 5031 | (widen) | ||
| 5032 | (narrow-to-region 30 38) | ||
| 5033 | (goto-char 37) | ||
| 5034 | (delete-char 1) | ||
| 5035 | (goto-char 37) | ||
| 5036 | (insert "...........") | ||
| 5037 | (goto-char 41) | ||
| 5038 | (delete-char 3) | ||
| 5039 | (goto-char 39) | ||
| 5040 | (delete-char 5) | ||
| 5041 | (goto-char 39) | ||
| 5042 | (widen) | ||
| 5043 | (narrow-to-region 31 9) | ||
| 5044 | (goto-char 11) | ||
| 5045 | (insert "..............") | ||
| 5046 | (goto-char 9) | ||
| 5047 | (widen) | ||
| 5048 | (narrow-to-region 62 30) | ||
| 5049 | (goto-char 32) | ||
| 5050 | (widen) | ||
| 5051 | (narrow-to-region 17 48) | ||
| 5052 | (goto-char 39) | ||
| 5053 | (delete-char 7) | ||
| 5054 | (goto-char 24) | ||
| 5055 | (delete-char 8) | ||
| 5056 | (goto-char 19) | ||
| 5057 | (insert "") | ||
| 5058 | (goto-char 25) | ||
| 5059 | (delete-char 5) | ||
| 5060 | (goto-char 28) | ||
| 5061 | (delete-char 0) | ||
| 5062 | (goto-char 22) | ||
| 5063 | (widen) | ||
| 5064 | (narrow-to-region 52 35) | ||
| 5065 | (goto-char 49) | ||
| 5066 | (delete-char 0) | ||
| 5067 | (goto-char 49) | ||
| 5068 | (delete-char 3) | ||
| 5069 | (goto-char 48) | ||
| 5070 | (insert "...........") | ||
| 5071 | (goto-char 37) | ||
| 5072 | (delete-char 23) | ||
| 5073 | (goto-char 36) | ||
| 5074 | (delete-char 0) | ||
| 5075 | (goto-char 35) | ||
| 5076 | (insert "....") | ||
| 5077 | (goto-char 35) | ||
| 5078 | (insert "..") | ||
| 5079 | (goto-char 39) | ||
| 5080 | (delete-char 4) | ||
| 5081 | (goto-char 39) | ||
| 5082 | (delete-char 0) | ||
| 5083 | (goto-char 36) | ||
| 5084 | (delete-char 3) | ||
| 5085 | (goto-char 36) | ||
| 5086 | (delete-char 0) | ||
| 5087 | (goto-char 36) | ||
| 5088 | (delete-char 0) | ||
| 5089 | (goto-char 36) | ||
| 5090 | (delete-char 0) | ||
| 5091 | (goto-char 36) | ||
| 5092 | (insert ".....") | ||
| 5093 | (goto-char 38) | ||
| 5094 | (delete-char 1) | ||
| 5095 | (goto-char 35) | ||
| 5096 | (delete-char 3) | ||
| 5097 | (should | ||
| 5098 | (equal | ||
| 5099 | (test-overlay-regions) | ||
| 5100 | '((1 . 37) | ||
| 5101 | (24 . 44) | ||
| 5102 | (25 . 37)))))) | ||
| 5103 | |||
| 5104 | (ert-deftest overlay-autogenerated-test-39 nil | ||
| 5105 | (with-temp-buffer | ||
| 5106 | (insert "................................................................") | ||
| 5107 | (make-overlay 15 49 nil t t) | ||
| 5108 | (make-overlay 27 20 nil t nil) | ||
| 5109 | (make-overlay 55 50 nil t nil) | ||
| 5110 | (make-overlay 17 5 nil t t) | ||
| 5111 | (make-overlay 26 56 nil nil t) | ||
| 5112 | (make-overlay 42 11 nil t t) | ||
| 5113 | (make-overlay 24 35 nil nil t) | ||
| 5114 | (make-overlay 47 45 nil t t) | ||
| 5115 | (make-overlay 37 12 nil nil t) | ||
| 5116 | (make-overlay 17 25 nil t nil) | ||
| 5117 | (make-overlay 32 53 nil nil nil) | ||
| 5118 | (make-overlay 20 34 nil nil t) | ||
| 5119 | (make-overlay 56 58 nil nil t) | ||
| 5120 | (make-overlay 42 31 nil nil t) | ||
| 5121 | (make-overlay 22 55 nil t t) | ||
| 5122 | (make-overlay 55 11 nil t nil) | ||
| 5123 | (goto-char 16) | ||
| 5124 | (insert ".............") | ||
| 5125 | (goto-char 30) | ||
| 5126 | (insert ".") | ||
| 5127 | (goto-char 12) | ||
| 5128 | (delete-char 56) | ||
| 5129 | (goto-char 9) | ||
| 5130 | (insert ".............") | ||
| 5131 | (goto-char 6) | ||
| 5132 | (insert "....") | ||
| 5133 | (goto-char 19) | ||
| 5134 | (delete-char 19) | ||
| 5135 | (goto-char 19) | ||
| 5136 | (insert "...............") | ||
| 5137 | (goto-char 13) | ||
| 5138 | (delete-char 21) | ||
| 5139 | (goto-char 7) | ||
| 5140 | (delete-char 0) | ||
| 5141 | (goto-char 14) | ||
| 5142 | (widen) | ||
| 5143 | (narrow-to-region 5 6) | ||
| 5144 | (goto-char 5) | ||
| 5145 | (delete-char 0) | ||
| 5146 | (goto-char 6) | ||
| 5147 | (insert "......") | ||
| 5148 | (goto-char 10) | ||
| 5149 | (delete-char 0) | ||
| 5150 | (goto-char 7) | ||
| 5151 | (widen) | ||
| 5152 | (narrow-to-region 2 6) | ||
| 5153 | (goto-char 2) | ||
| 5154 | (insert "..........") | ||
| 5155 | (goto-char 2) | ||
| 5156 | (delete-char 9) | ||
| 5157 | (goto-char 7) | ||
| 5158 | (insert "...") | ||
| 5159 | (goto-char 9) | ||
| 5160 | (insert "...") | ||
| 5161 | (goto-char 10) | ||
| 5162 | (insert "......") | ||
| 5163 | (goto-char 4) | ||
| 5164 | (delete-char 14) | ||
| 5165 | (goto-char 4) | ||
| 5166 | (insert ".") | ||
| 5167 | (goto-char 5) | ||
| 5168 | (insert "..............") | ||
| 5169 | (goto-char 13) | ||
| 5170 | (insert "......") | ||
| 5171 | (goto-char 10) | ||
| 5172 | (insert "......") | ||
| 5173 | (goto-char 20) | ||
| 5174 | (insert "............") | ||
| 5175 | (goto-char 16) | ||
| 5176 | (widen) | ||
| 5177 | (narrow-to-region 3 32) | ||
| 5178 | (goto-char 18) | ||
| 5179 | (insert "..") | ||
| 5180 | (goto-char 6) | ||
| 5181 | (insert "......") | ||
| 5182 | (goto-char 38) | ||
| 5183 | (delete-char 0) | ||
| 5184 | (goto-char 31) | ||
| 5185 | (insert "............") | ||
| 5186 | (goto-char 28) | ||
| 5187 | (insert "") | ||
| 5188 | (goto-char 9) | ||
| 5189 | (delete-char 23) | ||
| 5190 | (should | ||
| 5191 | (equal | ||
| 5192 | (test-overlay-regions) | ||
| 5193 | 'nil)))) | ||
| 5194 | |||
| 5195 | (ert-deftest overlay-autogenerated-test-40 nil | ||
| 5196 | (with-temp-buffer | ||
| 5197 | (insert "................................................................") | ||
| 5198 | (make-overlay 52 3 nil t nil) | ||
| 5199 | (make-overlay 35 41 nil t t) | ||
| 5200 | (make-overlay 4 2 nil t nil) | ||
| 5201 | (make-overlay 51 48 nil nil t) | ||
| 5202 | (make-overlay 44 57 nil t t) | ||
| 5203 | (make-overlay 13 32 nil nil nil) | ||
| 5204 | (make-overlay 46 29 nil t nil) | ||
| 5205 | (make-overlay 28 13 nil t nil) | ||
| 5206 | (make-overlay 10 65 nil t t) | ||
| 5207 | (make-overlay 41 48 nil nil t) | ||
| 5208 | (make-overlay 36 44 nil nil t) | ||
| 5209 | (make-overlay 29 61 nil t nil) | ||
| 5210 | (make-overlay 25 24 nil nil t) | ||
| 5211 | (make-overlay 22 45 nil nil t) | ||
| 5212 | (make-overlay 37 55 nil nil t) | ||
| 5213 | (make-overlay 36 39 nil nil nil) | ||
| 5214 | (goto-char 16) | ||
| 5215 | (delete-char 48) | ||
| 5216 | (goto-char 17) | ||
| 5217 | (delete-char 0) | ||
| 5218 | (goto-char 7) | ||
| 5219 | (insert "..............") | ||
| 5220 | (goto-char 30) | ||
| 5221 | (insert "........") | ||
| 5222 | (goto-char 11) | ||
| 5223 | (insert "..........") | ||
| 5224 | (goto-char 5) | ||
| 5225 | (delete-char 14) | ||
| 5226 | (goto-char 19) | ||
| 5227 | (insert ".") | ||
| 5228 | (goto-char 27) | ||
| 5229 | (insert "..") | ||
| 5230 | (goto-char 35) | ||
| 5231 | (delete-char 1) | ||
| 5232 | (goto-char 29) | ||
| 5233 | (delete-char 0) | ||
| 5234 | (goto-char 33) | ||
| 5235 | (delete-char 2) | ||
| 5236 | (goto-char 33) | ||
| 5237 | (insert "..") | ||
| 5238 | (goto-char 28) | ||
| 5239 | (insert ".........") | ||
| 5240 | (goto-char 30) | ||
| 5241 | (delete-char 4) | ||
| 5242 | (goto-char 40) | ||
| 5243 | (delete-char 1) | ||
| 5244 | (goto-char 15) | ||
| 5245 | (widen) | ||
| 5246 | (narrow-to-region 40 8) | ||
| 5247 | (goto-char 10) | ||
| 5248 | (delete-char 13) | ||
| 5249 | (goto-char 11) | ||
| 5250 | (delete-char 5) | ||
| 5251 | (goto-char 15) | ||
| 5252 | (insert "........") | ||
| 5253 | (goto-char 26) | ||
| 5254 | (delete-char 4) | ||
| 5255 | (goto-char 11) | ||
| 5256 | (delete-char 1) | ||
| 5257 | (goto-char 14) | ||
| 5258 | (insert "............") | ||
| 5259 | (goto-char 33) | ||
| 5260 | (insert ".") | ||
| 5261 | (goto-char 10) | ||
| 5262 | (insert "...") | ||
| 5263 | (goto-char 30) | ||
| 5264 | (widen) | ||
| 5265 | (narrow-to-region 28 9) | ||
| 5266 | (goto-char 27) | ||
| 5267 | (delete-char 0) | ||
| 5268 | (goto-char 27) | ||
| 5269 | (delete-char 1) | ||
| 5270 | (goto-char 26) | ||
| 5271 | (insert "..") | ||
| 5272 | (goto-char 27) | ||
| 5273 | (insert "..") | ||
| 5274 | (goto-char 20) | ||
| 5275 | (delete-char 5) | ||
| 5276 | (goto-char 12) | ||
| 5277 | (widen) | ||
| 5278 | (narrow-to-region 40 30) | ||
| 5279 | (goto-char 37) | ||
| 5280 | (delete-char 3) | ||
| 5281 | (should | ||
| 5282 | (equal | ||
| 5283 | (test-overlay-regions) | ||
| 5284 | '((13 . 37) | ||
| 5285 | (14 . 37) | ||
| 5286 | (14 . 37) | ||
| 5287 | (14 . 37) | ||
| 5288 | (14 . 37) | ||
| 5289 | (14 . 37) | ||
| 5290 | (14 . 37) | ||
| 5291 | (37 . 37) | ||
| 5292 | (37 . 37)))))) | ||
| 5293 | |||
| 5294 | (ert-deftest overlay-autogenerated-test-41 nil | ||
| 5295 | (with-temp-buffer | ||
| 5296 | (insert "................................................................") | ||
| 5297 | (make-overlay 28 48 nil nil t) | ||
| 5298 | (make-overlay 30 11 nil nil t) | ||
| 5299 | (make-overlay 7 12 nil t nil) | ||
| 5300 | (make-overlay 65 35 nil t nil) | ||
| 5301 | (make-overlay 22 61 nil t nil) | ||
| 5302 | (make-overlay 37 42 nil nil nil) | ||
| 5303 | (make-overlay 33 38 nil nil t) | ||
| 5304 | (make-overlay 48 45 nil t t) | ||
| 5305 | (make-overlay 45 62 nil t nil) | ||
| 5306 | (make-overlay 63 7 nil nil t) | ||
| 5307 | (make-overlay 23 42 nil t nil) | ||
| 5308 | (make-overlay 21 4 nil t nil) | ||
| 5309 | (make-overlay 64 41 nil t nil) | ||
| 5310 | (make-overlay 20 33 nil t t) | ||
| 5311 | (make-overlay 41 26 nil t nil) | ||
| 5312 | (make-overlay 43 31 nil t t) | ||
| 5313 | (goto-char 55) | ||
| 5314 | (delete-char 3) | ||
| 5315 | (goto-char 12) | ||
| 5316 | (insert "..") | ||
| 5317 | (goto-char 62) | ||
| 5318 | (insert "") | ||
| 5319 | (goto-char 24) | ||
| 5320 | (delete-char 2) | ||
| 5321 | (goto-char 41) | ||
| 5322 | (insert "............") | ||
| 5323 | (goto-char 2) | ||
| 5324 | (insert ".") | ||
| 5325 | (goto-char 55) | ||
| 5326 | (insert "........") | ||
| 5327 | (goto-char 67) | ||
| 5328 | (delete-char 6) | ||
| 5329 | (goto-char 58) | ||
| 5330 | (delete-char 10) | ||
| 5331 | (goto-char 29) | ||
| 5332 | (insert "") | ||
| 5333 | (goto-char 6) | ||
| 5334 | (widen) | ||
| 5335 | (narrow-to-region 44 45) | ||
| 5336 | (goto-char 44) | ||
| 5337 | (delete-char 1) | ||
| 5338 | (goto-char 44) | ||
| 5339 | (widen) | ||
| 5340 | (narrow-to-region 24 37) | ||
| 5341 | (goto-char 30) | ||
| 5342 | (delete-char 7) | ||
| 5343 | (goto-char 27) | ||
| 5344 | (insert "......") | ||
| 5345 | (goto-char 35) | ||
| 5346 | (delete-char 0) | ||
| 5347 | (goto-char 32) | ||
| 5348 | (insert "...............") | ||
| 5349 | (goto-char 37) | ||
| 5350 | (delete-char 9) | ||
| 5351 | (goto-char 40) | ||
| 5352 | (insert "..........") | ||
| 5353 | (goto-char 35) | ||
| 5354 | (insert "......") | ||
| 5355 | (goto-char 25) | ||
| 5356 | (delete-char 7) | ||
| 5357 | (goto-char 40) | ||
| 5358 | (delete-char 4) | ||
| 5359 | (goto-char 25) | ||
| 5360 | (delete-char 14) | ||
| 5361 | (goto-char 28) | ||
| 5362 | (insert "") | ||
| 5363 | (goto-char 28) | ||
| 5364 | (widen) | ||
| 5365 | (narrow-to-region 17 43) | ||
| 5366 | (goto-char 20) | ||
| 5367 | (insert "..........") | ||
| 5368 | (goto-char 22) | ||
| 5369 | (delete-char 2) | ||
| 5370 | (goto-char 48) | ||
| 5371 | (insert "............") | ||
| 5372 | (goto-char 47) | ||
| 5373 | (insert ".........") | ||
| 5374 | (goto-char 69) | ||
| 5375 | (widen) | ||
| 5376 | (narrow-to-region 52 25) | ||
| 5377 | (goto-char 26) | ||
| 5378 | (insert "......") | ||
| 5379 | (goto-char 53) | ||
| 5380 | (insert "..") | ||
| 5381 | (should | ||
| 5382 | (equal | ||
| 5383 | (test-overlay-regions) | ||
| 5384 | '((5 . 38) | ||
| 5385 | (8 . 97) | ||
| 5386 | (12 . 47) | ||
| 5387 | (37 . 47) | ||
| 5388 | (39 . 52) | ||
| 5389 | (39 . 87) | ||
| 5390 | (39 . 95) | ||
| 5391 | (46 . 90) | ||
| 5392 | (47 . 49) | ||
| 5393 | (47 . 90) | ||
| 5394 | (47 . 99) | ||
| 5395 | (48 . 87)))))) | ||
| 5396 | |||
| 5397 | (ert-deftest overlay-autogenerated-test-42 nil | ||
| 5398 | (with-temp-buffer | ||
| 5399 | (insert "................................................................") | ||
| 5400 | (make-overlay 20 23 nil nil nil) | ||
| 5401 | (make-overlay 45 51 nil t nil) | ||
| 5402 | (make-overlay 34 58 nil t nil) | ||
| 5403 | (make-overlay 27 11 nil nil nil) | ||
| 5404 | (make-overlay 14 8 nil t t) | ||
| 5405 | (make-overlay 64 43 nil t nil) | ||
| 5406 | (make-overlay 61 56 nil nil t) | ||
| 5407 | (make-overlay 28 14 nil t nil) | ||
| 5408 | (make-overlay 21 46 nil t t) | ||
| 5409 | (make-overlay 30 34 nil t t) | ||
| 5410 | (make-overlay 47 40 nil nil nil) | ||
| 5411 | (make-overlay 5 44 nil t t) | ||
| 5412 | (make-overlay 11 45 nil nil nil) | ||
| 5413 | (make-overlay 65 8 nil nil t) | ||
| 5414 | (make-overlay 47 54 nil t t) | ||
| 5415 | (make-overlay 37 57 nil t nil) | ||
| 5416 | (goto-char 11) | ||
| 5417 | (insert "....") | ||
| 5418 | (goto-char 65) | ||
| 5419 | (delete-char 0) | ||
| 5420 | (goto-char 56) | ||
| 5421 | (delete-char 4) | ||
| 5422 | (goto-char 11) | ||
| 5423 | (delete-char 2) | ||
| 5424 | (goto-char 23) | ||
| 5425 | (insert ".............") | ||
| 5426 | (goto-char 2) | ||
| 5427 | (insert "............") | ||
| 5428 | (goto-char 84) | ||
| 5429 | (delete-char 1) | ||
| 5430 | (goto-char 10) | ||
| 5431 | (insert "..............") | ||
| 5432 | (goto-char 19) | ||
| 5433 | (insert "............") | ||
| 5434 | (goto-char 69) | ||
| 5435 | (delete-char 6) | ||
| 5436 | (goto-char 15) | ||
| 5437 | (insert "........") | ||
| 5438 | (goto-char 104) | ||
| 5439 | (insert "") | ||
| 5440 | (goto-char 94) | ||
| 5441 | (delete-char 11) | ||
| 5442 | (goto-char 66) | ||
| 5443 | (insert ".....") | ||
| 5444 | (goto-char 67) | ||
| 5445 | (insert "") | ||
| 5446 | (goto-char 53) | ||
| 5447 | (delete-char 22) | ||
| 5448 | (goto-char 42) | ||
| 5449 | (insert ".") | ||
| 5450 | (goto-char 38) | ||
| 5451 | (delete-char 13) | ||
| 5452 | (goto-char 27) | ||
| 5453 | (insert "......") | ||
| 5454 | (goto-char 16) | ||
| 5455 | (insert "............") | ||
| 5456 | (goto-char 71) | ||
| 5457 | (widen) | ||
| 5458 | (narrow-to-region 59 15) | ||
| 5459 | (goto-char 46) | ||
| 5460 | (insert "..") | ||
| 5461 | (goto-char 20) | ||
| 5462 | (widen) | ||
| 5463 | (narrow-to-region 95 93) | ||
| 5464 | (goto-char 94) | ||
| 5465 | (insert ".............") | ||
| 5466 | (goto-char 103) | ||
| 5467 | (widen) | ||
| 5468 | (narrow-to-region 97 7) | ||
| 5469 | (goto-char 93) | ||
| 5470 | (insert "....") | ||
| 5471 | (goto-char 85) | ||
| 5472 | (insert "...........") | ||
| 5473 | (goto-char 69) | ||
| 5474 | (delete-char 24) | ||
| 5475 | (goto-char 87) | ||
| 5476 | (insert ".............") | ||
| 5477 | (goto-char 7) | ||
| 5478 | (delete-char 28) | ||
| 5479 | (goto-char 65) | ||
| 5480 | (delete-char 8) | ||
| 5481 | (goto-char 48) | ||
| 5482 | (insert "......") | ||
| 5483 | (should | ||
| 5484 | (equal | ||
| 5485 | (test-overlay-regions) | ||
| 5486 | '((31 . 44) | ||
| 5487 | (33 . 33) | ||
| 5488 | (33 . 41) | ||
| 5489 | (33 . 41) | ||
| 5490 | (33 . 41) | ||
| 5491 | (33 . 41) | ||
| 5492 | (33 . 82) | ||
| 5493 | (40 . 44) | ||
| 5494 | (41 . 41) | ||
| 5495 | (41 . 41) | ||
| 5496 | (41 . 47) | ||
| 5497 | (41 . 48) | ||
| 5498 | (44 . 45) | ||
| 5499 | (44 . 46) | ||
| 5500 | (44 . 63) | ||
| 5501 | (46 . 57)))))) | ||
| 5502 | |||
| 5503 | (ert-deftest overlay-autogenerated-test-43 nil | ||
| 5504 | (with-temp-buffer | ||
| 5505 | (insert "................................................................") | ||
| 5506 | (make-overlay 8 53 nil t nil) | ||
| 5507 | (make-overlay 11 50 nil t nil) | ||
| 5508 | (make-overlay 1 30 nil nil nil) | ||
| 5509 | (make-overlay 54 15 nil t t) | ||
| 5510 | (make-overlay 22 30 nil nil nil) | ||
| 5511 | (make-overlay 1 33 nil nil nil) | ||
| 5512 | (make-overlay 18 15 nil t nil) | ||
| 5513 | (make-overlay 43 39 nil nil t) | ||
| 5514 | (make-overlay 43 17 nil t nil) | ||
| 5515 | (make-overlay 2 29 nil t nil) | ||
| 5516 | (make-overlay 57 42 nil t nil) | ||
| 5517 | (make-overlay 40 1 nil nil nil) | ||
| 5518 | (make-overlay 8 64 nil nil nil) | ||
| 5519 | (make-overlay 64 15 nil nil nil) | ||
| 5520 | (make-overlay 9 11 nil nil t) | ||
| 5521 | (make-overlay 40 21 nil t nil) | ||
| 5522 | (goto-char 5) | ||
| 5523 | (delete-char 37) | ||
| 5524 | (goto-char 25) | ||
| 5525 | (delete-char 2) | ||
| 5526 | (goto-char 17) | ||
| 5527 | (insert "...........") | ||
| 5528 | (goto-char 19) | ||
| 5529 | (widen) | ||
| 5530 | (narrow-to-region 20 20) | ||
| 5531 | (goto-char 20) | ||
| 5532 | (delete-char 0) | ||
| 5533 | (goto-char 20) | ||
| 5534 | (insert "..........") | ||
| 5535 | (goto-char 24) | ||
| 5536 | (delete-char 5) | ||
| 5537 | (goto-char 24) | ||
| 5538 | (insert "...") | ||
| 5539 | (goto-char 28) | ||
| 5540 | (widen) | ||
| 5541 | (narrow-to-region 20 36) | ||
| 5542 | (goto-char 26) | ||
| 5543 | (delete-char 2) | ||
| 5544 | (goto-char 31) | ||
| 5545 | (insert ".............") | ||
| 5546 | (goto-char 22) | ||
| 5547 | (insert ".....") | ||
| 5548 | (goto-char 38) | ||
| 5549 | (delete-char 0) | ||
| 5550 | (goto-char 31) | ||
| 5551 | (delete-char 4) | ||
| 5552 | (goto-char 27) | ||
| 5553 | (insert "...") | ||
| 5554 | (goto-char 23) | ||
| 5555 | (widen) | ||
| 5556 | (narrow-to-region 37 20) | ||
| 5557 | (goto-char 22) | ||
| 5558 | (insert ".............") | ||
| 5559 | (goto-char 33) | ||
| 5560 | (insert "......") | ||
| 5561 | (goto-char 43) | ||
| 5562 | (insert "............") | ||
| 5563 | (goto-char 59) | ||
| 5564 | (insert ".......") | ||
| 5565 | (goto-char 25) | ||
| 5566 | (delete-char 26) | ||
| 5567 | (goto-char 49) | ||
| 5568 | (insert ".........") | ||
| 5569 | (goto-char 50) | ||
| 5570 | (insert ".......") | ||
| 5571 | (goto-char 39) | ||
| 5572 | (widen) | ||
| 5573 | (narrow-to-region 54 86) | ||
| 5574 | (goto-char 64) | ||
| 5575 | (insert "...............") | ||
| 5576 | (goto-char 83) | ||
| 5577 | (insert "............") | ||
| 5578 | (goto-char 70) | ||
| 5579 | (insert "........") | ||
| 5580 | (goto-char 58) | ||
| 5581 | (insert "..............") | ||
| 5582 | (goto-char 83) | ||
| 5583 | (insert "............") | ||
| 5584 | (goto-char 83) | ||
| 5585 | (insert "..........") | ||
| 5586 | (goto-char 69) | ||
| 5587 | (delete-char 75) | ||
| 5588 | (goto-char 75) | ||
| 5589 | (delete-char 3) | ||
| 5590 | (should | ||
| 5591 | (equal | ||
| 5592 | (test-overlay-regions) | ||
| 5593 | '((5 . 75) | ||
| 5594 | (5 . 75) | ||
| 5595 | (5 . 80) | ||
| 5596 | (5 . 80)))))) | ||
| 5597 | |||
| 5598 | (ert-deftest overlay-autogenerated-test-44 nil | ||
| 5599 | (with-temp-buffer | ||
| 5600 | (insert "................................................................") | ||
| 5601 | (make-overlay 8 48 nil nil t) | ||
| 5602 | (make-overlay 52 38 nil nil nil) | ||
| 5603 | (make-overlay 3 63 nil nil nil) | ||
| 5604 | (make-overlay 44 15 nil nil t) | ||
| 5605 | (make-overlay 27 44 nil nil t) | ||
| 5606 | (make-overlay 43 9 nil nil t) | ||
| 5607 | (make-overlay 11 27 nil t nil) | ||
| 5608 | (make-overlay 36 41 nil nil t) | ||
| 5609 | (make-overlay 23 25 nil t t) | ||
| 5610 | (make-overlay 19 60 nil t t) | ||
| 5611 | (make-overlay 11 55 nil t nil) | ||
| 5612 | (make-overlay 59 2 nil t nil) | ||
| 5613 | (make-overlay 32 64 nil t nil) | ||
| 5614 | (make-overlay 15 8 nil nil nil) | ||
| 5615 | (make-overlay 61 15 nil nil nil) | ||
| 5616 | (make-overlay 64 30 nil t t) | ||
| 5617 | (goto-char 42) | ||
| 5618 | (delete-char 20) | ||
| 5619 | (goto-char 44) | ||
| 5620 | (delete-char 1) | ||
| 5621 | (goto-char 43) | ||
| 5622 | (insert "...........") | ||
| 5623 | (goto-char 43) | ||
| 5624 | (delete-char 1) | ||
| 5625 | (goto-char 28) | ||
| 5626 | (delete-char 8) | ||
| 5627 | (goto-char 37) | ||
| 5628 | (delete-char 9) | ||
| 5629 | (goto-char 4) | ||
| 5630 | (delete-char 30) | ||
| 5631 | (goto-char 6) | ||
| 5632 | (delete-char 0) | ||
| 5633 | (goto-char 7) | ||
| 5634 | (delete-char 0) | ||
| 5635 | (goto-char 2) | ||
| 5636 | (delete-char 2) | ||
| 5637 | (goto-char 5) | ||
| 5638 | (delete-char 0) | ||
| 5639 | (goto-char 5) | ||
| 5640 | (delete-char 0) | ||
| 5641 | (goto-char 2) | ||
| 5642 | (insert ".....") | ||
| 5643 | (goto-char 10) | ||
| 5644 | (insert "...........") | ||
| 5645 | (goto-char 21) | ||
| 5646 | (insert "...") | ||
| 5647 | (goto-char 10) | ||
| 5648 | (delete-char 13) | ||
| 5649 | (goto-char 9) | ||
| 5650 | (insert "..........") | ||
| 5651 | (goto-char 16) | ||
| 5652 | (delete-char 1) | ||
| 5653 | (goto-char 16) | ||
| 5654 | (delete-char 4) | ||
| 5655 | (goto-char 16) | ||
| 5656 | (delete-char 0) | ||
| 5657 | (goto-char 14) | ||
| 5658 | (delete-char 1) | ||
| 5659 | (goto-char 3) | ||
| 5660 | (widen) | ||
| 5661 | (narrow-to-region 2 9) | ||
| 5662 | (goto-char 2) | ||
| 5663 | (insert "") | ||
| 5664 | (goto-char 2) | ||
| 5665 | (insert ".............") | ||
| 5666 | (goto-char 17) | ||
| 5667 | (insert "....") | ||
| 5668 | (goto-char 12) | ||
| 5669 | (insert "........") | ||
| 5670 | (goto-char 8) | ||
| 5671 | (widen) | ||
| 5672 | (narrow-to-region 32 23) | ||
| 5673 | (goto-char 29) | ||
| 5674 | (insert ".....") | ||
| 5675 | (goto-char 35) | ||
| 5676 | (delete-char 2) | ||
| 5677 | (goto-char 27) | ||
| 5678 | (delete-char 7) | ||
| 5679 | (goto-char 23) | ||
| 5680 | (widen) | ||
| 5681 | (narrow-to-region 4 14) | ||
| 5682 | (goto-char 8) | ||
| 5683 | (insert "...............") | ||
| 5684 | (should | ||
| 5685 | (equal | ||
| 5686 | (test-overlay-regions) | ||
| 5687 | '((2 . 43) | ||
| 5688 | (2 . 43) | ||
| 5689 | (2 . 43) | ||
| 5690 | (2 . 43) | ||
| 5691 | (2 . 43) | ||
| 5692 | (2 . 44)))))) | ||
| 5693 | |||
| 5694 | (ert-deftest overlay-autogenerated-test-45 nil | ||
| 5695 | (with-temp-buffer | ||
| 5696 | (insert "................................................................") | ||
| 5697 | (make-overlay 15 48 nil nil nil) | ||
| 5698 | (make-overlay 1 47 nil t nil) | ||
| 5699 | (make-overlay 43 4 nil t t) | ||
| 5700 | (make-overlay 9 45 nil t t) | ||
| 5701 | (make-overlay 1 25 nil t t) | ||
| 5702 | (make-overlay 5 46 nil t t) | ||
| 5703 | (make-overlay 7 14 nil t nil) | ||
| 5704 | (make-overlay 1 53 nil nil t) | ||
| 5705 | (make-overlay 13 41 nil t nil) | ||
| 5706 | (make-overlay 5 31 nil t t) | ||
| 5707 | (make-overlay 26 10 nil nil nil) | ||
| 5708 | (make-overlay 56 37 nil nil nil) | ||
| 5709 | (make-overlay 23 15 nil t nil) | ||
| 5710 | (make-overlay 62 30 nil t t) | ||
| 5711 | (make-overlay 2 35 nil t t) | ||
| 5712 | (make-overlay 46 41 nil nil nil) | ||
| 5713 | (goto-char 65) | ||
| 5714 | (delete-char 0) | ||
| 5715 | (goto-char 55) | ||
| 5716 | (insert "...........") | ||
| 5717 | (goto-char 22) | ||
| 5718 | (insert "") | ||
| 5719 | (goto-char 73) | ||
| 5720 | (delete-char 3) | ||
| 5721 | (goto-char 43) | ||
| 5722 | (widen) | ||
| 5723 | (narrow-to-region 54 63) | ||
| 5724 | (goto-char 56) | ||
| 5725 | (insert "......") | ||
| 5726 | (goto-char 61) | ||
| 5727 | (delete-char 3) | ||
| 5728 | (goto-char 65) | ||
| 5729 | (insert "......") | ||
| 5730 | (goto-char 66) | ||
| 5731 | (insert ".....") | ||
| 5732 | (goto-char 62) | ||
| 5733 | (insert ".") | ||
| 5734 | (goto-char 74) | ||
| 5735 | (insert ".........") | ||
| 5736 | (goto-char 76) | ||
| 5737 | (delete-char 4) | ||
| 5738 | (goto-char 56) | ||
| 5739 | (widen) | ||
| 5740 | (narrow-to-region 2 46) | ||
| 5741 | (goto-char 43) | ||
| 5742 | (insert "...........") | ||
| 5743 | (goto-char 20) | ||
| 5744 | (delete-char 4) | ||
| 5745 | (goto-char 38) | ||
| 5746 | (delete-char 7) | ||
| 5747 | (goto-char 25) | ||
| 5748 | (delete-char 21) | ||
| 5749 | (goto-char 12) | ||
| 5750 | (insert ".........") | ||
| 5751 | (goto-char 19) | ||
| 5752 | (widen) | ||
| 5753 | (narrow-to-region 72 61) | ||
| 5754 | (goto-char 63) | ||
| 5755 | (insert "") | ||
| 5756 | (goto-char 65) | ||
| 5757 | (delete-char 4) | ||
| 5758 | (goto-char 61) | ||
| 5759 | (delete-char 5) | ||
| 5760 | (goto-char 63) | ||
| 5761 | (delete-char 0) | ||
| 5762 | (goto-char 63) | ||
| 5763 | (delete-char 0) | ||
| 5764 | (goto-char 62) | ||
| 5765 | (delete-char 0) | ||
| 5766 | (goto-char 61) | ||
| 5767 | (insert "............") | ||
| 5768 | (goto-char 72) | ||
| 5769 | (insert "..............") | ||
| 5770 | (goto-char 62) | ||
| 5771 | (delete-char 7) | ||
| 5772 | (goto-char 71) | ||
| 5773 | (delete-char 5) | ||
| 5774 | (goto-char 75) | ||
| 5775 | (widen) | ||
| 5776 | (narrow-to-region 29 8) | ||
| 5777 | (goto-char 17) | ||
| 5778 | (delete-char 2) | ||
| 5779 | (goto-char 27) | ||
| 5780 | (insert "........") | ||
| 5781 | (should | ||
| 5782 | (equal | ||
| 5783 | (test-overlay-regions) | ||
| 5784 | '((1 . 36) | ||
| 5785 | (1 . 41) | ||
| 5786 | (1 . 47) | ||
| 5787 | (2 . 40) | ||
| 5788 | (4 . 40) | ||
| 5789 | (5 . 40) | ||
| 5790 | (5 . 40) | ||
| 5791 | (7 . 21) | ||
| 5792 | (9 . 40) | ||
| 5793 | (10 . 37) | ||
| 5794 | (20 . 40) | ||
| 5795 | (22 . 27) | ||
| 5796 | (22 . 42)))))) | ||
| 5797 | |||
| 5798 | (ert-deftest overlay-autogenerated-test-46 nil | ||
| 5799 | (with-temp-buffer | ||
| 5800 | (insert "................................................................") | ||
| 5801 | (make-overlay 2 43 nil nil t) | ||
| 5802 | (make-overlay 44 40 nil nil t) | ||
| 5803 | (make-overlay 49 14 nil nil t) | ||
| 5804 | (make-overlay 6 55 nil nil nil) | ||
| 5805 | (make-overlay 13 52 nil t t) | ||
| 5806 | (make-overlay 40 54 nil t nil) | ||
| 5807 | (make-overlay 51 41 nil nil t) | ||
| 5808 | (make-overlay 7 28 nil nil t) | ||
| 5809 | (make-overlay 10 47 nil nil t) | ||
| 5810 | (make-overlay 63 21 nil t nil) | ||
| 5811 | (make-overlay 4 55 nil nil nil) | ||
| 5812 | (make-overlay 52 58 nil t nil) | ||
| 5813 | (make-overlay 62 11 nil t t) | ||
| 5814 | (make-overlay 22 49 nil t nil) | ||
| 5815 | (make-overlay 23 65 nil nil nil) | ||
| 5816 | (make-overlay 50 33 nil nil t) | ||
| 5817 | (goto-char 22) | ||
| 5818 | (insert "..............") | ||
| 5819 | (goto-char 12) | ||
| 5820 | (insert "....") | ||
| 5821 | (goto-char 25) | ||
| 5822 | (delete-char 16) | ||
| 5823 | (goto-char 14) | ||
| 5824 | (delete-char 53) | ||
| 5825 | (goto-char 2) | ||
| 5826 | (insert "............") | ||
| 5827 | (goto-char 20) | ||
| 5828 | (delete-char 5) | ||
| 5829 | (goto-char 11) | ||
| 5830 | (delete-char 7) | ||
| 5831 | (goto-char 9) | ||
| 5832 | (widen) | ||
| 5833 | (narrow-to-region 11 7) | ||
| 5834 | (goto-char 8) | ||
| 5835 | (insert "...............") | ||
| 5836 | (goto-char 12) | ||
| 5837 | (delete-char 4) | ||
| 5838 | (goto-char 21) | ||
| 5839 | (insert "...") | ||
| 5840 | (goto-char 20) | ||
| 5841 | (delete-char 5) | ||
| 5842 | (goto-char 7) | ||
| 5843 | (delete-char 3) | ||
| 5844 | (goto-char 16) | ||
| 5845 | (delete-char 0) | ||
| 5846 | (goto-char 12) | ||
| 5847 | (delete-char 1) | ||
| 5848 | (goto-char 15) | ||
| 5849 | (delete-char 0) | ||
| 5850 | (goto-char 7) | ||
| 5851 | (insert "..............") | ||
| 5852 | (goto-char 17) | ||
| 5853 | (insert "...........") | ||
| 5854 | (goto-char 15) | ||
| 5855 | (insert "............") | ||
| 5856 | (goto-char 20) | ||
| 5857 | (delete-char 5) | ||
| 5858 | (goto-char 7) | ||
| 5859 | (insert "....") | ||
| 5860 | (goto-char 37) | ||
| 5861 | (delete-char 7) | ||
| 5862 | (goto-char 8) | ||
| 5863 | (insert "..........") | ||
| 5864 | (goto-char 47) | ||
| 5865 | (insert ".............") | ||
| 5866 | (goto-char 65) | ||
| 5867 | (insert ".......") | ||
| 5868 | (goto-char 39) | ||
| 5869 | (delete-char 26) | ||
| 5870 | (goto-char 14) | ||
| 5871 | (delete-char 2) | ||
| 5872 | (goto-char 27) | ||
| 5873 | (insert ".............") | ||
| 5874 | (goto-char 17) | ||
| 5875 | (widen) | ||
| 5876 | (narrow-to-region 54 32) | ||
| 5877 | (goto-char 40) | ||
| 5878 | (widen) | ||
| 5879 | (narrow-to-region 10 3) | ||
| 5880 | (goto-char 7) | ||
| 5881 | (insert "........") | ||
| 5882 | (goto-char 13) | ||
| 5883 | (insert "..............") | ||
| 5884 | (should | ||
| 5885 | (equal | ||
| 5886 | (test-overlay-regions) | ||
| 5887 | '((2 . 85)))))) | ||
| 5888 | |||
| 5889 | (ert-deftest overlay-autogenerated-test-47 nil | ||
| 5890 | (with-temp-buffer | ||
| 5891 | (insert "................................................................") | ||
| 5892 | (make-overlay 58 62 nil t nil) | ||
| 5893 | (make-overlay 14 38 nil nil nil) | ||
| 5894 | (make-overlay 63 44 nil t t) | ||
| 5895 | (make-overlay 41 41 nil nil t) | ||
| 5896 | (make-overlay 19 39 nil nil nil) | ||
| 5897 | (make-overlay 10 49 nil t t) | ||
| 5898 | (make-overlay 56 38 nil t t) | ||
| 5899 | (make-overlay 23 38 nil nil t) | ||
| 5900 | (make-overlay 1 64 nil nil t) | ||
| 5901 | (make-overlay 21 3 nil t nil) | ||
| 5902 | (make-overlay 1 1 nil nil t) | ||
| 5903 | (make-overlay 27 61 nil nil nil) | ||
| 5904 | (make-overlay 29 59 nil nil nil) | ||
| 5905 | (make-overlay 37 30 nil t nil) | ||
| 5906 | (make-overlay 47 21 nil nil t) | ||
| 5907 | (make-overlay 34 26 nil t nil) | ||
| 5908 | (goto-char 6) | ||
| 5909 | (delete-char 44) | ||
| 5910 | (goto-char 8) | ||
| 5911 | (delete-char 0) | ||
| 5912 | (goto-char 8) | ||
| 5913 | (insert "....") | ||
| 5914 | (goto-char 17) | ||
| 5915 | (delete-char 2) | ||
| 5916 | (goto-char 12) | ||
| 5917 | (insert "...") | ||
| 5918 | (goto-char 20) | ||
| 5919 | (insert "") | ||
| 5920 | (goto-char 2) | ||
| 5921 | (delete-char 20) | ||
| 5922 | (goto-char 1) | ||
| 5923 | (insert ".........") | ||
| 5924 | (goto-char 7) | ||
| 5925 | (insert ".............") | ||
| 5926 | (goto-char 27) | ||
| 5927 | (delete-char 0) | ||
| 5928 | (goto-char 15) | ||
| 5929 | (insert "..........") | ||
| 5930 | (goto-char 36) | ||
| 5931 | (insert "..............") | ||
| 5932 | (goto-char 26) | ||
| 5933 | (insert "..............") | ||
| 5934 | (goto-char 63) | ||
| 5935 | (insert "...........") | ||
| 5936 | (goto-char 9) | ||
| 5937 | (insert "............") | ||
| 5938 | (goto-char 71) | ||
| 5939 | (delete-char 17) | ||
| 5940 | (goto-char 36) | ||
| 5941 | (insert "....") | ||
| 5942 | (goto-char 45) | ||
| 5943 | (delete-char 31) | ||
| 5944 | (goto-char 28) | ||
| 5945 | (delete-char 8) | ||
| 5946 | (goto-char 10) | ||
| 5947 | (delete-char 16) | ||
| 5948 | (goto-char 14) | ||
| 5949 | (delete-char 4) | ||
| 5950 | (goto-char 16) | ||
| 5951 | (delete-char 0) | ||
| 5952 | (goto-char 15) | ||
| 5953 | (insert "") | ||
| 5954 | (goto-char 14) | ||
| 5955 | (delete-char 1) | ||
| 5956 | (goto-char 10) | ||
| 5957 | (delete-char 2) | ||
| 5958 | (goto-char 6) | ||
| 5959 | (delete-char 0) | ||
| 5960 | (goto-char 1) | ||
| 5961 | (insert ".........") | ||
| 5962 | (goto-char 23) | ||
| 5963 | (insert "......") | ||
| 5964 | (goto-char 25) | ||
| 5965 | (insert "..........") | ||
| 5966 | (goto-char 25) | ||
| 5967 | (widen) | ||
| 5968 | (narrow-to-region 10 30) | ||
| 5969 | (goto-char 21) | ||
| 5970 | (delete-char 1) | ||
| 5971 | (goto-char 17) | ||
| 5972 | (insert "..........") | ||
| 5973 | (should | ||
| 5974 | (equal | ||
| 5975 | (test-overlay-regions) | ||
| 5976 | '((1 . 48) | ||
| 5977 | (1 . 48) | ||
| 5978 | (32 . 32) | ||
| 5979 | (32 . 32) | ||
| 5980 | (32 . 32) | ||
| 5981 | (32 . 32) | ||
| 5982 | (32 . 32) | ||
| 5983 | (32 . 32) | ||
| 5984 | (32 . 32) | ||
| 5985 | (32 . 32) | ||
| 5986 | (32 . 48) | ||
| 5987 | (32 . 48) | ||
| 5988 | (32 . 48)))))) | ||
| 5989 | |||
| 5990 | (ert-deftest overlay-autogenerated-test-48 nil | ||
| 5991 | (with-temp-buffer | ||
| 5992 | (insert "................................................................") | ||
| 5993 | (make-overlay 1 11 nil nil nil) | ||
| 5994 | (make-overlay 35 29 nil t t) | ||
| 5995 | (make-overlay 24 46 nil nil t) | ||
| 5996 | (make-overlay 15 43 nil nil t) | ||
| 5997 | (make-overlay 51 49 nil t t) | ||
| 5998 | (make-overlay 25 43 nil t nil) | ||
| 5999 | (make-overlay 23 59 nil nil nil) | ||
| 6000 | (make-overlay 10 4 nil t nil) | ||
| 6001 | (make-overlay 40 45 nil nil nil) | ||
| 6002 | (make-overlay 42 43 nil nil t) | ||
| 6003 | (make-overlay 20 38 nil t nil) | ||
| 6004 | (make-overlay 17 49 nil nil nil) | ||
| 6005 | (make-overlay 9 25 nil nil t) | ||
| 6006 | (make-overlay 13 19 nil nil nil) | ||
| 6007 | (make-overlay 44 31 nil t nil) | ||
| 6008 | (make-overlay 12 65 nil nil t) | ||
| 6009 | (goto-char 59) | ||
| 6010 | (widen) | ||
| 6011 | (narrow-to-region 28 14) | ||
| 6012 | (goto-char 26) | ||
| 6013 | (insert "...") | ||
| 6014 | (goto-char 30) | ||
| 6015 | (delete-char 1) | ||
| 6016 | (goto-char 23) | ||
| 6017 | (insert "...") | ||
| 6018 | (goto-char 27) | ||
| 6019 | (widen) | ||
| 6020 | (narrow-to-region 45 67) | ||
| 6021 | (goto-char 50) | ||
| 6022 | (insert "...............") | ||
| 6023 | (goto-char 59) | ||
| 6024 | (insert "..............") | ||
| 6025 | (goto-char 55) | ||
| 6026 | (insert ".............") | ||
| 6027 | (goto-char 106) | ||
| 6028 | (delete-char 0) | ||
| 6029 | (goto-char 97) | ||
| 6030 | (delete-char 10) | ||
| 6031 | (goto-char 67) | ||
| 6032 | (delete-char 16) | ||
| 6033 | (goto-char 76) | ||
| 6034 | (insert "..............") | ||
| 6035 | (goto-char 71) | ||
| 6036 | (insert ".............") | ||
| 6037 | (goto-char 110) | ||
| 6038 | (delete-char 0) | ||
| 6039 | (goto-char 56) | ||
| 6040 | (delete-char 38) | ||
| 6041 | (goto-char 61) | ||
| 6042 | (delete-char 10) | ||
| 6043 | (goto-char 56) | ||
| 6044 | (delete-char 5) | ||
| 6045 | (goto-char 49) | ||
| 6046 | (insert ".......") | ||
| 6047 | (goto-char 62) | ||
| 6048 | (insert "...") | ||
| 6049 | (goto-char 54) | ||
| 6050 | (insert "..........") | ||
| 6051 | (goto-char 47) | ||
| 6052 | (delete-char 10) | ||
| 6053 | (goto-char 47) | ||
| 6054 | (delete-char 20) | ||
| 6055 | (goto-char 46) | ||
| 6056 | (insert ".............") | ||
| 6057 | (goto-char 56) | ||
| 6058 | (insert "...........") | ||
| 6059 | (goto-char 70) | ||
| 6060 | (delete-char 1) | ||
| 6061 | (goto-char 62) | ||
| 6062 | (widen) | ||
| 6063 | (narrow-to-region 50 64) | ||
| 6064 | (goto-char 60) | ||
| 6065 | (insert "..") | ||
| 6066 | (goto-char 55) | ||
| 6067 | (delete-char 6) | ||
| 6068 | (goto-char 60) | ||
| 6069 | (insert ".............") | ||
| 6070 | (goto-char 61) | ||
| 6071 | (delete-char 9) | ||
| 6072 | (goto-char 64) | ||
| 6073 | (delete-char 0) | ||
| 6074 | (goto-char 53) | ||
| 6075 | (widen) | ||
| 6076 | (narrow-to-region 15 62) | ||
| 6077 | (should | ||
| 6078 | (equal | ||
| 6079 | (test-overlay-regions) | ||
| 6080 | '((9 . 28) | ||
| 6081 | (12 . 73) | ||
| 6082 | (13 . 19) | ||
| 6083 | (15 . 70) | ||
| 6084 | (17 . 70) | ||
| 6085 | (20 . 43) | ||
| 6086 | (23 . 70) | ||
| 6087 | (27 . 70) | ||
| 6088 | (28 . 70) | ||
| 6089 | (34 . 40) | ||
| 6090 | (36 . 70) | ||
| 6091 | (45 . 70)))))) | ||
| 6092 | |||
| 6093 | (ert-deftest overlay-autogenerated-test-49 nil | ||
| 6094 | (with-temp-buffer | ||
| 6095 | (insert "................................................................") | ||
| 6096 | (make-overlay 24 10 nil nil t) | ||
| 6097 | (make-overlay 53 23 nil t nil) | ||
| 6098 | (make-overlay 53 9 nil nil t) | ||
| 6099 | (make-overlay 65 64 nil t t) | ||
| 6100 | (make-overlay 48 2 nil nil t) | ||
| 6101 | (make-overlay 12 58 nil nil t) | ||
| 6102 | (make-overlay 64 64 nil nil nil) | ||
| 6103 | (make-overlay 26 13 nil t t) | ||
| 6104 | (make-overlay 46 26 nil nil t) | ||
| 6105 | (make-overlay 28 59 nil t t) | ||
| 6106 | (make-overlay 33 52 nil nil nil) | ||
| 6107 | (make-overlay 39 8 nil t t) | ||
| 6108 | (make-overlay 9 59 nil t t) | ||
| 6109 | (make-overlay 50 45 nil nil t) | ||
| 6110 | (make-overlay 41 53 nil nil t) | ||
| 6111 | (make-overlay 51 51 nil t nil) | ||
| 6112 | (goto-char 61) | ||
| 6113 | (insert "..............") | ||
| 6114 | (goto-char 19) | ||
| 6115 | (widen) | ||
| 6116 | (narrow-to-region 10 65) | ||
| 6117 | (goto-char 65) | ||
| 6118 | (delete-char 0) | ||
| 6119 | (goto-char 11) | ||
| 6120 | (insert "...............") | ||
| 6121 | (goto-char 77) | ||
| 6122 | (delete-char 0) | ||
| 6123 | (goto-char 51) | ||
| 6124 | (insert "...") | ||
| 6125 | (goto-char 75) | ||
| 6126 | (insert ".....") | ||
| 6127 | (goto-char 77) | ||
| 6128 | (delete-char 11) | ||
| 6129 | (goto-char 45) | ||
| 6130 | (delete-char 0) | ||
| 6131 | (goto-char 24) | ||
| 6132 | (widen) | ||
| 6133 | (narrow-to-region 33 52) | ||
| 6134 | (goto-char 46) | ||
| 6135 | (insert "..............") | ||
| 6136 | (goto-char 46) | ||
| 6137 | (insert "..........") | ||
| 6138 | (goto-char 39) | ||
| 6139 | (widen) | ||
| 6140 | (narrow-to-region 46 77) | ||
| 6141 | (goto-char 77) | ||
| 6142 | (insert "..............") | ||
| 6143 | (goto-char 54) | ||
| 6144 | (insert ".......") | ||
| 6145 | (goto-char 87) | ||
| 6146 | (insert ".") | ||
| 6147 | (goto-char 70) | ||
| 6148 | (delete-char 16) | ||
| 6149 | (goto-char 79) | ||
| 6150 | (delete-char 0) | ||
| 6151 | (goto-char 73) | ||
| 6152 | (widen) | ||
| 6153 | (narrow-to-region 74 100) | ||
| 6154 | (goto-char 91) | ||
| 6155 | (insert ".............") | ||
| 6156 | (goto-char 80) | ||
| 6157 | (delete-char 11) | ||
| 6158 | (goto-char 82) | ||
| 6159 | (insert "......") | ||
| 6160 | (goto-char 108) | ||
| 6161 | (delete-char 0) | ||
| 6162 | (goto-char 104) | ||
| 6163 | (insert ".....") | ||
| 6164 | (goto-char 100) | ||
| 6165 | (delete-char 1) | ||
| 6166 | (goto-char 90) | ||
| 6167 | (insert ".............") | ||
| 6168 | (goto-char 99) | ||
| 6169 | (insert ".............") | ||
| 6170 | (goto-char 124) | ||
| 6171 | (insert "..............") | ||
| 6172 | (goto-char 114) | ||
| 6173 | (insert "....") | ||
| 6174 | (goto-char 134) | ||
| 6175 | (delete-char 0) | ||
| 6176 | (goto-char 89) | ||
| 6177 | (delete-char 65) | ||
| 6178 | (goto-char 75) | ||
| 6179 | (delete-char 16) | ||
| 6180 | (should | ||
| 6181 | (equal | ||
| 6182 | (test-overlay-regions) | ||
| 6183 | '((2 . 75) | ||
| 6184 | (8 . 75) | ||
| 6185 | (9 . 76) | ||
| 6186 | (9 . 82) | ||
| 6187 | (27 . 82) | ||
| 6188 | (38 . 76) | ||
| 6189 | (41 . 75) | ||
| 6190 | (43 . 82) | ||
| 6191 | (70 . 75)))))) | ||
| 6192 | |||
| 6193 | (ert-deftest overlay-autogenerated-test-50 nil | ||
| 6194 | (with-temp-buffer | ||
| 6195 | (insert "................................................................") | ||
| 6196 | (make-overlay 29 53 nil t t) | ||
| 6197 | (make-overlay 65 64 nil nil nil) | ||
| 6198 | (make-overlay 3 31 nil nil t) | ||
| 6199 | (make-overlay 45 59 nil t nil) | ||
| 6200 | (make-overlay 60 37 nil t t) | ||
| 6201 | (make-overlay 7 5 nil t t) | ||
| 6202 | (make-overlay 37 24 nil nil nil) | ||
| 6203 | (make-overlay 45 20 nil nil nil) | ||
| 6204 | (make-overlay 33 42 nil nil t) | ||
| 6205 | (make-overlay 47 57 nil t nil) | ||
| 6206 | (make-overlay 14 49 nil t t) | ||
| 6207 | (make-overlay 14 30 nil t nil) | ||
| 6208 | (make-overlay 21 40 nil t t) | ||
| 6209 | (make-overlay 5 45 nil t t) | ||
| 6210 | (make-overlay 59 40 nil t t) | ||
| 6211 | (make-overlay 37 52 nil nil nil) | ||
| 6212 | (goto-char 48) | ||
| 6213 | (insert "") | ||
| 6214 | (goto-char 7) | ||
| 6215 | (insert ".........") | ||
| 6216 | (goto-char 31) | ||
| 6217 | (insert "...........") | ||
| 6218 | (goto-char 41) | ||
| 6219 | (delete-char 7) | ||
| 6220 | (goto-char 21) | ||
| 6221 | (delete-char 11) | ||
| 6222 | (goto-char 41) | ||
| 6223 | (widen) | ||
| 6224 | (narrow-to-region 51 53) | ||
| 6225 | (goto-char 52) | ||
| 6226 | (insert ".....") | ||
| 6227 | (goto-char 55) | ||
| 6228 | (widen) | ||
| 6229 | (narrow-to-region 18 24) | ||
| 6230 | (goto-char 23) | ||
| 6231 | (widen) | ||
| 6232 | (narrow-to-region 39 38) | ||
| 6233 | (goto-char 38) | ||
| 6234 | (insert ".............") | ||
| 6235 | (goto-char 41) | ||
| 6236 | (insert "......") | ||
| 6237 | (goto-char 38) | ||
| 6238 | (insert "..............") | ||
| 6239 | (goto-char 52) | ||
| 6240 | (insert "...............") | ||
| 6241 | (goto-char 78) | ||
| 6242 | (delete-char 5) | ||
| 6243 | (goto-char 50) | ||
| 6244 | (insert "..........") | ||
| 6245 | (goto-char 50) | ||
| 6246 | (delete-char 3) | ||
| 6247 | (goto-char 85) | ||
| 6248 | (widen) | ||
| 6249 | (narrow-to-region 86 1) | ||
| 6250 | (goto-char 5) | ||
| 6251 | (insert "....") | ||
| 6252 | (goto-char 69) | ||
| 6253 | (insert "...........") | ||
| 6254 | (goto-char 94) | ||
| 6255 | (insert "......") | ||
| 6256 | (goto-char 98) | ||
| 6257 | (delete-char 7) | ||
| 6258 | (goto-char 46) | ||
| 6259 | (insert "...............") | ||
| 6260 | (goto-char 79) | ||
| 6261 | (insert "............") | ||
| 6262 | (goto-char 89) | ||
| 6263 | (insert "") | ||
| 6264 | (goto-char 14) | ||
| 6265 | (delete-char 63) | ||
| 6266 | (goto-char 20) | ||
| 6267 | (insert ".........") | ||
| 6268 | (goto-char 34) | ||
| 6269 | (insert "...") | ||
| 6270 | (goto-char 53) | ||
| 6271 | (delete-char 14) | ||
| 6272 | (goto-char 6) | ||
| 6273 | (widen) | ||
| 6274 | (narrow-to-region 6 52) | ||
| 6275 | (goto-char 42) | ||
| 6276 | (insert "...........") | ||
| 6277 | (goto-char 40) | ||
| 6278 | (insert ".......") | ||
| 6279 | (goto-char 46) | ||
| 6280 | (widen) | ||
| 6281 | (narrow-to-region 1 68) | ||
| 6282 | (should | ||
| 6283 | (equal | ||
| 6284 | (test-overlay-regions) | ||
| 6285 | '((3 . 14) | ||
| 6286 | (9 . 14) | ||
| 6287 | (9 . 91) | ||
| 6288 | (14 . 14) | ||
| 6289 | (14 . 83) | ||
| 6290 | (14 . 86) | ||
| 6291 | (14 . 88) | ||
| 6292 | (14 . 91) | ||
| 6293 | (14 . 95) | ||
| 6294 | (14 . 104)))))) | ||
| 6295 | |||
| 6296 | (ert-deftest overlay-autogenerated-test-51 nil | ||
| 6297 | (with-temp-buffer | ||
| 6298 | (insert "................................................................") | ||
| 6299 | (make-overlay 14 5 nil t nil) | ||
| 6300 | (make-overlay 62 34 nil nil t) | ||
| 6301 | (make-overlay 7 62 nil nil t) | ||
| 6302 | (make-overlay 23 12 nil t t) | ||
| 6303 | (make-overlay 16 4 nil nil nil) | ||
| 6304 | (make-overlay 24 15 nil nil nil) | ||
| 6305 | (make-overlay 6 6 nil t t) | ||
| 6306 | (make-overlay 25 64 nil t t) | ||
| 6307 | (make-overlay 23 6 nil t t) | ||
| 6308 | (make-overlay 55 64 nil nil nil) | ||
| 6309 | (make-overlay 8 62 nil nil t) | ||
| 6310 | (make-overlay 65 65 nil nil nil) | ||
| 6311 | (make-overlay 57 51 nil t t) | ||
| 6312 | (make-overlay 35 8 nil t nil) | ||
| 6313 | (make-overlay 55 13 nil nil t) | ||
| 6314 | (make-overlay 60 62 nil nil t) | ||
| 6315 | (goto-char 12) | ||
| 6316 | (insert "..") | ||
| 6317 | (goto-char 66) | ||
| 6318 | (insert "............") | ||
| 6319 | (goto-char 32) | ||
| 6320 | (insert "..") | ||
| 6321 | (goto-char 27) | ||
| 6322 | (insert ".........") | ||
| 6323 | (goto-char 8) | ||
| 6324 | (insert ".............") | ||
| 6325 | (goto-char 79) | ||
| 6326 | (insert ".") | ||
| 6327 | (goto-char 47) | ||
| 6328 | (insert "....") | ||
| 6329 | (goto-char 49) | ||
| 6330 | (insert "...") | ||
| 6331 | (goto-char 81) | ||
| 6332 | (insert "....") | ||
| 6333 | (goto-char 112) | ||
| 6334 | (delete-char 0) | ||
| 6335 | (goto-char 97) | ||
| 6336 | (insert ".....") | ||
| 6337 | (goto-char 109) | ||
| 6338 | (delete-char 5) | ||
| 6339 | (goto-char 20) | ||
| 6340 | (insert ".....") | ||
| 6341 | (goto-char 59) | ||
| 6342 | (delete-char 33) | ||
| 6343 | (goto-char 87) | ||
| 6344 | (insert ".............") | ||
| 6345 | (goto-char 98) | ||
| 6346 | (insert "....") | ||
| 6347 | (goto-char 22) | ||
| 6348 | (delete-char 36) | ||
| 6349 | (goto-char 45) | ||
| 6350 | (insert "..............") | ||
| 6351 | (goto-char 42) | ||
| 6352 | (delete-char 29) | ||
| 6353 | (goto-char 51) | ||
| 6354 | (widen) | ||
| 6355 | (narrow-to-region 39 41) | ||
| 6356 | (goto-char 39) | ||
| 6357 | (delete-char 2) | ||
| 6358 | (goto-char 39) | ||
| 6359 | (insert ".............") | ||
| 6360 | (goto-char 51) | ||
| 6361 | (insert "......") | ||
| 6362 | (goto-char 52) | ||
| 6363 | (insert "...............") | ||
| 6364 | (goto-char 56) | ||
| 6365 | (widen) | ||
| 6366 | (narrow-to-region 59 20) | ||
| 6367 | (goto-char 56) | ||
| 6368 | (insert "............") | ||
| 6369 | (goto-char 57) | ||
| 6370 | (insert ".") | ||
| 6371 | (goto-char 37) | ||
| 6372 | (delete-char 12) | ||
| 6373 | (goto-char 39) | ||
| 6374 | (delete-char 11) | ||
| 6375 | (goto-char 38) | ||
| 6376 | (delete-char 8) | ||
| 6377 | (goto-char 36) | ||
| 6378 | (widen) | ||
| 6379 | (narrow-to-region 65 26) | ||
| 6380 | (goto-char 40) | ||
| 6381 | (widen) | ||
| 6382 | (narrow-to-region 27 55) | ||
| 6383 | (should | ||
| 6384 | (equal | ||
| 6385 | (test-overlay-regions) | ||
| 6386 | '((7 . 55) | ||
| 6387 | (8 . 55) | ||
| 6388 | (22 . 29) | ||
| 6389 | (23 . 55) | ||
| 6390 | (23 . 56) | ||
| 6391 | (24 . 31) | ||
| 6392 | (29 . 56) | ||
| 6393 | (37 . 55)))))) | ||
| 6394 | |||
| 6395 | (ert-deftest overlay-autogenerated-test-52 nil | ||
| 6396 | (with-temp-buffer | ||
| 6397 | (insert "................................................................") | ||
| 6398 | (make-overlay 58 32 nil nil nil) | ||
| 6399 | (make-overlay 44 54 nil nil t) | ||
| 6400 | (make-overlay 27 50 nil nil nil) | ||
| 6401 | (make-overlay 55 35 nil nil t) | ||
| 6402 | (make-overlay 40 46 nil nil t) | ||
| 6403 | (make-overlay 56 63 nil t nil) | ||
| 6404 | (make-overlay 29 48 nil nil nil) | ||
| 6405 | (make-overlay 45 24 nil t nil) | ||
| 6406 | (make-overlay 60 25 nil t nil) | ||
| 6407 | (make-overlay 55 41 nil t nil) | ||
| 6408 | (make-overlay 55 1 nil nil t) | ||
| 6409 | (make-overlay 30 45 nil t t) | ||
| 6410 | (make-overlay 26 19 nil nil t) | ||
| 6411 | (make-overlay 61 5 nil nil nil) | ||
| 6412 | (make-overlay 33 5 nil nil nil) | ||
| 6413 | (make-overlay 42 18 nil t nil) | ||
| 6414 | (goto-char 55) | ||
| 6415 | (insert ".") | ||
| 6416 | (goto-char 49) | ||
| 6417 | (delete-char 12) | ||
| 6418 | (goto-char 41) | ||
| 6419 | (insert "..........") | ||
| 6420 | (goto-char 27) | ||
| 6421 | (insert ".....") | ||
| 6422 | (goto-char 58) | ||
| 6423 | (insert "...........") | ||
| 6424 | (goto-char 24) | ||
| 6425 | (delete-char 23) | ||
| 6426 | (goto-char 47) | ||
| 6427 | (delete-char 9) | ||
| 6428 | (goto-char 4) | ||
| 6429 | (insert "...") | ||
| 6430 | (goto-char 10) | ||
| 6431 | (delete-char 32) | ||
| 6432 | (goto-char 4) | ||
| 6433 | (insert "..............") | ||
| 6434 | (goto-char 29) | ||
| 6435 | (insert "....") | ||
| 6436 | (goto-char 28) | ||
| 6437 | (delete-char 2) | ||
| 6438 | (goto-char 34) | ||
| 6439 | (insert "...........") | ||
| 6440 | (goto-char 9) | ||
| 6441 | (insert "......") | ||
| 6442 | (goto-char 5) | ||
| 6443 | (insert "") | ||
| 6444 | (goto-char 45) | ||
| 6445 | (delete-char 1) | ||
| 6446 | (goto-char 18) | ||
| 6447 | (insert ".........") | ||
| 6448 | (goto-char 36) | ||
| 6449 | (delete-char 5) | ||
| 6450 | (goto-char 15) | ||
| 6451 | (delete-char 27) | ||
| 6452 | (goto-char 15) | ||
| 6453 | (delete-char 10) | ||
| 6454 | (goto-char 16) | ||
| 6455 | (delete-char 2) | ||
| 6456 | (goto-char 16) | ||
| 6457 | (widen) | ||
| 6458 | (narrow-to-region 10 2) | ||
| 6459 | (goto-char 9) | ||
| 6460 | (delete-char 1) | ||
| 6461 | (goto-char 3) | ||
| 6462 | (delete-char 2) | ||
| 6463 | (goto-char 2) | ||
| 6464 | (widen) | ||
| 6465 | (narrow-to-region 9 10) | ||
| 6466 | (goto-char 9) | ||
| 6467 | (insert "...........") | ||
| 6468 | (goto-char 19) | ||
| 6469 | (delete-char 0) | ||
| 6470 | (goto-char 14) | ||
| 6471 | (delete-char 3) | ||
| 6472 | (goto-char 11) | ||
| 6473 | (delete-char 2) | ||
| 6474 | (goto-char 9) | ||
| 6475 | (delete-char 6) | ||
| 6476 | (goto-char 9) | ||
| 6477 | (delete-char 0) | ||
| 6478 | (goto-char 10) | ||
| 6479 | (insert "....") | ||
| 6480 | (should | ||
| 6481 | (equal | ||
| 6482 | (test-overlay-regions) | ||
| 6483 | '((1 . 17)))))) | ||
| 6484 | |||
| 6485 | (ert-deftest overlay-autogenerated-test-53 nil | ||
| 6486 | (with-temp-buffer | ||
| 6487 | (insert "................................................................") | ||
| 6488 | (make-overlay 10 30 nil nil nil) | ||
| 6489 | (make-overlay 11 57 nil t nil) | ||
| 6490 | (make-overlay 59 56 nil nil t) | ||
| 6491 | (make-overlay 20 37 nil nil t) | ||
| 6492 | (make-overlay 41 29 nil nil nil) | ||
| 6493 | (make-overlay 31 10 nil nil t) | ||
| 6494 | (make-overlay 6 36 nil nil nil) | ||
| 6495 | (make-overlay 12 54 nil nil nil) | ||
| 6496 | (make-overlay 25 26 nil t t) | ||
| 6497 | (make-overlay 21 19 nil nil t) | ||
| 6498 | (make-overlay 1 21 nil nil t) | ||
| 6499 | (make-overlay 48 51 nil nil nil) | ||
| 6500 | (make-overlay 54 55 nil t nil) | ||
| 6501 | (make-overlay 64 48 nil t t) | ||
| 6502 | (make-overlay 56 25 nil nil t) | ||
| 6503 | (make-overlay 12 60 nil t nil) | ||
| 6504 | (goto-char 41) | ||
| 6505 | (delete-char 1) | ||
| 6506 | (goto-char 63) | ||
| 6507 | (insert "") | ||
| 6508 | (goto-char 14) | ||
| 6509 | (delete-char 5) | ||
| 6510 | (goto-char 11) | ||
| 6511 | (insert "..............") | ||
| 6512 | (goto-char 41) | ||
| 6513 | (widen) | ||
| 6514 | (narrow-to-region 12 1) | ||
| 6515 | (goto-char 1) | ||
| 6516 | (delete-char 3) | ||
| 6517 | (goto-char 9) | ||
| 6518 | (delete-char 0) | ||
| 6519 | (goto-char 5) | ||
| 6520 | (insert "..............") | ||
| 6521 | (goto-char 1) | ||
| 6522 | (insert "..........") | ||
| 6523 | (goto-char 29) | ||
| 6524 | (insert "...............") | ||
| 6525 | (goto-char 4) | ||
| 6526 | (insert "..") | ||
| 6527 | (goto-char 31) | ||
| 6528 | (delete-char 15) | ||
| 6529 | (goto-char 31) | ||
| 6530 | (insert "") | ||
| 6531 | (goto-char 27) | ||
| 6532 | (insert "......") | ||
| 6533 | (goto-char 6) | ||
| 6534 | (insert "...") | ||
| 6535 | (goto-char 23) | ||
| 6536 | (widen) | ||
| 6537 | (narrow-to-region 23 47) | ||
| 6538 | (goto-char 37) | ||
| 6539 | (delete-char 2) | ||
| 6540 | (goto-char 35) | ||
| 6541 | (delete-char 5) | ||
| 6542 | (goto-char 38) | ||
| 6543 | (delete-char 2) | ||
| 6544 | (goto-char 30) | ||
| 6545 | (insert ".......") | ||
| 6546 | (goto-char 45) | ||
| 6547 | (widen) | ||
| 6548 | (narrow-to-region 13 2) | ||
| 6549 | (goto-char 9) | ||
| 6550 | (delete-char 1) | ||
| 6551 | (goto-char 3) | ||
| 6552 | (insert ".....") | ||
| 6553 | (goto-char 2) | ||
| 6554 | (insert "...............") | ||
| 6555 | (goto-char 16) | ||
| 6556 | (delete-char 5) | ||
| 6557 | (goto-char 20) | ||
| 6558 | (insert ".....") | ||
| 6559 | (goto-char 26) | ||
| 6560 | (delete-char 0) | ||
| 6561 | (goto-char 26) | ||
| 6562 | (widen) | ||
| 6563 | (narrow-to-region 76 98) | ||
| 6564 | (goto-char 88) | ||
| 6565 | (insert ".........") | ||
| 6566 | (goto-char 92) | ||
| 6567 | (insert ".") | ||
| 6568 | (goto-char 108) | ||
| 6569 | (delete-char 0) | ||
| 6570 | (goto-char 103) | ||
| 6571 | (delete-char 3) | ||
| 6572 | (should | ||
| 6573 | (equal | ||
| 6574 | (test-overlay-regions) | ||
| 6575 | '((1 . 79) | ||
| 6576 | (37 . 103) | ||
| 6577 | (61 . 88) | ||
| 6578 | (61 . 99) | ||
| 6579 | (74 . 121) | ||
| 6580 | (75 . 118) | ||
| 6581 | (75 . 124) | ||
| 6582 | (77 . 79) | ||
| 6583 | (78 . 103) | ||
| 6584 | (83 . 84) | ||
| 6585 | (83 . 120) | ||
| 6586 | (87 . 106)))))) | ||
| 6587 | |||
| 6588 | (ert-deftest overlay-autogenerated-test-54 nil | ||
| 6589 | (with-temp-buffer | ||
| 6590 | (insert "................................................................") | ||
| 6591 | (make-overlay 58 36 nil t t) | ||
| 6592 | (make-overlay 55 49 nil nil t) | ||
| 6593 | (make-overlay 12 25 nil nil t) | ||
| 6594 | (make-overlay 16 37 nil t t) | ||
| 6595 | (make-overlay 42 25 nil t t) | ||
| 6596 | (make-overlay 8 41 nil t t) | ||
| 6597 | (make-overlay 13 27 nil nil t) | ||
| 6598 | (make-overlay 52 22 nil t nil) | ||
| 6599 | (make-overlay 36 17 nil t nil) | ||
| 6600 | (make-overlay 1 52 nil t nil) | ||
| 6601 | (make-overlay 55 5 nil nil t) | ||
| 6602 | (make-overlay 50 50 nil t nil) | ||
| 6603 | (make-overlay 32 15 nil t nil) | ||
| 6604 | (make-overlay 39 26 nil t nil) | ||
| 6605 | (make-overlay 26 4 nil nil nil) | ||
| 6606 | (make-overlay 38 47 nil t t) | ||
| 6607 | (goto-char 23) | ||
| 6608 | (insert ".") | ||
| 6609 | (goto-char 57) | ||
| 6610 | (delete-char 6) | ||
| 6611 | (goto-char 54) | ||
| 6612 | (insert "..............") | ||
| 6613 | (goto-char 46) | ||
| 6614 | (insert "...............") | ||
| 6615 | (goto-char 29) | ||
| 6616 | (insert ".......") | ||
| 6617 | (goto-char 58) | ||
| 6618 | (delete-char 21) | ||
| 6619 | (goto-char 45) | ||
| 6620 | (delete-char 4) | ||
| 6621 | (goto-char 50) | ||
| 6622 | (delete-char 4) | ||
| 6623 | (goto-char 20) | ||
| 6624 | (insert ".........") | ||
| 6625 | (goto-char 16) | ||
| 6626 | (insert "......") | ||
| 6627 | (goto-char 17) | ||
| 6628 | (insert ".....") | ||
| 6629 | (goto-char 63) | ||
| 6630 | (insert "........") | ||
| 6631 | (goto-char 83) | ||
| 6632 | (insert "....") | ||
| 6633 | (goto-char 73) | ||
| 6634 | (delete-char 8) | ||
| 6635 | (goto-char 69) | ||
| 6636 | (insert "...........") | ||
| 6637 | (goto-char 48) | ||
| 6638 | (widen) | ||
| 6639 | (narrow-to-region 19 31) | ||
| 6640 | (goto-char 22) | ||
| 6641 | (delete-char 3) | ||
| 6642 | (goto-char 23) | ||
| 6643 | (delete-char 5) | ||
| 6644 | (goto-char 20) | ||
| 6645 | (insert "............") | ||
| 6646 | (goto-char 23) | ||
| 6647 | (delete-char 11) | ||
| 6648 | (goto-char 19) | ||
| 6649 | (insert "..........") | ||
| 6650 | (goto-char 23) | ||
| 6651 | (insert "........") | ||
| 6652 | (goto-char 38) | ||
| 6653 | (delete-char 1) | ||
| 6654 | (goto-char 33) | ||
| 6655 | (delete-char 5) | ||
| 6656 | (goto-char 27) | ||
| 6657 | (insert "..........") | ||
| 6658 | (goto-char 35) | ||
| 6659 | (delete-char 8) | ||
| 6660 | (goto-char 35) | ||
| 6661 | (insert ".") | ||
| 6662 | (goto-char 20) | ||
| 6663 | (insert "......") | ||
| 6664 | (goto-char 22) | ||
| 6665 | (delete-char 22) | ||
| 6666 | (goto-char 23) | ||
| 6667 | (delete-char 0) | ||
| 6668 | (goto-char 22) | ||
| 6669 | (widen) | ||
| 6670 | (narrow-to-region 1 41) | ||
| 6671 | (goto-char 13) | ||
| 6672 | (insert ".......") | ||
| 6673 | (should | ||
| 6674 | (equal | ||
| 6675 | (test-overlay-regions) | ||
| 6676 | '((1 . 83) | ||
| 6677 | (4 . 46) | ||
| 6678 | (5 . 97) | ||
| 6679 | (8 . 83) | ||
| 6680 | (12 . 45) | ||
| 6681 | (13 . 47) | ||
| 6682 | (22 . 59) | ||
| 6683 | (30 . 82) | ||
| 6684 | (30 . 83) | ||
| 6685 | (41 . 83) | ||
| 6686 | (45 . 83) | ||
| 6687 | (46 . 83)))))) | ||
| 6688 | |||
| 6689 | (ert-deftest overlay-autogenerated-test-55 nil | ||
| 6690 | (with-temp-buffer | ||
| 6691 | (insert "................................................................") | ||
| 6692 | (make-overlay 58 20 nil nil nil) | ||
| 6693 | (make-overlay 60 33 nil t nil) | ||
| 6694 | (make-overlay 6 27 nil nil nil) | ||
| 6695 | (make-overlay 53 31 nil nil t) | ||
| 6696 | (make-overlay 30 55 nil t t) | ||
| 6697 | (make-overlay 4 64 nil t t) | ||
| 6698 | (make-overlay 51 31 nil nil t) | ||
| 6699 | (make-overlay 4 65 nil t t) | ||
| 6700 | (make-overlay 57 62 nil t t) | ||
| 6701 | (make-overlay 28 7 nil nil t) | ||
| 6702 | (make-overlay 61 48 nil t nil) | ||
| 6703 | (make-overlay 23 54 nil nil t) | ||
| 6704 | (make-overlay 47 49 nil nil nil) | ||
| 6705 | (make-overlay 12 52 nil t nil) | ||
| 6706 | (make-overlay 39 57 nil t t) | ||
| 6707 | (make-overlay 28 61 nil nil t) | ||
| 6708 | (goto-char 8) | ||
| 6709 | (insert "..............") | ||
| 6710 | (goto-char 63) | ||
| 6711 | (delete-char 3) | ||
| 6712 | (goto-char 67) | ||
| 6713 | (delete-char 6) | ||
| 6714 | (goto-char 3) | ||
| 6715 | (widen) | ||
| 6716 | (narrow-to-region 10 67) | ||
| 6717 | (goto-char 43) | ||
| 6718 | (insert ".............") | ||
| 6719 | (goto-char 20) | ||
| 6720 | (insert "...............") | ||
| 6721 | (goto-char 18) | ||
| 6722 | (insert "..") | ||
| 6723 | (goto-char 37) | ||
| 6724 | (delete-char 47) | ||
| 6725 | (goto-char 34) | ||
| 6726 | (insert "..............") | ||
| 6727 | (goto-char 31) | ||
| 6728 | (delete-char 2) | ||
| 6729 | (goto-char 16) | ||
| 6730 | (widen) | ||
| 6731 | (narrow-to-region 29 36) | ||
| 6732 | (goto-char 31) | ||
| 6733 | (delete-char 2) | ||
| 6734 | (goto-char 31) | ||
| 6735 | (insert ".......") | ||
| 6736 | (goto-char 40) | ||
| 6737 | (delete-char 0) | ||
| 6738 | (goto-char 32) | ||
| 6739 | (widen) | ||
| 6740 | (narrow-to-region 40 19) | ||
| 6741 | (goto-char 40) | ||
| 6742 | (insert "..") | ||
| 6743 | (goto-char 37) | ||
| 6744 | (delete-char 0) | ||
| 6745 | (goto-char 40) | ||
| 6746 | (delete-char 1) | ||
| 6747 | (goto-char 34) | ||
| 6748 | (delete-char 4) | ||
| 6749 | (goto-char 33) | ||
| 6750 | (insert "..............") | ||
| 6751 | (goto-char 19) | ||
| 6752 | (widen) | ||
| 6753 | (narrow-to-region 78 70) | ||
| 6754 | (goto-char 77) | ||
| 6755 | (insert ".........") | ||
| 6756 | (goto-char 80) | ||
| 6757 | (delete-char 1) | ||
| 6758 | (goto-char 73) | ||
| 6759 | (delete-char 3) | ||
| 6760 | (goto-char 70) | ||
| 6761 | (insert ".........") | ||
| 6762 | (goto-char 75) | ||
| 6763 | (delete-char 10) | ||
| 6764 | (goto-char 74) | ||
| 6765 | (delete-char 3) | ||
| 6766 | (goto-char 73) | ||
| 6767 | (insert "...............") | ||
| 6768 | (goto-char 90) | ||
| 6769 | (insert "......") | ||
| 6770 | (goto-char 94) | ||
| 6771 | (insert "..............") | ||
| 6772 | (goto-char 101) | ||
| 6773 | (insert "........") | ||
| 6774 | (goto-char 111) | ||
| 6775 | (insert "........") | ||
| 6776 | (should | ||
| 6777 | (equal | ||
| 6778 | (test-overlay-regions) | ||
| 6779 | '((4 . 132) | ||
| 6780 | (4 . 133) | ||
| 6781 | (65 . 89) | ||
| 6782 | (65 . 89) | ||
| 6783 | (65 . 89) | ||
| 6784 | (65 . 89) | ||
| 6785 | (65 . 129) | ||
| 6786 | (65 . 130) | ||
| 6787 | (65 . 130) | ||
| 6788 | (65 . 130) | ||
| 6789 | (65 . 130) | ||
| 6790 | (89 . 89) | ||
| 6791 | (89 . 130)))))) | ||
| 6792 | |||
| 6793 | (ert-deftest overlay-autogenerated-test-56 nil | ||
| 6794 | (with-temp-buffer | ||
| 6795 | (insert "................................................................") | ||
| 6796 | (make-overlay 7 14 nil nil t) | ||
| 6797 | (make-overlay 10 10 nil nil t) | ||
| 6798 | (make-overlay 21 23 nil nil t) | ||
| 6799 | (make-overlay 4 44 nil t nil) | ||
| 6800 | (make-overlay 42 16 nil t t) | ||
| 6801 | (make-overlay 1 57 nil t nil) | ||
| 6802 | (make-overlay 15 27 nil nil nil) | ||
| 6803 | (make-overlay 31 1 nil t nil) | ||
| 6804 | (make-overlay 56 45 nil t t) | ||
| 6805 | (make-overlay 46 19 nil t nil) | ||
| 6806 | (make-overlay 15 6 nil nil nil) | ||
| 6807 | (make-overlay 31 26 nil nil t) | ||
| 6808 | (make-overlay 39 41 nil t t) | ||
| 6809 | (make-overlay 52 48 nil nil t) | ||
| 6810 | (make-overlay 44 2 nil t nil) | ||
| 6811 | (make-overlay 60 7 nil nil t) | ||
| 6812 | (goto-char 49) | ||
| 6813 | (delete-char 11) | ||
| 6814 | (goto-char 43) | ||
| 6815 | (delete-char 9) | ||
| 6816 | (goto-char 42) | ||
| 6817 | (delete-char 2) | ||
| 6818 | (goto-char 12) | ||
| 6819 | (insert "...........") | ||
| 6820 | (goto-char 36) | ||
| 6821 | (insert ".........") | ||
| 6822 | (goto-char 1) | ||
| 6823 | (insert "......") | ||
| 6824 | (goto-char 67) | ||
| 6825 | (delete-char 0) | ||
| 6826 | (goto-char 47) | ||
| 6827 | (insert ".............") | ||
| 6828 | (goto-char 57) | ||
| 6829 | (insert "........") | ||
| 6830 | (goto-char 22) | ||
| 6831 | (widen) | ||
| 6832 | (narrow-to-region 75 33) | ||
| 6833 | (goto-char 41) | ||
| 6834 | (delete-char 28) | ||
| 6835 | (goto-char 43) | ||
| 6836 | (delete-char 0) | ||
| 6837 | (goto-char 33) | ||
| 6838 | (delete-char 5) | ||
| 6839 | (goto-char 38) | ||
| 6840 | (insert "..") | ||
| 6841 | (goto-char 42) | ||
| 6842 | (delete-char 0) | ||
| 6843 | (goto-char 38) | ||
| 6844 | (delete-char 0) | ||
| 6845 | (goto-char 38) | ||
| 6846 | (insert "............") | ||
| 6847 | (goto-char 51) | ||
| 6848 | (insert ".......") | ||
| 6849 | (goto-char 48) | ||
| 6850 | (insert "..") | ||
| 6851 | (goto-char 55) | ||
| 6852 | (insert ".") | ||
| 6853 | (goto-char 33) | ||
| 6854 | (delete-char 8) | ||
| 6855 | (goto-char 42) | ||
| 6856 | (insert "..") | ||
| 6857 | (goto-char 45) | ||
| 6858 | (insert "..") | ||
| 6859 | (goto-char 59) | ||
| 6860 | (insert ".............") | ||
| 6861 | (goto-char 53) | ||
| 6862 | (insert ".......") | ||
| 6863 | (goto-char 81) | ||
| 6864 | (delete-char 0) | ||
| 6865 | (goto-char 44) | ||
| 6866 | (delete-char 36) | ||
| 6867 | (goto-char 38) | ||
| 6868 | (delete-char 8) | ||
| 6869 | (goto-char 33) | ||
| 6870 | (insert ".............") | ||
| 6871 | (goto-char 41) | ||
| 6872 | (insert "..............") | ||
| 6873 | (goto-char 65) | ||
| 6874 | (insert "...............") | ||
| 6875 | (goto-char 61) | ||
| 6876 | (insert "...") | ||
| 6877 | (should | ||
| 6878 | (equal | ||
| 6879 | (test-overlay-regions) | ||
| 6880 | '((7 . 86) | ||
| 6881 | (7 . 97) | ||
| 6882 | (8 . 97) | ||
| 6883 | (10 . 97) | ||
| 6884 | (13 . 97) | ||
| 6885 | (32 . 68) | ||
| 6886 | (33 . 60) | ||
| 6887 | (60 . 97) | ||
| 6888 | (60 . 97) | ||
| 6889 | (68 . 86)))))) | ||
| 6890 | |||
| 6891 | (ert-deftest overlay-autogenerated-test-57 nil | ||
| 6892 | (with-temp-buffer | ||
| 6893 | (insert "................................................................") | ||
| 6894 | (make-overlay 52 31 nil t nil) | ||
| 6895 | (make-overlay 39 17 nil t nil) | ||
| 6896 | (make-overlay 19 20 nil t t) | ||
| 6897 | (make-overlay 18 3 nil nil t) | ||
| 6898 | (make-overlay 19 47 nil nil t) | ||
| 6899 | (make-overlay 38 54 nil nil nil) | ||
| 6900 | (make-overlay 30 51 nil nil t) | ||
| 6901 | (make-overlay 29 60 nil t t) | ||
| 6902 | (make-overlay 57 38 nil nil nil) | ||
| 6903 | (make-overlay 13 41 nil t nil) | ||
| 6904 | (make-overlay 9 44 nil t nil) | ||
| 6905 | (make-overlay 30 55 nil t nil) | ||
| 6906 | (make-overlay 33 10 nil nil nil) | ||
| 6907 | (make-overlay 14 35 nil nil t) | ||
| 6908 | (make-overlay 53 50 nil t nil) | ||
| 6909 | (make-overlay 25 28 nil nil t) | ||
| 6910 | (goto-char 40) | ||
| 6911 | (insert "..") | ||
| 6912 | (goto-char 64) | ||
| 6913 | (insert "........") | ||
| 6914 | (goto-char 47) | ||
| 6915 | (insert "............") | ||
| 6916 | (goto-char 65) | ||
| 6917 | (delete-char 0) | ||
| 6918 | (goto-char 86) | ||
| 6919 | (delete-char 1) | ||
| 6920 | (goto-char 59) | ||
| 6921 | (delete-char 11) | ||
| 6922 | (goto-char 64) | ||
| 6923 | (delete-char 8) | ||
| 6924 | (goto-char 53) | ||
| 6925 | (delete-char 0) | ||
| 6926 | (goto-char 28) | ||
| 6927 | (delete-char 8) | ||
| 6928 | (goto-char 6) | ||
| 6929 | (delete-char 33) | ||
| 6930 | (goto-char 14) | ||
| 6931 | (delete-char 2) | ||
| 6932 | (goto-char 2) | ||
| 6933 | (delete-char 10) | ||
| 6934 | (goto-char 3) | ||
| 6935 | (insert "..") | ||
| 6936 | (goto-char 5) | ||
| 6937 | (insert ".........") | ||
| 6938 | (goto-char 1) | ||
| 6939 | (insert "........") | ||
| 6940 | (goto-char 10) | ||
| 6941 | (delete-char 4) | ||
| 6942 | (goto-char 26) | ||
| 6943 | (insert "........") | ||
| 6944 | (goto-char 23) | ||
| 6945 | (insert "....") | ||
| 6946 | (goto-char 1) | ||
| 6947 | (widen) | ||
| 6948 | (narrow-to-region 15 23) | ||
| 6949 | (goto-char 19) | ||
| 6950 | (insert "...") | ||
| 6951 | (goto-char 24) | ||
| 6952 | (delete-char 0) | ||
| 6953 | (goto-char 19) | ||
| 6954 | (insert ".......") | ||
| 6955 | (goto-char 18) | ||
| 6956 | (insert "..") | ||
| 6957 | (goto-char 33) | ||
| 6958 | (insert "...") | ||
| 6959 | (goto-char 32) | ||
| 6960 | (insert "...............") | ||
| 6961 | (goto-char 29) | ||
| 6962 | (delete-char 10) | ||
| 6963 | (goto-char 29) | ||
| 6964 | (insert "..........") | ||
| 6965 | (goto-char 50) | ||
| 6966 | (insert "") | ||
| 6967 | (goto-char 16) | ||
| 6968 | (insert ".........") | ||
| 6969 | (goto-char 52) | ||
| 6970 | (widen) | ||
| 6971 | (narrow-to-region 59 15) | ||
| 6972 | (goto-char 35) | ||
| 6973 | (delete-char 4) | ||
| 6974 | (goto-char 18) | ||
| 6975 | (insert "....") | ||
| 6976 | (should | ||
| 6977 | (equal | ||
| 6978 | (test-overlay-regions) | ||
| 6979 | '((10 . 57) | ||
| 6980 | (10 . 57) | ||
| 6981 | (10 . 57) | ||
| 6982 | (10 . 60) | ||
| 6983 | (10 . 60) | ||
| 6984 | (10 . 61) | ||
| 6985 | (10 . 68) | ||
| 6986 | (57 . 57)))))) | ||
| 6987 | |||
| 6988 | (ert-deftest overlay-autogenerated-test-58 nil | ||
| 6989 | (with-temp-buffer | ||
| 6990 | (insert "................................................................") | ||
| 6991 | (make-overlay 8 16 nil t nil) | ||
| 6992 | (make-overlay 57 27 nil nil nil) | ||
| 6993 | (make-overlay 15 62 nil nil nil) | ||
| 6994 | (make-overlay 32 33 nil nil t) | ||
| 6995 | (make-overlay 47 27 nil nil t) | ||
| 6996 | (make-overlay 41 4 nil nil t) | ||
| 6997 | (make-overlay 57 61 nil t nil) | ||
| 6998 | (make-overlay 18 43 nil nil t) | ||
| 6999 | (make-overlay 64 51 nil t t) | ||
| 7000 | (make-overlay 44 26 nil nil nil) | ||
| 7001 | (make-overlay 9 13 nil nil t) | ||
| 7002 | (make-overlay 41 65 nil nil t) | ||
| 7003 | (make-overlay 23 13 nil t t) | ||
| 7004 | (make-overlay 26 59 nil t t) | ||
| 7005 | (make-overlay 65 65 nil t t) | ||
| 7006 | (make-overlay 15 7 nil nil nil) | ||
| 7007 | (goto-char 41) | ||
| 7008 | (insert "........") | ||
| 7009 | (goto-char 35) | ||
| 7010 | (delete-char 14) | ||
| 7011 | (goto-char 32) | ||
| 7012 | (widen) | ||
| 7013 | (narrow-to-region 23 46) | ||
| 7014 | (goto-char 41) | ||
| 7015 | (delete-char 5) | ||
| 7016 | (goto-char 29) | ||
| 7017 | (delete-char 10) | ||
| 7018 | (goto-char 31) | ||
| 7019 | (insert ".") | ||
| 7020 | (goto-char 29) | ||
| 7021 | (insert "........") | ||
| 7022 | (goto-char 27) | ||
| 7023 | (delete-char 7) | ||
| 7024 | (goto-char 29) | ||
| 7025 | (insert "") | ||
| 7026 | (goto-char 24) | ||
| 7027 | (insert "............") | ||
| 7028 | (goto-char 43) | ||
| 7029 | (delete-char 1) | ||
| 7030 | (goto-char 31) | ||
| 7031 | (delete-char 9) | ||
| 7032 | (goto-char 34) | ||
| 7033 | (widen) | ||
| 7034 | (narrow-to-region 20 14) | ||
| 7035 | (goto-char 20) | ||
| 7036 | (delete-char 0) | ||
| 7037 | (goto-char 17) | ||
| 7038 | (insert "...........") | ||
| 7039 | (goto-char 31) | ||
| 7040 | (delete-char 0) | ||
| 7041 | (goto-char 16) | ||
| 7042 | (insert "...........") | ||
| 7043 | (goto-char 17) | ||
| 7044 | (delete-char 8) | ||
| 7045 | (goto-char 23) | ||
| 7046 | (delete-char 5) | ||
| 7047 | (goto-char 20) | ||
| 7048 | (insert "..........") | ||
| 7049 | (goto-char 33) | ||
| 7050 | (widen) | ||
| 7051 | (narrow-to-region 16 29) | ||
| 7052 | (goto-char 24) | ||
| 7053 | (insert "...............") | ||
| 7054 | (goto-char 44) | ||
| 7055 | (delete-char 0) | ||
| 7056 | (goto-char 30) | ||
| 7057 | (insert "....") | ||
| 7058 | (goto-char 27) | ||
| 7059 | (widen) | ||
| 7060 | (narrow-to-region 4 22) | ||
| 7061 | (goto-char 10) | ||
| 7062 | (insert "..............") | ||
| 7063 | (goto-char 36) | ||
| 7064 | (insert "..") | ||
| 7065 | (goto-char 10) | ||
| 7066 | (delete-char 21) | ||
| 7067 | (goto-char 14) | ||
| 7068 | (delete-char 1) | ||
| 7069 | (goto-char 14) | ||
| 7070 | (insert "...........") | ||
| 7071 | (goto-char 12) | ||
| 7072 | (insert "........") | ||
| 7073 | (goto-char 32) | ||
| 7074 | (insert "........") | ||
| 7075 | (should | ||
| 7076 | (equal | ||
| 7077 | (test-overlay-regions) | ||
| 7078 | '((4 . 92) | ||
| 7079 | (7 . 10) | ||
| 7080 | (8 . 10) | ||
| 7081 | (9 . 10) | ||
| 7082 | (10 . 82) | ||
| 7083 | (10 . 104)))))) | ||
| 7084 | |||
| 7085 | (ert-deftest overlay-autogenerated-test-59 nil | ||
| 7086 | (with-temp-buffer | ||
| 7087 | (insert "................................................................") | ||
| 7088 | (make-overlay 46 30 nil t t) | ||
| 7089 | (make-overlay 3 26 nil nil nil) | ||
| 7090 | (make-overlay 36 28 nil t t) | ||
| 7091 | (make-overlay 49 49 nil t t) | ||
| 7092 | (make-overlay 27 61 nil t nil) | ||
| 7093 | (make-overlay 14 16 nil nil nil) | ||
| 7094 | (make-overlay 50 61 nil t nil) | ||
| 7095 | (make-overlay 59 63 nil nil nil) | ||
| 7096 | (make-overlay 36 34 nil t nil) | ||
| 7097 | (make-overlay 35 29 nil nil nil) | ||
| 7098 | (make-overlay 5 65 nil nil nil) | ||
| 7099 | (make-overlay 20 61 nil nil t) | ||
| 7100 | (make-overlay 10 42 nil nil nil) | ||
| 7101 | (make-overlay 47 49 nil nil t) | ||
| 7102 | (make-overlay 12 4 nil nil nil) | ||
| 7103 | (make-overlay 32 24 nil t t) | ||
| 7104 | (goto-char 11) | ||
| 7105 | (insert ".") | ||
| 7106 | (goto-char 32) | ||
| 7107 | (delete-char 2) | ||
| 7108 | (goto-char 61) | ||
| 7109 | (insert ".........") | ||
| 7110 | (goto-char 36) | ||
| 7111 | (insert "........") | ||
| 7112 | (goto-char 55) | ||
| 7113 | (widen) | ||
| 7114 | (narrow-to-region 8 55) | ||
| 7115 | (goto-char 21) | ||
| 7116 | (insert "....") | ||
| 7117 | (goto-char 32) | ||
| 7118 | (delete-char 15) | ||
| 7119 | (goto-char 30) | ||
| 7120 | (delete-char 5) | ||
| 7121 | (goto-char 31) | ||
| 7122 | (insert "......") | ||
| 7123 | (goto-char 18) | ||
| 7124 | (insert "..") | ||
| 7125 | (goto-char 14) | ||
| 7126 | (insert ".............") | ||
| 7127 | (goto-char 34) | ||
| 7128 | (insert "............") | ||
| 7129 | (goto-char 51) | ||
| 7130 | (widen) | ||
| 7131 | (narrow-to-region 58 31) | ||
| 7132 | (goto-char 50) | ||
| 7133 | (delete-char 5) | ||
| 7134 | (goto-char 53) | ||
| 7135 | (insert ".........") | ||
| 7136 | (goto-char 56) | ||
| 7137 | (insert "...............") | ||
| 7138 | (goto-char 45) | ||
| 7139 | (delete-char 1) | ||
| 7140 | (goto-char 67) | ||
| 7141 | (insert "............") | ||
| 7142 | (goto-char 84) | ||
| 7143 | (insert "") | ||
| 7144 | (goto-char 39) | ||
| 7145 | (delete-char 27) | ||
| 7146 | (goto-char 39) | ||
| 7147 | (delete-char 21) | ||
| 7148 | (goto-char 32) | ||
| 7149 | (insert "............") | ||
| 7150 | (goto-char 36) | ||
| 7151 | (widen) | ||
| 7152 | (narrow-to-region 7 37) | ||
| 7153 | (goto-char 11) | ||
| 7154 | (insert ".......") | ||
| 7155 | (goto-char 21) | ||
| 7156 | (delete-char 13) | ||
| 7157 | (goto-char 15) | ||
| 7158 | (insert "....") | ||
| 7159 | (goto-char 9) | ||
| 7160 | (insert ".............") | ||
| 7161 | (goto-char 13) | ||
| 7162 | (delete-char 21) | ||
| 7163 | (goto-char 21) | ||
| 7164 | (delete-char 6) | ||
| 7165 | (goto-char 16) | ||
| 7166 | (insert ".......") | ||
| 7167 | (goto-char 22) | ||
| 7168 | (insert "") | ||
| 7169 | (goto-char 27) | ||
| 7170 | (delete-char 0) | ||
| 7171 | (should | ||
| 7172 | (equal | ||
| 7173 | (test-overlay-regions) | ||
| 7174 | '((3 . 42) | ||
| 7175 | (4 . 16) | ||
| 7176 | (5 . 83) | ||
| 7177 | (13 . 51) | ||
| 7178 | (25 . 27)))))) | ||
| 7179 | |||
| 7180 | (ert-deftest overlay-autogenerated-test-60 nil | ||
| 7181 | (with-temp-buffer | ||
| 7182 | (insert "................................................................") | ||
| 7183 | (make-overlay 38 32 nil t nil) | ||
| 7184 | (make-overlay 32 42 nil t nil) | ||
| 7185 | (make-overlay 29 11 nil nil t) | ||
| 7186 | (make-overlay 52 22 nil t t) | ||
| 7187 | (make-overlay 39 59 nil t nil) | ||
| 7188 | (make-overlay 41 30 nil t t) | ||
| 7189 | (make-overlay 29 61 nil nil t) | ||
| 7190 | (make-overlay 11 45 nil nil nil) | ||
| 7191 | (make-overlay 46 17 nil nil t) | ||
| 7192 | (make-overlay 35 51 nil t t) | ||
| 7193 | (make-overlay 22 13 nil nil t) | ||
| 7194 | (make-overlay 52 34 nil nil t) | ||
| 7195 | (make-overlay 59 4 nil nil t) | ||
| 7196 | (make-overlay 8 22 nil nil nil) | ||
| 7197 | (make-overlay 4 49 nil nil nil) | ||
| 7198 | (make-overlay 52 45 nil t t) | ||
| 7199 | (goto-char 48) | ||
| 7200 | (delete-char 16) | ||
| 7201 | (goto-char 37) | ||
| 7202 | (delete-char 8) | ||
| 7203 | (goto-char 14) | ||
| 7204 | (insert "...............") | ||
| 7205 | (goto-char 40) | ||
| 7206 | (delete-char 16) | ||
| 7207 | (goto-char 19) | ||
| 7208 | (insert ".........") | ||
| 7209 | (goto-char 16) | ||
| 7210 | (insert "......") | ||
| 7211 | (goto-char 10) | ||
| 7212 | (insert "........") | ||
| 7213 | (goto-char 11) | ||
| 7214 | (insert "...............") | ||
| 7215 | (goto-char 22) | ||
| 7216 | (insert ".") | ||
| 7217 | (goto-char 62) | ||
| 7218 | (delete-char 16) | ||
| 7219 | (goto-char 14) | ||
| 7220 | (delete-char 11) | ||
| 7221 | (goto-char 47) | ||
| 7222 | (insert "....") | ||
| 7223 | (goto-char 33) | ||
| 7224 | (insert ".............") | ||
| 7225 | (goto-char 49) | ||
| 7226 | (delete-char 13) | ||
| 7227 | (goto-char 28) | ||
| 7228 | (insert "..") | ||
| 7229 | (goto-char 35) | ||
| 7230 | (delete-char 13) | ||
| 7231 | (goto-char 44) | ||
| 7232 | (insert "....") | ||
| 7233 | (goto-char 34) | ||
| 7234 | (delete-char 14) | ||
| 7235 | (goto-char 23) | ||
| 7236 | (insert ".....") | ||
| 7237 | (goto-char 25) | ||
| 7238 | (delete-char 4) | ||
| 7239 | (goto-char 33) | ||
| 7240 | (insert ".....") | ||
| 7241 | (goto-char 27) | ||
| 7242 | (delete-char 3) | ||
| 7243 | (goto-char 16) | ||
| 7244 | (widen) | ||
| 7245 | (narrow-to-region 36 37) | ||
| 7246 | (goto-char 36) | ||
| 7247 | (delete-char 1) | ||
| 7248 | (goto-char 36) | ||
| 7249 | (insert ".......") | ||
| 7250 | (goto-char 37) | ||
| 7251 | (widen) | ||
| 7252 | (narrow-to-region 35 31) | ||
| 7253 | (goto-char 34) | ||
| 7254 | (delete-char 0) | ||
| 7255 | (goto-char 31) | ||
| 7256 | (delete-char 2) | ||
| 7257 | (goto-char 31) | ||
| 7258 | (widen) | ||
| 7259 | (narrow-to-region 24 3) | ||
| 7260 | (goto-char 22) | ||
| 7261 | (delete-char 2) | ||
| 7262 | (goto-char 22) | ||
| 7263 | (insert ".............") | ||
| 7264 | (goto-char 4) | ||
| 7265 | (insert ".") | ||
| 7266 | (should | ||
| 7267 | (equal | ||
| 7268 | (test-overlay-regions) | ||
| 7269 | '((4 . 54) | ||
| 7270 | (4 . 54) | ||
| 7271 | (9 . 46)))))) | ||
| 7272 | |||
| 7273 | (ert-deftest overlay-autogenerated-test-61 nil | ||
| 7274 | (with-temp-buffer | ||
| 7275 | (insert "................................................................") | ||
| 7276 | (make-overlay 45 56 nil t nil) | ||
| 7277 | (make-overlay 60 45 nil nil nil) | ||
| 7278 | (make-overlay 26 8 nil t t) | ||
| 7279 | (make-overlay 63 39 nil nil nil) | ||
| 7280 | (make-overlay 18 11 nil t nil) | ||
| 7281 | (make-overlay 22 64 nil nil t) | ||
| 7282 | (make-overlay 8 41 nil nil t) | ||
| 7283 | (make-overlay 6 51 nil t t) | ||
| 7284 | (make-overlay 38 26 nil t t) | ||
| 7285 | (make-overlay 7 46 nil t nil) | ||
| 7286 | (make-overlay 2 42 nil nil t) | ||
| 7287 | (make-overlay 44 64 nil nil nil) | ||
| 7288 | (make-overlay 7 62 nil t nil) | ||
| 7289 | (make-overlay 8 40 nil nil t) | ||
| 7290 | (make-overlay 62 36 nil t t) | ||
| 7291 | (make-overlay 61 27 nil nil nil) | ||
| 7292 | (goto-char 21) | ||
| 7293 | (delete-char 0) | ||
| 7294 | (goto-char 8) | ||
| 7295 | (insert "") | ||
| 7296 | (goto-char 55) | ||
| 7297 | (insert "......") | ||
| 7298 | (goto-char 38) | ||
| 7299 | (delete-char 25) | ||
| 7300 | (goto-char 37) | ||
| 7301 | (delete-char 4) | ||
| 7302 | (goto-char 12) | ||
| 7303 | (delete-char 4) | ||
| 7304 | (goto-char 3) | ||
| 7305 | (delete-char 26) | ||
| 7306 | (goto-char 10) | ||
| 7307 | (insert ".......") | ||
| 7308 | (goto-char 18) | ||
| 7309 | (delete-char 0) | ||
| 7310 | (goto-char 16) | ||
| 7311 | (insert ".............") | ||
| 7312 | (goto-char 18) | ||
| 7313 | (delete-char 3) | ||
| 7314 | (goto-char 7) | ||
| 7315 | (insert "...") | ||
| 7316 | (goto-char 20) | ||
| 7317 | (insert "........") | ||
| 7318 | (goto-char 38) | ||
| 7319 | (delete-char 0) | ||
| 7320 | (goto-char 1) | ||
| 7321 | (delete-char 36) | ||
| 7322 | (goto-char 3) | ||
| 7323 | (delete-char 1) | ||
| 7324 | (goto-char 2) | ||
| 7325 | (insert "......") | ||
| 7326 | (goto-char 4) | ||
| 7327 | (insert ".......") | ||
| 7328 | (goto-char 2) | ||
| 7329 | (insert "...........") | ||
| 7330 | (goto-char 27) | ||
| 7331 | (insert ".....") | ||
| 7332 | (goto-char 15) | ||
| 7333 | (insert "...............") | ||
| 7334 | (goto-char 2) | ||
| 7335 | (insert "......") | ||
| 7336 | (goto-char 17) | ||
| 7337 | (delete-char 8) | ||
| 7338 | (goto-char 15) | ||
| 7339 | (delete-char 7) | ||
| 7340 | (goto-char 33) | ||
| 7341 | (delete-char 5) | ||
| 7342 | (goto-char 13) | ||
| 7343 | (insert "...........") | ||
| 7344 | (goto-char 34) | ||
| 7345 | (insert "...............") | ||
| 7346 | (goto-char 33) | ||
| 7347 | (insert "") | ||
| 7348 | (goto-char 51) | ||
| 7349 | (insert "....") | ||
| 7350 | (goto-char 14) | ||
| 7351 | (delete-char 36) | ||
| 7352 | (goto-char 16) | ||
| 7353 | (delete-char 1) | ||
| 7354 | (goto-char 14) | ||
| 7355 | (delete-char 8) | ||
| 7356 | (should | ||
| 7357 | (equal | ||
| 7358 | (test-overlay-regions) | ||
| 7359 | '((1 . 1) | ||
| 7360 | (1 . 1) | ||
| 7361 | (1 . 1) | ||
| 7362 | (1 . 1) | ||
| 7363 | (1 . 1) | ||
| 7364 | (1 . 1) | ||
| 7365 | (1 . 1) | ||
| 7366 | (1 . 1) | ||
| 7367 | (1 . 1) | ||
| 7368 | (1 . 1) | ||
| 7369 | (1 . 1) | ||
| 7370 | (1 . 1) | ||
| 7371 | (1 . 1) | ||
| 7372 | (1 . 1) | ||
| 7373 | (1 . 18) | ||
| 7374 | (1 . 18)))))) | ||
| 7375 | |||
| 7376 | (ert-deftest overlay-autogenerated-test-62 nil | ||
| 7377 | (with-temp-buffer | ||
| 7378 | (insert "................................................................") | ||
| 7379 | (make-overlay 25 36 nil t nil) | ||
| 7380 | (make-overlay 38 6 nil t nil) | ||
| 7381 | (make-overlay 40 63 nil nil t) | ||
| 7382 | (make-overlay 34 23 nil nil nil) | ||
| 7383 | (make-overlay 48 46 nil nil nil) | ||
| 7384 | (make-overlay 43 57 nil t t) | ||
| 7385 | (make-overlay 6 53 nil t t) | ||
| 7386 | (make-overlay 37 27 nil t t) | ||
| 7387 | (make-overlay 8 39 nil t nil) | ||
| 7388 | (make-overlay 62 6 nil nil nil) | ||
| 7389 | (make-overlay 51 6 nil t t) | ||
| 7390 | (make-overlay 58 11 nil nil t) | ||
| 7391 | (make-overlay 19 25 nil t nil) | ||
| 7392 | (make-overlay 13 8 nil nil nil) | ||
| 7393 | (make-overlay 19 8 nil nil t) | ||
| 7394 | (make-overlay 39 5 nil t t) | ||
| 7395 | (goto-char 51) | ||
| 7396 | (delete-char 5) | ||
| 7397 | (goto-char 16) | ||
| 7398 | (delete-char 9) | ||
| 7399 | (goto-char 18) | ||
| 7400 | (insert "") | ||
| 7401 | (goto-char 47) | ||
| 7402 | (delete-char 4) | ||
| 7403 | (goto-char 24) | ||
| 7404 | (insert ".........") | ||
| 7405 | (goto-char 24) | ||
| 7406 | (insert ".....") | ||
| 7407 | (goto-char 18) | ||
| 7408 | (insert "...........") | ||
| 7409 | (goto-char 5) | ||
| 7410 | (delete-char 6) | ||
| 7411 | (goto-char 30) | ||
| 7412 | (insert "...........") | ||
| 7413 | (goto-char 8) | ||
| 7414 | (insert ".............") | ||
| 7415 | (goto-char 78) | ||
| 7416 | (insert "............") | ||
| 7417 | (goto-char 67) | ||
| 7418 | (insert "") | ||
| 7419 | (goto-char 58) | ||
| 7420 | (insert "") | ||
| 7421 | (goto-char 5) | ||
| 7422 | (insert ".") | ||
| 7423 | (goto-char 79) | ||
| 7424 | (widen) | ||
| 7425 | (narrow-to-region 51 55) | ||
| 7426 | (goto-char 51) | ||
| 7427 | (insert "....") | ||
| 7428 | (goto-char 58) | ||
| 7429 | (widen) | ||
| 7430 | (narrow-to-region 36 37) | ||
| 7431 | (goto-char 37) | ||
| 7432 | (insert "....") | ||
| 7433 | (goto-char 40) | ||
| 7434 | (insert ".......") | ||
| 7435 | (goto-char 47) | ||
| 7436 | (delete-char 1) | ||
| 7437 | (goto-char 43) | ||
| 7438 | (delete-char 4) | ||
| 7439 | (goto-char 37) | ||
| 7440 | (insert "........") | ||
| 7441 | (goto-char 49) | ||
| 7442 | (insert "............") | ||
| 7443 | (goto-char 42) | ||
| 7444 | (widen) | ||
| 7445 | (narrow-to-region 75 111) | ||
| 7446 | (goto-char 104) | ||
| 7447 | (widen) | ||
| 7448 | (narrow-to-region 21 95) | ||
| 7449 | (goto-char 22) | ||
| 7450 | (widen) | ||
| 7451 | (narrow-to-region 64 79) | ||
| 7452 | (goto-char 64) | ||
| 7453 | (delete-char 0) | ||
| 7454 | (goto-char 68) | ||
| 7455 | (insert "........") | ||
| 7456 | (goto-char 82) | ||
| 7457 | (insert "") | ||
| 7458 | (goto-char 81) | ||
| 7459 | (insert "........") | ||
| 7460 | (goto-char 92) | ||
| 7461 | (delete-char 2) | ||
| 7462 | (goto-char 87) | ||
| 7463 | (insert ".") | ||
| 7464 | (should | ||
| 7465 | (equal | ||
| 7466 | (test-overlay-regions) | ||
| 7467 | '((5 . 145) | ||
| 7468 | (5 . 148) | ||
| 7469 | (6 . 118) | ||
| 7470 | (6 . 119) | ||
| 7471 | (6 . 119) | ||
| 7472 | (6 . 143) | ||
| 7473 | (6 . 143) | ||
| 7474 | (24 . 114) | ||
| 7475 | (24 . 116) | ||
| 7476 | (63 . 117)))))) | ||
| 7477 | |||
| 7478 | (ert-deftest overlay-autogenerated-test-63 nil | ||
| 7479 | (with-temp-buffer | ||
| 7480 | (insert "................................................................") | ||
| 7481 | (make-overlay 9 49 nil t nil) | ||
| 7482 | (make-overlay 9 16 nil nil nil) | ||
| 7483 | (make-overlay 64 2 nil t t) | ||
| 7484 | (make-overlay 17 31 nil nil t) | ||
| 7485 | (make-overlay 24 51 nil nil nil) | ||
| 7486 | (make-overlay 27 56 nil t t) | ||
| 7487 | (make-overlay 21 4 nil nil nil) | ||
| 7488 | (make-overlay 24 29 nil t t) | ||
| 7489 | (make-overlay 4 63 nil nil t) | ||
| 7490 | (make-overlay 34 49 nil t nil) | ||
| 7491 | (make-overlay 19 47 nil nil t) | ||
| 7492 | (make-overlay 8 50 nil t nil) | ||
| 7493 | (make-overlay 49 61 nil t nil) | ||
| 7494 | (make-overlay 52 10 nil t t) | ||
| 7495 | (make-overlay 64 30 nil t nil) | ||
| 7496 | (make-overlay 5 13 nil t nil) | ||
| 7497 | (goto-char 27) | ||
| 7498 | (insert "........") | ||
| 7499 | (goto-char 42) | ||
| 7500 | (insert "......") | ||
| 7501 | (goto-char 48) | ||
| 7502 | (insert "....") | ||
| 7503 | (goto-char 55) | ||
| 7504 | (widen) | ||
| 7505 | (narrow-to-region 10 5) | ||
| 7506 | (goto-char 8) | ||
| 7507 | (insert ".............") | ||
| 7508 | (goto-char 19) | ||
| 7509 | (insert "......") | ||
| 7510 | (goto-char 19) | ||
| 7511 | (delete-char 3) | ||
| 7512 | (goto-char 8) | ||
| 7513 | (delete-char 3) | ||
| 7514 | (goto-char 9) | ||
| 7515 | (insert ".......") | ||
| 7516 | (goto-char 29) | ||
| 7517 | (insert "...............") | ||
| 7518 | (goto-char 38) | ||
| 7519 | (insert ".......") | ||
| 7520 | (goto-char 34) | ||
| 7521 | (insert "......") | ||
| 7522 | (goto-char 28) | ||
| 7523 | (delete-char 20) | ||
| 7524 | (goto-char 22) | ||
| 7525 | (insert "............") | ||
| 7526 | (goto-char 21) | ||
| 7527 | (delete-char 23) | ||
| 7528 | (goto-char 25) | ||
| 7529 | (delete-char 2) | ||
| 7530 | (goto-char 19) | ||
| 7531 | (delete-char 2) | ||
| 7532 | (goto-char 12) | ||
| 7533 | (delete-char 6) | ||
| 7534 | (goto-char 12) | ||
| 7535 | (delete-char 0) | ||
| 7536 | (goto-char 13) | ||
| 7537 | (delete-char 0) | ||
| 7538 | (goto-char 12) | ||
| 7539 | (insert "........") | ||
| 7540 | (goto-char 23) | ||
| 7541 | (delete-char 2) | ||
| 7542 | (goto-char 5) | ||
| 7543 | (insert "...............") | ||
| 7544 | (goto-char 28) | ||
| 7545 | (delete-char 0) | ||
| 7546 | (goto-char 16) | ||
| 7547 | (insert "..........") | ||
| 7548 | (goto-char 8) | ||
| 7549 | (delete-char 17) | ||
| 7550 | (goto-char 27) | ||
| 7551 | (delete-char 0) | ||
| 7552 | (goto-char 12) | ||
| 7553 | (insert ".") | ||
| 7554 | (goto-char 14) | ||
| 7555 | (delete-char 12) | ||
| 7556 | (goto-char 11) | ||
| 7557 | (insert "..............") | ||
| 7558 | (goto-char 34) | ||
| 7559 | (insert "") | ||
| 7560 | (goto-char 25) | ||
| 7561 | (delete-char 8) | ||
| 7562 | (should | ||
| 7563 | (equal | ||
| 7564 | (test-overlay-regions) | ||
| 7565 | '((2 . 98) | ||
| 7566 | (4 . 37) | ||
| 7567 | (4 . 97) | ||
| 7568 | (25 . 29) | ||
| 7569 | (25 . 32) | ||
| 7570 | (25 . 84)))))) | ||
| 7571 | |||
| 53 | ;;; buffer-tests.el ends here | 7572 | ;;; buffer-tests.el ends here |