unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: ubasu@cal.berkeley.edu
Cc: 17279@debbugs.gnu.org
Subject: bug#17279: 24.4.50; dired buffer slightly scrambled
Date: Thu, 17 Apr 2014 10:32:28 +0300	[thread overview]
Message-ID: <83zjjkif77.fsf@gnu.org> (raw)
In-Reply-To: <8361m8jyje.fsf@gnu.org>

> Date: Thu, 17 Apr 2014 08:49:25 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: 17279@debbugs.gnu.org
> 
> > Date: Wed, 16 Apr 2014 22:41:14 -0700
> > From: Ushnish Basu <ubasu@cal.berkeley.edu>
> > CC: 17279@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'






  reply	other threads:[~2014-04-17  7:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-17  0:42 bug#17279: 24.4.50; dired buffer slightly scrambled Ushnish Basu
2014-04-17  5:35 ` Eli Zaretskii
2014-04-17  5:41   ` Ushnish Basu
2014-04-17  5:49     ` Eli Zaretskii
2014-04-17  7:32       ` Eli Zaretskii [this message]
2014-04-17 16:49         ` Ushnish Basu
2014-04-17 17:40           ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83zjjkif77.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=17279@debbugs.gnu.org \
    --cc=ubasu@cal.berkeley.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).