]> code.delx.au - gnu-emacs/blobdiff - src/insdel.c
Don't install keyboard hook when debugged on MS-Windows
[gnu-emacs] / src / insdel.c
index f0a4dcd784e7d8827632c59b9040cbcf5e25fb50..4ad1074f5f79bf94e7c47f72f92b5aa0132bcd5e 100644 (file)
@@ -6,8 +6,8 @@ This file is part of GNU Emacs.
 
 GNU Emacs is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
+the Free Software Foundation, either version 3 of the License, or (at
+your option) any later version.
 
 GNU Emacs is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -126,7 +126,10 @@ gap_left (ptrdiff_t charpos, ptrdiff_t bytepos, bool newgap)
       if (i == 0)
        break;
       /* If a quit is requested, stop copying now.
-        Change BYTEPOS to be where we have actually moved the gap to.  */
+        Change BYTEPOS to be where we have actually moved the gap to.
+        Note that this cannot happen when we are called to make the
+        gap larger or smaller, since make_gap_larger and
+        make_gap_smaller prevent QUIT by setting inhibit-quit.  */
       if (QUITP)
        {
          bytepos = new_s1;
@@ -179,7 +182,10 @@ gap_right (ptrdiff_t charpos, ptrdiff_t bytepos)
       if (i == 0)
        break;
       /* If a quit is requested, stop copying now.
-        Change BYTEPOS to be where we have actually moved the gap to.  */
+        Change BYTEPOS to be where we have actually moved the gap to.
+        Note that this cannot happen when we are called to make the
+        gap larger or smaller, since make_gap_larger and
+        make_gap_smaller prevent QUIT by setting inhibit-quit.  */
       if (QUITP)
        {
          bytepos = new_s1;
@@ -386,7 +392,9 @@ make_gap_larger (ptrdiff_t nbytes_added)
 
   enlarge_buffer_text (current_buffer, nbytes_added);
 
-  /* Prevent quitting in move_gap.  */
+  /* Prevent quitting in gap_left.  We cannot allow a QUIT there,
+     because that would leave the buffer text in an inconsistent
+     state, with 2 gap holes instead of just one.  */
   tem = Vinhibit_quit;
   Vinhibit_quit = Qt;
 
@@ -432,7 +440,9 @@ make_gap_smaller (ptrdiff_t nbytes_removed)
   if (GAP_SIZE - nbytes_removed < GAP_BYTES_MIN)
     nbytes_removed = GAP_SIZE - GAP_BYTES_MIN;
 
-  /* Prevent quitting in move_gap.  */
+  /* Prevent quitting in gap_right.  We cannot allow a QUIT there,
+     because that would leave the buffer text in an inconsistent
+     state, with 2 gap holes instead of just one.  */
   tem = Vinhibit_quit;
   Vinhibit_quit = Qt;