]> git.eshelyaron.com Git - emacs.git/commit
itree: Reproduce markers's behavior more faithfully (bug#58928)
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 4 Nov 2022 02:44:55 +0000 (22:44 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Fri, 4 Nov 2022 02:44:55 +0000 (22:44 -0400)
commitff679e16f8bf8a9876fc1a980c372d4e55f3745d
tree187712c5c9957fde923430d14ec6fd59f5441be4
parent7d47651d0168c863ad9e9b07921a42dc18029276
itree: Reproduce markers's behavior more faithfully (bug#58928)

The most obvious problem was the lack of support for
`insert-before-markers`, but the behavior was also different in a few
other cases.

* src/itree.h (itree_insert_gap):
* src/itree.c (itree_insert_gap): Add `before_markers` arg.
* src/lisp.h (adjust_overlays_for_insert):
* src/buffer.c (adjust_overlays_for_insert): Add `before_markers` arg.

* src/insdel.c (adjust_markers_for_replace, adjust_markers_for_insert)
(adjust_markers_for_delete): Adjust overlays directly from here.
(insert_1_both, insert_from_string_1, insert_from_gap)
(insert_from_buffer_1, adjust_after_replace, replace_range)
(replace_range_2, del_range_2): Don't adjust overlays explicitly here
any more.

* test/src/buffer-tests.el (test-overlay-insert-before-markers-empty)
(test-overlay-insert-before-markers-non-empty): New tests.
src/buffer.c
src/insdel.c
src/itree.c
src/itree.h
src/lisp.h
test/src/buffer-tests.el