]> code.delx.au - gnu-emacs/commitdiff
Fix bug #18982 with assertion violations when reverting buffers.
authorEli Zaretskii <eliz@gnu.org>
Sun, 9 Nov 2014 16:40:43 +0000 (18:40 +0200)
committerEli Zaretskii <eliz@gnu.org>
Sun, 9 Nov 2014 16:40:43 +0000 (18:40 +0200)
 src/fileio.c (Finsert_file_contents): Invalidate buffer caches also
 when the inserted text does not need decoding.

src/ChangeLog
src/fileio.c

index c03218c21f99053b6e77c578d7585053f2db17c0..719ccec467da252094947cf06e418a1f43b80469 100644 (file)
@@ -1,5 +1,8 @@
 2014-11-09  Eli Zaretskii  <eliz@gnu.org>
 
+       * fileio.c (Finsert_file_contents): Invalidate buffer caches also
+       when the inserted text does not need decoding.  (Bug#18982)
+
        * w32heap.c (allocate_heap): Set the lower limit of heap at 8MB.
        (Bug#18995)
 
index fba64010b54b58a11f89b6f36322e8e915c07ed6..8570a1604a33e97e6138539d609e8f16efe09a47 100644 (file)
@@ -4308,8 +4308,11 @@ by calling `format-decode', which see.  */)
       coding_system = CODING_ID_NAME (coding.id);
     }
   else if (inserted > 0)
-    adjust_after_insert (PT, PT_BYTE, PT + inserted, PT_BYTE + inserted,
-                        inserted);
+    {
+      invalidate_buffer_caches (current_buffer, PT, PT + inserted);
+      adjust_after_insert (PT, PT_BYTE, PT + inserted, PT_BYTE + inserted,
+                          inserted);
+    }
 
   /* Call after-change hooks for the inserted text, aside from the case
      of normal visiting (not with REPLACE), which is done in a new buffer