From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Weird behaviour in current Emacs master Date: Fri, 18 Apr 2014 22:10:33 +0300 Message-ID: <83mwfih2s6.fsf@gnu.org> References: <87k3amqxge.fsf@nautilus.nautilus> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Trace: ger.gmane.org 1397848246 6042 80.91.229.3 (18 Apr 2014 19:10:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 18 Apr 2014 19:10:46 +0000 (UTC) Cc: emacs-devel@gnu.org To: Lele Gaifax Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Apr 18 21:10:37 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WbEBH-0003DB-J8 for ged-emacs-devel@m.gmane.org; Fri, 18 Apr 2014 21:10:35 +0200 Original-Received: from localhost ([::1]:39410 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WbEBG-0004dH-T0 for ged-emacs-devel@m.gmane.org; Fri, 18 Apr 2014 15:10:34 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41024) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WbEB6-0004d8-QO for emacs-devel@gnu.org; Fri, 18 Apr 2014 15:10:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WbEB1-0002Mq-3Y for emacs-devel@gnu.org; Fri, 18 Apr 2014 15:10:24 -0400 Original-Received: from mtaout24.012.net.il ([80.179.55.180]:38674) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WbEB0-0002Mg-ME for emacs-devel@gnu.org; Fri, 18 Apr 2014 15:10:19 -0400 Original-Received: from conversion-daemon.mtaout24.012.net.il by mtaout24.012.net.il (HyperSendmail v2007.08) id <0N4800900QCWDP00@mtaout24.012.net.il> for emacs-devel@gnu.org; Fri, 18 Apr 2014 22:08:28 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout24.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N4800OK9QI4JH90@mtaout24.012.net.il>; Fri, 18 Apr 2014 22:08:28 +0300 (IDT) In-reply-to: <87k3amqxge.fsf@nautilus.nautilus> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 80.179.55.180 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:171492 Archived-At: > From: Lele Gaifax > Date: Fri, 18 Apr 2014 20:55:29 +0200 >=20 > commit 00cbdba426ab08964ee8eae14a890945df33b595 > Author: Eli Zaretskii > Date: Mon Apr 14 18:32:27 2014 +0300 >=20 > Fix bidirectional redisplay when deletion creates a paragra= ph start. >=20 > src/insdel.c (invalidate_buffer_caches): When deleting or = replacing > text, invalidate the bidi_paragraph_cache upto and includi= ng the > preceding newline. That commit was fixed by a later one, see the patch at the end of thi= s 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. =3D=3D=3D modified file 'src/insdel.c' --- src/insdel.c=092014-04-14 15:32:27 +0000 +++ src/insdel.c=092014-04-17 07:24:40 +0000 @@ -1857,14 +1857,9 @@ invalidate_buffer_caches (struct buffer=20 need to consider the caches of their base buffer. */ if (buf->base_buffer) buf =3D buf->base_buffer; - if (buf->newline_cache) - invalidate_region_cache (buf, - buf->newline_cache, - start - BUF_BEG (buf), BUF_Z (buf) - en= d); - if (buf->width_run_cache) - invalidate_region_cache (buf, - buf->width_run_cache, - start - BUF_BEG (buf), BUF_Z (buf) - en= d); + /* The bidi_paragraph_cache must be invalidated first, because doi= ng + so might need to use the newline_cache (via find_newline_no_qui= t, + see below). */ if (buf->bidi_paragraph_cache) { if (start !=3D end @@ -1888,13 +1883,20 @@ invalidate_buffer_caches (struct buffer=20 =09=09=09=09=09 &start_byte); =09 set_buffer_internal (old); =09 } -=09 if (line_beg > BUF_BEG (buf)) -=09 start =3D line_beg - 1; +=09 start =3D line_beg - (line_beg > BUF_BEG (buf)); =09} invalidate_region_cache (buf, =09=09=09 buf->bidi_paragraph_cache, =09=09=09 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) - en= d); + if (buf->width_run_cache) + invalidate_region_cache (buf, + buf->width_run_cache, + start - BUF_BEG (buf), BUF_Z (buf) - en= d); } =20 /* These macros work with an argument named `preserve_ptr' >=20 > The buffer is in html-mode major mode, and this is the list of acti= vated > minor modes: >=20 > Enabled minor modes: Auto-Composition Auto-Compression > Auto-Encryption Auto-Fill Auto-Insert Column-Number Electric-In= dent > 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-Glo= bal >=20 > Apparently, neither html-mode nor hl-line-mode are involved, becaus= e the > problem happens also in fundamental-mode with the latter minor disa= bled. >=20 > Is there anything I can do to help you understand what's going wron= g? I > could try "bisecting" the activation of all those minor modes... bu= t > maybe you have some better hint on how to proceed. >=20 > Thank you in advance for any advice, > ciao, lele. > --=20 > nickname: Lele Gaifax | Quando vivr=C3=B2 di quello che ho pensato = ieri > real: Emanuele Gaifas | comincer=C3=B2 ad aver paura di chi mi copi= a. > lele@metapensiero.it | -- Fortunato Depero, 1929. >=20 >=20 >=20