emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: BUG: Emacs crashes due to org-mode parameter org-indent-mode


From: Eli Zaretskii
Subject: Re: BUG: Emacs crashes due to org-mode parameter org-indent-mode
Date: Fri, 23 Dec 2011 16:57:36 +0200

> Date: Fri, 23 Dec 2011 12:22:36 +0200
> From: Eli Zaretskii <address@hidden>
> Cc: address@hidden
> 
> > Date: Fri, 23 Dec 2011 09:37:08 +0100
> > From: Gustav Wikström <address@hidden>
> > Cc: address@hidden
> > 
> > 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
> > >
> > 
> > - C-x 0 (close the direct buffer to make the indirect buffer the default
> > one)
> > 
> > 
> > > > - tab
> 
> 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.

=== modified file 'src/xdisp.c'
--- src/xdisp.c 2011-12-10 19:54:45 +0000
+++ src/xdisp.c 2011-12-23 14:51:51 +0000
@@ -4090,10 +4090,11 @@ handle_invisible_prop (struct it *it)
          while (invis_p);
 
          /* The position newpos is now either ZV or on visible text.  */
-         if (it->bidi_p && newpos < ZV)
+         if (it->bidi_p)
            {
              EMACS_INT bpos = CHAR_TO_BYTE (newpos);
-             int on_newline = FETCH_BYTE (bpos) == '\n';
+             int on_newline =
+               bpos == ZV_BYTE || FETCH_BYTE (bpos) == '\n';
              int after_newline =
                newpos <= BEGV || FETCH_BYTE (bpos - 1) == '\n';
 
@@ -4111,16 +4112,16 @@ handle_invisible_prop (struct it *it)
 
                  SET_TEXT_POS (tpos, newpos, bpos);
                  reseat_1 (it, tpos, 0);
-                 /* If we reseat on a newline, we need to prep the
+                 /* If we reseat on a newline/ZV, we need to prep the
                     bidi iterator for advancing to the next character
-                    after the newline, keeping the current paragraph
+                    after the newline/EOB, keeping the current paragraph
                     direction (so that PRODUCE_GLYPHS does TRT wrt
                     prepending/appending glyphs to a glyph row).  */
                  if (on_newline)
                    {
                      it->bidi_it.first_elt = 0;
                      it->bidi_it.paragraph_dir = pdir;
-                     it->bidi_it.ch = '\n';
+                     it->bidi_it.ch = (bpos == ZV_BYTE) ? -1 : '\n';
                      it->bidi_it.nchars = 1;
                      it->bidi_it.ch_len = 1;
                    }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]