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: BUG: Emacs crashes due to org-mode parameter org-indent-mode Date: Fri, 23 Dec 2011 16:57:36 +0200 Message-ID: <83wr9nxrmn.fsf@gnu.org> References: <8339cbzogq.fsf@gnu.org> <831urvzixf.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Trace: dough.gmane.org 1324652270 10569 80.91.229.12 (23 Dec 2011 14:57:50 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 23 Dec 2011 14:57:50 +0000 (UTC) Cc: emacs-devel@gnu.org To: gustav.erik@gmail.com Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 23 15:57:46 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Re6Z7-0001uc-WD for ged-emacs-devel@m.gmane.org; Fri, 23 Dec 2011 15:57:46 +0100 Original-Received: from localhost ([::1]:59310 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Re6Z7-0004x7-MI for ged-emacs-devel@m.gmane.org; Fri, 23 Dec 2011 09:57:45 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:46716) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Re6Z1-0004fb-KG for emacs-devel@gnu.org; Fri, 23 Dec 2011 09:57:43 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Re6Z0-0007b5-FW for emacs-devel@gnu.org; Fri, 23 Dec 2011 09:57:39 -0500 Original-Received: from mtaout21.012.net.il ([80.179.55.169]:42432) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Re6Z0-0007b1-7z for emacs-devel@gnu.org; Fri, 23 Dec 2011 09:57:38 -0500 Original-Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0LWN00J00VIRA600@a-mtaout21.012.net.il> for emacs-devel@gnu.org; Fri, 23 Dec 2011 16:57:36 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([84.229.233.41]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LWN00JN5W7Z0TB0@a-mtaout21.012.net.il>; Fri, 23 Dec 2011 16:57:36 +0200 (IST) In-reply-to: <831urvzixf.fsf@gnu.org> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 80.179.55.169 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:146948 Archived-At: > Date: Fri, 23 Dec 2011 12:22:36 +0200 > From: Eli Zaretskii > Cc: emacs-devel@gnu.org >=20 > > Date: Fri, 23 Dec 2011 09:37:08 +0100 > > From: Gustav Wikstr=F6m > > Cc: emacs-devel@gnu.org > >=20 > > Missed one step in the reproduce-description, see now. > > [...] > > > > - Start emacs without any initial settings (runemacs.exe -q) > > > > - Open an org-mode file > > > > - M-x org-indent-mode > > > > - C-c C-x b on a heading in the file > > > > >=20 > > - C-x 0 (close the direct buffer to make the indirect buffer the = default > > one) > >=20 > >=20 > > > > - tab >=20 > OK, now I can reproduce this, thanks. It's a display-related bug, = I > will look into it. Fixed in revision 106726 on the trunk. If you can build your own Emacs, the patch is below. I saw no bug report yet, but when I see it, I will close it with this information. Thanks. =3D=3D=3D modified file 'src/xdisp.c' --- src/xdisp.c=092011-12-10 19:54:45 +0000 +++ src/xdisp.c=092011-12-23 14:51:51 +0000 @@ -4090,10 +4090,11 @@ handle_invisible_prop (struct it *it) =09 while (invis_p); =20 =09 /* The position newpos is now either ZV or on visible text. */ -=09 if (it->bidi_p && newpos < ZV) +=09 if (it->bidi_p) =09 { =09 EMACS_INT bpos =3D CHAR_TO_BYTE (newpos); -=09 int on_newline =3D FETCH_BYTE (bpos) =3D=3D '\n'; +=09 int on_newline =3D +=09=09bpos =3D=3D ZV_BYTE || FETCH_BYTE (bpos) =3D=3D '\n'; =09 int after_newline =3D =09=09newpos <=3D BEGV || FETCH_BYTE (bpos - 1) =3D=3D '\n'; =20 @@ -4111,16 +4112,16 @@ handle_invisible_prop (struct it *it) =20 =09=09 SET_TEXT_POS (tpos, newpos, bpos); =09=09 reseat_1 (it, tpos, 0); -=09=09 /* If we reseat on a newline, we need to prep the +=09=09 /* If we reseat on a newline/ZV, we need to prep the =09=09 bidi iterator for advancing to the next character -=09=09 after the newline, keeping the current paragraph +=09=09 after the newline/EOB, keeping the current paragraph =09=09 direction (so that PRODUCE_GLYPHS does TRT wrt =09=09 prepending/appending glyphs to a glyph row). */ =09=09 if (on_newline) =09=09 { =09=09 it->bidi_it.first_elt =3D 0; =09=09 it->bidi_it.paragraph_dir =3D pdir; -=09=09 it->bidi_it.ch =3D '\n'; +=09=09 it->bidi_it.ch =3D (bpos =3D=3D ZV_BYTE) ? -1 : '\n'; =09=09 it->bidi_it.nchars =3D 1; =09=09 it->bidi_it.ch_len =3D 1; =09=09 }