unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Lele Gaifax <lele@metapensiero.it>
Cc: emacs-devel@gnu.org
Subject: Re: Weird behaviour in current Emacs master
Date: Fri, 18 Apr 2014 22:10:33 +0300	[thread overview]
Message-ID: <83mwfih2s6.fsf@gnu.org> (raw)
In-Reply-To: <87k3amqxge.fsf@nautilus.nautilus>

> From: Lele Gaifax <lele@metapensiero.it>
> Date: Fri, 18 Apr 2014 20:55:29 +0200
> 
>     commit 00cbdba426ab08964ee8eae14a890945df33b595
>     Author: Eli Zaretskii <eliz@gnu.org>
>     Date:   Mon Apr 14 18:32:27 2014 +0300
> 
>         Fix bidirectional redisplay when deletion creates a paragraph start.
> 
>          src/insdel.c (invalidate_buffer_caches): When deleting or replacing
>          text, invalidate the bidi_paragraph_cache upto and including the
>          preceding newline.

That commit was fixed by a later one, see the patch at the end of this
message.  But that fix was not yet merged to the trunk.  So either
apply the patch below by hand, or switch to the emacs-24 branch, or
wait for the fix to be merged to the trunk.

=== 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'



> 
> The buffer is in html-mode major mode, and this is the list of activated
> minor modes:
> 
>     Enabled minor modes: Auto-Composition Auto-Compression
>     Auto-Encryption Auto-Fill Auto-Insert Column-Number Electric-Indent
>     Electric-Pair File-Name-Shadow Flyspell Font-Lock
>     Global-Auto-Complete Global-Font-Lock Hl-Line Jabber-Activity
>     Line-Number Mouse-Wheel Shell-Dirtrack Show-Paren Subword
>     Transient-Mark Whitespace Whitespace-Cleanup Winner Yas Yas-Global
> 
> Apparently, neither html-mode nor hl-line-mode are involved, because the
> problem happens also in fundamental-mode with the latter minor disabled.
> 
> Is there anything I can do to help you understand what's going wrong? I
> could try "bisecting" the activation of all those minor modes... but
> maybe you have some better hint on how to proceed.
> 
> Thank you in advance for any advice,
> ciao, lele.
> -- 
> nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
> real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
> lele@metapensiero.it  |                 -- Fortunato Depero, 1929.
> 
> 
> 




  reply	other threads:[~2014-04-18 19:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-18 18:55 Weird behaviour in current Emacs master Lele Gaifax
2014-04-18 19:10 ` Eli Zaretskii [this message]
2014-04-18 21:10   ` Lele Gaifax

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=83mwfih2s6.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=lele@metapensiero.it \
    /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).