Subject: bug#6998: 24.0.50; bidi: lines starting with neutral types have the wrong base direction?

From: Eli Zaretskii <[email-masked]>
Date: Wed, 22 Sep 2010 10:51:05 +0200

> Date: Wed, 22 Sep 2010 05:58:25 +0300
> From: Thamer Mahmoud <[email-masked]>
> Cc: [email-masked]
> 
> Note that both the crash and the bug (mentioned further below) were
> not reproducible on a virtual Windows XP.

I didn't see the crash yet, but the display bug you mention near the
end of your message is reproducible on my Windows XP box.  Thanks.

> To reproduce this crash:
> 
> 1. Open attached test case with: emacs -Q --eval "(setq-default bidi-display-reordering t)" wrap_crash.org
>    It should open in org-mode by default.
> 
> 2. Emacs _sometimes_ would render it like this:
> 
> * First...
>                            ...Second *
> 
>  If not, repeat step one until it does, or use something similar to
>  the command I provided in my last message, etc.

"Repeat step one" means invoking Emacs again from the command line?
Or killing the buffer and revisiting wrap_crash.org from the same
Emacs session?  If the former, it sounds strange that a new invocation
of Emacs would behave differently from the previous one (unless
there's an uninitialized variable somewhere...).

> As a side bug, if you position cursor on "* First" in the testcase
> then press [TAB] you will see that "* Second" gets deformed to:
> 
> d *...

This is related to the ellipsis that Org mode displays instead of
lines it hides.  If you type "M-x show-all RET", you will see the same
display bug.  I will work on fixing it, but in general, Org mode
should set bidi-paragraph-direction to `left-to-right' in all its
buffers, because using "* FOO" outlines with FOO in left-to-right
script assumes left-to-right paragraphs, and because Org mode does not
enforce an empty line before the "* FOO" lines, making them assume the
direction of the previous paragraph, which looks odd.