emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r115259: Fix bug #15973 with erratic cursor motion a


From: Eli Zaretskii
Subject: [Emacs-diffs] trunk r115259: Fix bug #15973 with erratic cursor motion after reverting a buffer.
Date: Wed, 27 Nov 2013 16:09:37 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 115259
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/15973
committer: Eli Zaretskii <address@hidden>
branch nick: trunk
timestamp: Wed 2013-11-27 18:08:53 +0200
message:
  Fix bug #15973 with erratic cursor motion after reverting a buffer.
  
   src/fileio.c (Finsert_file_contents): Invalidate buffer caches when
   deleting portions of the buffer under non-nil REPLACE argument.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/fileio.c                   fileio.c-20091113204419-o5vbwnq5f7feedwu-210
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2013-11-27 16:03:02 +0000
+++ b/src/ChangeLog     2013-11-27 16:08:53 +0000
@@ -1,5 +1,9 @@
 2013-11-27  Eli Zaretskii  <address@hidden>
 
+       * fileio.c (Finsert_file_contents): Invalidate buffer caches when
+       deleting portions of the buffer under non-nil REPLACE argument.
+       (Bug#15973)
+
        * w32notify.c (Fw32notify_add_watch): If the argument FILE is a
        directory, watch it and not its parent.
        (add_watch): Allow empty string in FILE.

=== modified file 'src/fileio.c'
--- a/src/fileio.c      2013-11-23 11:32:05 +0000
+++ b/src/fileio.c      2013-11-27 16:08:53 +0000
@@ -3858,6 +3858,9 @@
          beg_offset += same_at_start - BEGV_BYTE;
          end_offset -= ZV_BYTE - same_at_end;
 
+         invalidate_buffer_caches (current_buffer,
+                                   BYTE_TO_CHAR (same_at_start),
+                                   BYTE_TO_CHAR (same_at_end));
          del_range_byte (same_at_start, same_at_end, 0);
          /* Insert from the file at the proper position.  */
          temp = BYTE_TO_CHAR (same_at_start);
@@ -3968,7 +3971,12 @@
        {
          /* Truncate the buffer to the size of the file.  */
          if (same_at_start != same_at_end)
-           del_range_byte (same_at_start, same_at_end, 0);
+           {
+             invalidate_buffer_caches (current_buffer,
+                                       BYTE_TO_CHAR (same_at_start),
+                                       BYTE_TO_CHAR (same_at_end));
+             del_range_byte (same_at_start, same_at_end, 0);
+           }
          inserted = 0;
 
          unbind_to (this_count, Qnil);
@@ -4016,6 +4024,9 @@
 
       if (same_at_end != same_at_start)
        {
+         invalidate_buffer_caches (current_buffer,
+                                   BYTE_TO_CHAR (same_at_start),
+                                   BYTE_TO_CHAR (same_at_end));
          del_range_byte (same_at_start, same_at_end, 0);
          temp = GPT;
          eassert (same_at_start == GPT_BYTE);


reply via email to

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