Subject: Re: bug#9470: 24.0.50; Possible bidi-related slowness

From: Eli Zaretskii <[email-masked]>
Date: Sat, 10 Sep 2011 16:10:39 -0400

> From: Lars Magne Ingebrigtsen <[email-masked]>
> Cc: [email-masked]
> Date: Sat, 10 Sep 2011 21:41:44 +0200
> 
> > That setting just tells Emacs to display text starting at the left
> > margin of the window.  It doesn't stop reordering R2L text for
> > display
> > (see the node "Bidirectional Display" in the ELisp manual).
> 
> Hm.  Then why isn't that the default, then?

Because, if the paragraph consists of mostly R2L text, displaying it
from the left margin would not be TRT, it looks ugly.

Left-to-right paragraphs _are_ the default in modes where we know in
advance that we will be displaying predominantly L2R text, such as in
any mode that inherits from prog-mode.  But in modes that display
human-written text paragraph direction is determined dynamically as
part of redisplay, and that can be very expensive when you are near
the end of a large buffer that is a single paragraph.

> > Anyway, what do you mean by "article buffer"?  (I don't use Gnus.)
> > What does it display?  If it displays text of a single article,
> > then
> > how come you gave me text is an infinite sequence of identical
> > lines?
> 
> It displays the text of a single article.
> 
> This particular article was mainly composed of 197K lines looking
> like
> that.  There was a paragraph at the beginning.
> 
> (It was an IMAP bug report.)

Then I don't see how can I fix this specific case.  The bidi display
must know the paragraph direction in order to DTRT.  Ideas are
welcome.  Doing something simple, like force left-to-right paragraph
direction if paragraph start isn't found in N lines, doesn't sound
right, as this will cause different display depending on how far we
are from the text beginning.  Hmmm...