From: Gerd Moellmann Date: Thu, 4 May 2000 21:45:40 +0000 (+0000) Subject: (insert_from_buffer_1): Adjust FROM position by number X-Git-Tag: emacs-pretest-21.0.90~4047 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=06d8227a86b9cb00e2657c418992f14766aa02b3;p=emacs.git (insert_from_buffer_1): Adjust FROM position by number of inserted characters when BUF equals the current buffer, and PT is in front of or equal to FROM. --- diff --git a/src/insdel.c b/src/insdel.c index 9facec4cf34..06e638526bc 100644 --- a/src/insdel.c +++ b/src/insdel.c @@ -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);