aboutsummaryrefslogtreecommitdiffstats
path: root/src/insdel.c
diff options
context:
space:
mode:
authorStefan Monnier2014-12-11 16:07:23 -0500
committerStefan Monnier2014-12-11 16:07:23 -0500
commitaeeaf082e69ec088d6bbb140ddf0ce8119580a67 (patch)
tree433810d5e49b5a9b7f110bffc7a6659ca43f7c59 /src/insdel.c
parentc6f03ed03d68e52e8b18011d2c57959532b45fb5 (diff)
downloademacs-aeeaf082e69ec088d6bbb140ddf0ce8119580a67.tar.gz
emacs-aeeaf082e69ec088d6bbb140ddf0ce8119580a67.zip
Fixes: debbugs:19161
* src/fileio.c: Better preserve window-points during revert. (Qget_buffer_window_list): New var. (get_window_points_and_markers, restore_window_points): New functions. (Finsert_file_contents): Use them to save and restore window-points.
Diffstat (limited to 'src/insdel.c')
-rw-r--r--src/insdel.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/insdel.c b/src/insdel.c
index 3133ca4bd2c..7b4ee3b7b06 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -1202,10 +1202,10 @@ adjust_after_replace (ptrdiff_t from, ptrdiff_t from_byte,
1202 1202
1203 /* Update various buffer positions for the new text. */ 1203 /* Update various buffer positions for the new text. */
1204 GAP_SIZE -= len_byte; 1204 GAP_SIZE -= len_byte;
1205 ZV += len; Z+= len; 1205 ZV += len; Z += len;
1206 ZV_BYTE += len_byte; Z_BYTE += len_byte; 1206 ZV_BYTE += len_byte; Z_BYTE += len_byte;
1207 GPT += len; GPT_BYTE += len_byte; 1207 GPT += len; GPT_BYTE += len_byte;
1208 if (GAP_SIZE > 0) *(GPT_ADDR) = 0; /* Put an anchor. */ 1208 if (GAP_SIZE > 0) *(GPT_ADDR) = 0; /* Put an anchor. */
1209 1209
1210 if (nchars_del > 0) 1210 if (nchars_del > 0)
1211 adjust_markers_for_replace (from, from_byte, nchars_del, nbytes_del, 1211 adjust_markers_for_replace (from, from_byte, nchars_del, nbytes_del,
@@ -1228,7 +1228,7 @@ adjust_after_replace (ptrdiff_t from, ptrdiff_t from_byte,
1228 if (from < PT) 1228 if (from < PT)
1229 adjust_point (len - nchars_del, len_byte - nbytes_del); 1229 adjust_point (len - nchars_del, len_byte - nbytes_del);
1230 1230
1231 /* As byte combining will decrease Z, we must check this again. */ 1231 /* As byte combining will decrease Z, we must check this again. */
1232 if (Z - GPT < END_UNCHANGED) 1232 if (Z - GPT < END_UNCHANGED)
1233 END_UNCHANGED = Z - GPT; 1233 END_UNCHANGED = Z - GPT;
1234 1234
@@ -1599,7 +1599,7 @@ del_range_byte (ptrdiff_t from_byte, ptrdiff_t to_byte, bool prepare)
1599{ 1599{
1600 ptrdiff_t from, to; 1600 ptrdiff_t from, to;
1601 1601
1602 /* Make args be valid */ 1602 /* Make args be valid. */
1603 if (from_byte < BEGV_BYTE) 1603 if (from_byte < BEGV_BYTE)
1604 from_byte = BEGV_BYTE; 1604 from_byte = BEGV_BYTE;
1605 if (to_byte > ZV_BYTE) 1605 if (to_byte > ZV_BYTE)
@@ -1681,7 +1681,7 @@ del_range_both (ptrdiff_t from, ptrdiff_t from_byte,
1681/* Delete a range of text, specified both as character positions 1681/* Delete a range of text, specified both as character positions
1682 and byte positions. FROM and TO are character positions, 1682 and byte positions. FROM and TO are character positions,
1683 while FROM_BYTE and TO_BYTE are byte positions. 1683 while FROM_BYTE and TO_BYTE are byte positions.
1684 If RET_STRING, the deleted area is returned as a string. */ 1684 If RET_STRING, the deleted area is returned as a string. */
1685 1685
1686Lisp_Object 1686Lisp_Object
1687del_range_2 (ptrdiff_t from, ptrdiff_t from_byte, 1687del_range_2 (ptrdiff_t from, ptrdiff_t from_byte,