From: Eli Zaretskii Date: Sat, 9 Nov 2013 11:12:33 +0000 (+0200) Subject: Fix bug #15841 with cache-long-scans, linum-mode, and non-ASCII chars. X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~881 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=addccbd0c33c921dbd7bba1678112a0e643eff48;p=emacs.git Fix bug #15841 with cache-long-scans, linum-mode, and non-ASCII chars. src/fileio.c (Finsert_file_contents): Invalidate the newline cache for the entire range of inserted characters. --- diff --git a/src/ChangeLog b/src/ChangeLog index 59a43d9a391..587b97ecd1f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2013-11-09 Eli Zaretskii + + * fileio.c (Finsert_file_contents): Invalidate the newline cache + for the entire range of inserted characters. (Bug#15841) + 2013-11-08 Jan Djärv * xfaces.c (lface_fully_specified_p): Let distant-foreground be diff --git a/src/fileio.c b/src/fileio.c index d42b3811d76..2c90d2e3c76 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -49,6 +49,7 @@ along with GNU Emacs. If not, see . */ #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);