[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/src/insdel.c
From: |
Kenichi Handa |
Subject: |
[Emacs-diffs] Changes to emacs/src/insdel.c |
Date: |
Thu, 28 Feb 2002 20:42:42 -0500 |
Index: emacs/src/insdel.c
diff -c emacs/src/insdel.c:1.165 emacs/src/insdel.c:1.166
*** emacs/src/insdel.c:1.165 Fri Jan 11 16:28:23 2002
--- emacs/src/insdel.c Sat Feb 9 17:57:25 2002
***************
*** 584,590 ****
int real_gap_loc_byte;
int real_Z;
int real_Z_byte;
! int old_gap_size;
/* Make sure the gap is at least 20 bytes. */
if (GAP_SIZE - nbytes_removed < 20)
--- 584,591 ----
int real_gap_loc_byte;
int real_Z;
int real_Z_byte;
! int real_beg_unchanged;
! int new_gap_size;
/* Make sure the gap is at least 20 bytes. */
if (GAP_SIZE - nbytes_removed < 20)
***************
*** 596,613 ****
real_gap_loc = GPT;
real_gap_loc_byte = GPT_BYTE;
! old_gap_size = GAP_SIZE;
real_Z = Z;
real_Z_byte = Z_BYTE;
/* Pretend that the last unwanted part of the gap is the entire gap,
and that the first desired part of the gap is part of the buffer
text. */
! bzero (GPT_ADDR, GAP_SIZE - nbytes_removed);
! GPT += GAP_SIZE - nbytes_removed;
! GPT_BYTE += GAP_SIZE - nbytes_removed;
! Z += GAP_SIZE - nbytes_removed;
! Z_BYTE += GAP_SIZE - nbytes_removed;
GAP_SIZE = nbytes_removed;
/* Move the unwanted pretend gap to the end of the buffer. This
--- 597,615 ----
real_gap_loc = GPT;
real_gap_loc_byte = GPT_BYTE;
! new_gap_size = GAP_SIZE - nbytes_removed;
real_Z = Z;
real_Z_byte = Z_BYTE;
+ real_beg_unchanged = BEG_UNCHANGED;
/* Pretend that the last unwanted part of the gap is the entire gap,
and that the first desired part of the gap is part of the buffer
text. */
! bzero (GPT_ADDR, new_gap_size);
! GPT += new_gap_size;
! GPT_BYTE += new_gap_size;
! Z += new_gap_size;
! Z_BYTE += new_gap_size;
GAP_SIZE = nbytes_removed;
/* Move the unwanted pretend gap to the end of the buffer. This
***************
*** 617,627 ****
enlarge_buffer_text (current_buffer, -nbytes_removed);
/* Now restore the desired gap. */
! GAP_SIZE = old_gap_size - nbytes_removed;
GPT = real_gap_loc;
GPT_BYTE = real_gap_loc_byte;
Z = real_Z;
Z_BYTE = real_Z_byte;
/* Put an anchor. */
*(Z_ADDR) = 0;
--- 619,630 ----
enlarge_buffer_text (current_buffer, -nbytes_removed);
/* Now restore the desired gap. */
! GAP_SIZE = new_gap_size;
GPT = real_gap_loc;
GPT_BYTE = real_gap_loc_byte;
Z = real_Z;
Z_BYTE = real_Z_byte;
+ BEG_UNCHANGED = real_beg_unchanged;
/* Put an anchor. */
*(Z_ADDR) = 0;