diff options
| author | Gerd Moellmann | 2001-02-13 16:29:20 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2001-02-13 16:29:20 +0000 |
| commit | 0a41199524577dadaf29652a6edb5bcd07b3560c (patch) | |
| tree | 67e6c91c33f4aa8fe3196290ae7e0806e2cecaa8 | |
| parent | 5ddc1b75c6b54d2fe1d0501e0148e193546dbfd3 (diff) | |
| download | emacs-0a41199524577dadaf29652a6edb5bcd07b3560c.tar.gz emacs-0a41199524577dadaf29652a6edb5bcd07b3560c.zip | |
(del_range_1, del_range_byte, del_range_both): Handle
case that TO ends up beyond ZV after running before-change-functions.
| -rw-r--r-- | src/ChangeLog | 3 | ||||
| -rw-r--r-- | src/insdel.c | 16 |
2 files changed, 16 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 670e999a9ea..3d7451da8ad 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2001-02-13 Gerd Moellmann <gerd@gnu.org> | 1 | 2001-02-13 Gerd Moellmann <gerd@gnu.org> |
| 2 | 2 | ||
| 3 | * insdel.c (del_range_1, del_range_byte, del_range_both): Handle | ||
| 4 | case that TO ends up beyond ZV after running before-change-functions. | ||
| 5 | |||
| 3 | * window.c (window_loop) <GET_BUFFER_WINDOW>: Prefer to return | 6 | * window.c (window_loop) <GET_BUFFER_WINDOW>: Prefer to return |
| 4 | the selected window if it is showing the buffer in question. | 7 | the selected window if it is showing the buffer in question. |
| 5 | 8 | ||
diff --git a/src/insdel.c b/src/insdel.c index 5574f850e83..7ea1181703b 100644 --- a/src/insdel.c +++ b/src/insdel.c | |||
| @@ -1552,7 +1552,7 @@ del_range_1 (from, to, prepare, ret_string) | |||
| 1552 | { | 1552 | { |
| 1553 | int range_length = to - from; | 1553 | int range_length = to - from; |
| 1554 | prepare_to_modify_buffer (from, to, &from); | 1554 | prepare_to_modify_buffer (from, to, &from); |
| 1555 | to = from + range_length; | 1555 | to = min (ZV, from + range_length); |
| 1556 | } | 1556 | } |
| 1557 | 1557 | ||
| 1558 | from_byte = CHAR_TO_BYTE (from); | 1558 | from_byte = CHAR_TO_BYTE (from); |
| @@ -1595,7 +1595,12 @@ del_range_byte (from_byte, to_byte, prepare) | |||
| 1595 | 1595 | ||
| 1596 | if (old_from != from) | 1596 | if (old_from != from) |
| 1597 | from_byte = CHAR_TO_BYTE (from); | 1597 | from_byte = CHAR_TO_BYTE (from); |
| 1598 | if (old_to == Z - to) | 1598 | if (to > ZV) |
| 1599 | { | ||
| 1600 | to = ZV; | ||
| 1601 | to_byte = ZV_BYTE; | ||
| 1602 | } | ||
| 1603 | else if (old_to == Z - to) | ||
| 1599 | to_byte = CHAR_TO_BYTE (to); | 1604 | to_byte = CHAR_TO_BYTE (to); |
| 1600 | } | 1605 | } |
| 1601 | 1606 | ||
| @@ -1634,7 +1639,12 @@ del_range_both (from, from_byte, to, to_byte, prepare) | |||
| 1634 | 1639 | ||
| 1635 | if (old_from != from) | 1640 | if (old_from != from) |
| 1636 | from_byte = CHAR_TO_BYTE (from); | 1641 | from_byte = CHAR_TO_BYTE (from); |
| 1637 | if (old_to == Z - to) | 1642 | if (to > ZV) |
| 1643 | { | ||
| 1644 | to = ZV; | ||
| 1645 | to_byte = ZV_BYTE; | ||
| 1646 | } | ||
| 1647 | else if (old_to == Z - to) | ||
| 1638 | to_byte = CHAR_TO_BYTE (to); | 1648 | to_byte = CHAR_TO_BYTE (to); |
| 1639 | } | 1649 | } |
| 1640 | 1650 | ||