/[emacs]/emacs/src/insdel.c
ViewVC logotype

Diff of /emacs/src/insdel.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.165 by rms, Fri Jan 11 21:28:23 2002 UTC revision 1.166 by kfstorm, Sat Feb 9 22:57:25 2002 UTC
# Line 584  make_gap_smaller (nbytes_removed) Line 584  make_gap_smaller (nbytes_removed)
584    int real_gap_loc_byte;    int real_gap_loc_byte;
585    int real_Z;    int real_Z;
586    int real_Z_byte;    int real_Z_byte;
587    int old_gap_size;    int real_beg_unchanged;
588      int new_gap_size;
589    
590    /* Make sure the gap is at least 20 bytes.  */    /* Make sure the gap is at least 20 bytes.  */
591    if (GAP_SIZE - nbytes_removed < 20)    if (GAP_SIZE - nbytes_removed < 20)
# Line 596  make_gap_smaller (nbytes_removed) Line 597  make_gap_smaller (nbytes_removed)
597    
598    real_gap_loc = GPT;    real_gap_loc = GPT;
599    real_gap_loc_byte = GPT_BYTE;    real_gap_loc_byte = GPT_BYTE;
600    old_gap_size = GAP_SIZE;    new_gap_size = GAP_SIZE - nbytes_removed;
601    real_Z = Z;    real_Z = Z;
602    real_Z_byte = Z_BYTE;    real_Z_byte = Z_BYTE;
603      real_beg_unchanged = BEG_UNCHANGED;
604    
605    /* Pretend that the last unwanted part of the gap is the entire gap,    /* Pretend that the last unwanted part of the gap is the entire gap,
606       and that the first desired part of the gap is part of the buffer       and that the first desired part of the gap is part of the buffer
607       text.  */       text.  */
608    bzero (GPT_ADDR, GAP_SIZE - nbytes_removed);    bzero (GPT_ADDR, new_gap_size);
609    GPT += GAP_SIZE - nbytes_removed;    GPT += new_gap_size;
610    GPT_BYTE += GAP_SIZE - nbytes_removed;    GPT_BYTE += new_gap_size;
611    Z += GAP_SIZE - nbytes_removed;    Z += new_gap_size;
612    Z_BYTE += GAP_SIZE - nbytes_removed;    Z_BYTE += new_gap_size;
613    GAP_SIZE = nbytes_removed;    GAP_SIZE = nbytes_removed;
614    
615    /* Move the unwanted pretend gap to the end of the buffer.  This    /* Move the unwanted pretend gap to the end of the buffer.  This
# Line 617  make_gap_smaller (nbytes_removed) Line 619  make_gap_smaller (nbytes_removed)
619    enlarge_buffer_text (current_buffer, -nbytes_removed);    enlarge_buffer_text (current_buffer, -nbytes_removed);
620    
621    /* Now restore the desired gap.  */    /* Now restore the desired gap.  */
622    GAP_SIZE = old_gap_size - nbytes_removed;    GAP_SIZE = new_gap_size;
623    GPT = real_gap_loc;    GPT = real_gap_loc;
624    GPT_BYTE = real_gap_loc_byte;    GPT_BYTE = real_gap_loc_byte;
625    Z = real_Z;    Z = real_Z;
626    Z_BYTE = real_Z_byte;    Z_BYTE = real_Z_byte;
627      BEG_UNCHANGED = real_beg_unchanged;
628    
629    /* Put an anchor.  */    /* Put an anchor.  */
630    *(Z_ADDR) = 0;    *(Z_ADDR) = 0;

Legend:
Removed from v.1.165  
changed lines
  Added in v.1.166

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26