]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix bug #15841 with cache-long-scans, linum-mode, and non-ASCII chars.
authorEli Zaretskii <eliz@gnu.org>
Sat, 9 Nov 2013 11:12:33 +0000 (13:12 +0200)
committerEli Zaretskii <eliz@gnu.org>
Sat, 9 Nov 2013 11:12:33 +0000 (13:12 +0200)
 src/fileio.c (Finsert_file_contents): Invalidate the newline cache
 for the entire range of inserted characters.

src/ChangeLog
src/fileio.c

index 59a43d9a391c0204c7f4184d9138f092f24d5982..587b97ecd1fb53e07f1a175441258300c39e67cf 100644 (file)
@@ -1,3 +1,8 @@
+2013-11-09  Eli Zaretskii  <eliz@gnu.org>
+
+       * fileio.c (Finsert_file_contents): Invalidate the newline cache
+       for the entire range of inserted characters.  (Bug#15841)
+
 2013-11-08  Jan Djärv  <jan.h.d@swipnet.se>
 
        * xfaces.c (lface_fully_specified_p): Let distant-foreground be
index d42b3811d76d557e1b34ee386bb38b8a79498e22..2c90d2e3c76a0cf9af9e2f985a559d7eaa81b519 100644 (file)
@@ -49,6 +49,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "coding.h"
 #include "window.h"
 #include "blockinput.h"
+#include "region-cache.h"
 #include "frame.h"
 #include "dispextern.h"
 
@@ -4476,6 +4477,14 @@ by calling `format-decode', which see.  */)
       report_file_errno ("Opening input file", orig_filename, save_errno);
     }
 
+  /* We made a lot of deletions and insertions above, so invalidate
+     the newline cache for the entire region of the inserted
+     characters.  */
+  if (current_buffer->newline_cache)
+    invalidate_region_cache (current_buffer,
+                             current_buffer->newline_cache,
+                             PT - BEG, Z - PT - inserted);
+
   if (read_quit)
     Fsignal (Qquit, Qnil);