emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-24 r116974: Fix bug #17269 with corruption of the ne


From: Eli Zaretskii
Subject: [Emacs-diffs] emacs-24 r116974: Fix bug #17269 with corruption of the newline cache.
Date: Thu, 17 Apr 2014 07:25:57 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 116974
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/17269
committer: Eli Zaretskii <address@hidden>
branch nick: emacs-24
timestamp: Thu 2014-04-17 10:24:40 +0300
message:
  Fix bug #17269 with corruption of the newline cache.
  
   src/insdel.c (invalidate_buffer_caches): Invalidate the bidi
   paragraph-start cache before the newline cache.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/insdel.c                   insdel.c-20091113204419-o5vbwnq5f7feedwu-175
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2014-04-16 14:00:39 +0000
+++ b/src/ChangeLog     2014-04-17 07:24:40 +0000
@@ -1,3 +1,8 @@
+2014-04-17  Eli Zaretskii  <address@hidden>
+
+       * insdel.c (invalidate_buffer_caches): Invalidate the bidi
+       paragraph-start cache before the newline cache.  (Bug#17269)
+
 2014-04-16  Stefan Monnier  <address@hidden>
 
        * window.c (save_window_save): Lookup window_point_insertion_type in

=== modified file 'src/insdel.c'
--- a/src/insdel.c      2014-04-14 15:32:27 +0000
+++ b/src/insdel.c      2014-04-17 07:24:40 +0000
@@ -1857,14 +1857,9 @@
      need to consider the caches of their base buffer.  */
   if (buf->base_buffer)
     buf = buf->base_buffer;
-  if (buf->newline_cache)
-    invalidate_region_cache (buf,
-                             buf->newline_cache,
-                             start - BUF_BEG (buf), BUF_Z (buf) - end);
-  if (buf->width_run_cache)
-    invalidate_region_cache (buf,
-                             buf->width_run_cache,
-                             start - BUF_BEG (buf), BUF_Z (buf) - end);
+  /* The bidi_paragraph_cache must be invalidated first, because doing
+     so might need to use the newline_cache (via find_newline_no_quit,
+     see below).  */
   if (buf->bidi_paragraph_cache)
     {
       if (start != end
@@ -1888,13 +1883,20 @@
                                               &start_byte);
              set_buffer_internal (old);
            }
-         if (line_beg > BUF_BEG (buf))
-           start = line_beg - 1;
+         start = line_beg - (line_beg > BUF_BEG (buf));
        }
       invalidate_region_cache (buf,
                               buf->bidi_paragraph_cache,
                               start - BUF_BEG (buf), BUF_Z (buf) - end);
     }
+  if (buf->newline_cache)
+    invalidate_region_cache (buf,
+                             buf->newline_cache,
+                             start - BUF_BEG (buf), BUF_Z (buf) - end);
+  if (buf->width_run_cache)
+    invalidate_region_cache (buf,
+                             buf->width_run_cache,
+                             start - BUF_BEG (buf), BUF_Z (buf) - end);
 }
 
 /* These macros work with an argument named `preserve_ptr'


reply via email to

[Prev in Thread] Current Thread [Next in Thread]