diff options
| author | Richard M. Stallman | 1998-03-21 05:48:03 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1998-03-21 05:48:03 +0000 |
| commit | 2db5082ff442ba59a7cbc572143910aa5d845f88 (patch) | |
| tree | db02785f69d124c36acc073c38e08f94b8a923d6 /src | |
| parent | aab28f47221ac8cfd92f1655ea6c2216b8f8ab7a (diff) | |
| download | emacs-2db5082ff442ba59a7cbc572143910aa5d845f88.tar.gz emacs-2db5082ff442ba59a7cbc572143910aa5d845f88.zip | |
(replace_range): New arg NOMARKERS.
Diffstat (limited to 'src')
| -rw-r--r-- | src/insdel.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/insdel.c b/src/insdel.c index 3c76f3255dc..e2223f1b4f7 100644 --- a/src/insdel.c +++ b/src/insdel.c | |||
| @@ -1492,9 +1492,9 @@ adjust_after_replace (from, from_byte, to, to_byte, len, len_byte, replace) | |||
| 1492 | That way, undo will also handle markers properly. */ | 1492 | That way, undo will also handle markers properly. */ |
| 1493 | 1493 | ||
| 1494 | void | 1494 | void |
| 1495 | replace_range (from, to, new, prepare, inherit) | 1495 | replace_range (from, to, new, prepare, inherit, nomarkers) |
| 1496 | Lisp_Object new; | 1496 | Lisp_Object new; |
| 1497 | int from, to, prepare, inherit; | 1497 | int from, to, prepare, inherit, nomarkers; |
| 1498 | { | 1498 | { |
| 1499 | int inschars = XSTRING (new)->size; | 1499 | int inschars = XSTRING (new)->size; |
| 1500 | int insbytes = XSTRING (new)->size_byte; | 1500 | int insbytes = XSTRING (new)->size_byte; |
| @@ -1558,11 +1558,12 @@ replace_range (from, to, new, prepare, inherit) | |||
| 1558 | 1558 | ||
| 1559 | deletion = make_buffer_string_both (from, from_byte, to, to_byte, 1); | 1559 | deletion = make_buffer_string_both (from, from_byte, to, to_byte, 1); |
| 1560 | 1560 | ||
| 1561 | /* Relocate all markers pointing into the new, larger gap | 1561 | if (nomarkers) |
| 1562 | to point at the end of the text before the gap. | 1562 | /* Relocate all markers pointing into the new, larger gap |
| 1563 | Do this before recording the deletion, | 1563 | to point at the end of the text before the gap. |
| 1564 | so that undo handles this after reinserting the text. */ | 1564 | Do this before recording the deletion, |
| 1565 | adjust_markers_for_delete (from, from_byte, to, to_byte); | 1565 | so that undo handles this after reinserting the text. */ |
| 1566 | adjust_markers_for_delete (from, from_byte, to, to_byte); | ||
| 1566 | 1567 | ||
| 1567 | record_delete (from, deletion); | 1568 | record_delete (from, deletion); |
| 1568 | 1569 | ||
| @@ -1658,9 +1659,10 @@ replace_range (from, to, new, prepare, inherit) | |||
| 1658 | adjusting the markers that bound the overlays. */ | 1659 | adjusting the markers that bound the overlays. */ |
| 1659 | adjust_overlays_for_delete (from, nchars_del); | 1660 | adjust_overlays_for_delete (from, nchars_del); |
| 1660 | adjust_overlays_for_insert (from, inschars); | 1661 | adjust_overlays_for_insert (from, inschars); |
| 1661 | adjust_markers_for_insert (from, from_byte, | 1662 | if (nomarkers) |
| 1662 | from + inschars, from_byte + outgoing_insbytes, | 1663 | adjust_markers_for_insert (from, from_byte, |
| 1663 | combined_before_bytes, combined_after_bytes, 0); | 1664 | from + inschars, from_byte + outgoing_insbytes, |
| 1665 | combined_before_bytes, combined_after_bytes, 0); | ||
| 1664 | 1666 | ||
| 1665 | #ifdef USE_TEXT_PROPERTIES | 1667 | #ifdef USE_TEXT_PROPERTIES |
| 1666 | offset_intervals (current_buffer, PT, inschars - nchars_del); | 1668 | offset_intervals (current_buffer, PT, inschars - nchars_del); |