[Top][All Lists]

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

Re: Setting bidi-paragraph-direction in comint modes

From: Eli Zaretskii
Subject: Re: Setting bidi-paragraph-direction in comint modes
Date: Tue, 14 Feb 2012 19:55:07 +0200

> From: Chong Yidong <address@hidden>
> Date: Tue, 14 Feb 2012 14:35:52 +0800
> 1. emacs -Q
> 2. M-x shell RET
> 3. ls /usr/share/doc    (Prints about 2000 lines on my computer)
> 4. Repeat step 3 many times.
> As the buffer gets to about 8000 lines, redisplay slows to a crawl.

I cannot reproduce this here.  I tried the same in a directory with
2190 files, generated a 10K-line buffer with no empty lines, and I see
no "crawl", only some minor slowdown.  Maybe I didn't try the commands
you did?  Which Emacs commands caused such a slow redisplay on your

In any case, see this comment in bidi.c:

  /* On my 2005-vintage machine, searching back for paragraph start
     takes ~1 us per line.  And bidi_paragraph_init is called 4 times
     when user types C-p.  The number below limits each call to
     bidi_paragraph_init to about 10 ms.  */

In my experience, 4 x 10 = 40 ms is not perceived as a terrible
slowdown, and most machines people use today are faster than mine.
This number was tuned to treat reasonably well hard cases such as the
one described in bug #9470.

> AFAICT, bidi paragraphs don't make sense in Comint-like modes
> anyway.

Unfortunately, it does: a console program that displays localized
messages through gettext will need dynamic determination of the
paragraph direction in bidirectional locales, to display the messages
as users of those locales expect.

In any case, I'd like first to reproduce the problem, and then look
into its root cause.  Somehow, I doubt that searching for the
paragraph start is it, with the above limit in effect.

reply via email to

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