Subject: Re: bug#23457: 24.5; interactive use of next-line and previous-line (holding down C-n or C-p) lag in a buffer with all spaces and newlines

From: Eli Zaretskii <[email-masked]>
Date: Fri, 06 May 2016 12:20:49 +0300

> From: Stephen Berman <[email-masked]>
> Date: Fri, 06 May 2016 11:13:46 +0200
> Cc: Nicolas Petton <[email-masked]>, [email-masked]
> 
> I can reproduce this with the above recipe.  At step 9 I held down C-p
> for five seconds; after about 1 second point moved up one line (from 122
> to 121), then Emacs froze for about 45 seconds, after which point jumped
> to bob.

A large buffer with no text paragraph anywhere in sight caused Emacs
to search back for the end of the previous paragraph, in order to
decide what is the base direction for the current paragraph.  In
addition, every line is long, but empty, so regex search also takes
time.  The search is limited to a certain number of lines, so the
lag should level out after that, but otherwise just don't use such
empty lines in buffers whose bidi-paragraph-direction is nil.