GNU bug report logs - #17279
24.4.50; dired buffer slightly scrambled

Previous Next

Package: emacs;

Reported by: Ushnish Basu <ubasu <at> cal.berkeley.edu>

Date: Thu, 17 Apr 2014 00:43:01 UTC

Severity: normal

Found in version 24.4.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #17 received at 17279 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: ubasu <at> cal.berkeley.edu
Cc: 17279 <at> debbugs.gnu.org
Subject: Re: bug#17279: 24.4.50; dired buffer slightly scrambled
Date: Thu, 17 Apr 2014 10:32:28 +0300
> Date: Thu, 17 Apr 2014 08:49:25 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
> Cc: 17279 <at> debbugs.gnu.org
> 
> > Date: Wed, 16 Apr 2014 22:41:14 -0700
> > From: Ushnish Basu <ubasu <at> cal.berkeley.edu>
> > CC: 17279 <at> debbugs.gnu.org
> > 
> > Yes, it does - thanks for the tip.
> 
> Then I guess it's another duplicate of 17269.

Please try the patch below, which I've just committed to the emacs-24
branch:

=== modified file 'src/insdel.c'
--- src/insdel.c	2014-04-14 15:32:27 +0000
+++ src/insdel.c	2014-04-17 07:24:40 +0000
@@ -1857,14 +1857,9 @@ invalidate_buffer_caches (struct buffer 
      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 @@ invalidate_buffer_caches (struct buffer 
 					       &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'





This bug report was last modified 11 years and 38 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.