From: Stefan Monnier Date: Thu, 14 Feb 2008 19:41:43 +0000 (+0000) Subject: (Finsert_file_contents): Adjust offsets when replacing X-Git-Tag: emacs-pretest-23.0.90~7943 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7f5d2c72415a8de8f23c24e1a0a09ec6234a278c;p=emacs.git (Finsert_file_contents): Adjust offsets when replacing within a narrowed buffer. --- diff --git a/src/ChangeLog b/src/ChangeLog index 2cf4120f51e..38d891bc8ba 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2008-02-14 Stefan Monnier + + * fileio.c (Finsert_file_contents): Adjust offsets when replacing + within a narrowed buffer. + 2008-02-14 Kenichi Handa * coding.c (decode_coding_object, encode_coding_object): diff --git a/src/fileio.c b/src/fileio.c index 9095cc45878..269dd33455e 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -4338,10 +4338,12 @@ variable `last-coding-system-used' to the coding system actually used. */) SET_PT_BOTH (temp, same_at_start); same_at_start_charpos = buf_bytepos_to_charpos (XBUFFER (conversion_buffer), - same_at_start); + same_at_start - BEGV_BYTE + + BUF_BEG_BYTE (XBUFFER (conversion_buffer))); inserted_chars = (buf_bytepos_to_charpos (XBUFFER (conversion_buffer), - same_at_start + inserted) + same_at_start + inserted - BEGV_BYTE + + BUF_BEG_BYTE (XBUFFER (conversion_buffer))) - same_at_start_charpos); /* This binding is to avoid ask-user-about-supersession-threat being called in insert_from_buffer (via in