]> git.eshelyaron.com Git - emacs.git/commitdiff
(insert_from_buffer_1): Adjust FROM position by number
authorGerd Moellmann <gerd@gnu.org>
Thu, 4 May 2000 21:45:40 +0000 (21:45 +0000)
committerGerd Moellmann <gerd@gnu.org>
Thu, 4 May 2000 21:45:40 +0000 (21:45 +0000)
of inserted characters when BUF equals the current buffer, and PT
is in front of or equal to FROM.

src/insdel.c

index 9facec4cf34a301a0236ff578da0a4421629e5f1..06e638526bccd0b95576c2f8b6ef0bf24b26c76d 100644 (file)
@@ -1546,7 +1546,11 @@ insert_from_buffer_1 (buf, from, nchars, inherit)
      not including the combined-before bytes.  */
   intervals = BUF_INTERVALS (buf);
   if (outgoing_nbytes < BUF_Z_BYTE (buf) - BUF_BEG_BYTE (buf))
-    intervals = copy_intervals (intervals, from, nchars);
+    {
+      if (buf == current_buffer && PT <= from)
+       from += nchars;
+      intervals = copy_intervals (intervals, from, nchars);
+    }
                               
   /* Insert those intervals.  */
   graft_intervals_into_buffer (intervals, PT, nchars, current_buffer, inherit);