From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Setting bidi-paragraph-direction in comint modes Date: Tue, 14 Feb 2012 19:55:07 +0200 Message-ID: <83d39hxptw.fsf@gnu.org> References: <87vcn9zzuf.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: dough.gmane.org 1329242141 10241 80.91.229.3 (14 Feb 2012 17:55:41 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 14 Feb 2012 17:55:41 +0000 (UTC) Cc: emacs-devel@gnu.org To: Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 14 18:55:40 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RxMbL-00008a-4u for ged-emacs-devel@m.gmane.org; Tue, 14 Feb 2012 18:55:39 +0100 Original-Received: from localhost ([::1]:33011 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RxMbK-00056V-N9 for ged-emacs-devel@m.gmane.org; Tue, 14 Feb 2012 12:55:38 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:37059) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RxMbF-000568-H5 for emacs-devel@gnu.org; Tue, 14 Feb 2012 12:55:37 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RxMb9-0006Ej-R7 for emacs-devel@gnu.org; Tue, 14 Feb 2012 12:55:33 -0500 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:47904) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RxMb8-0006Dl-7P; Tue, 14 Feb 2012 12:55:26 -0500 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0LZE00D009PCFG00@a-mtaout22.012.net.il>; Tue, 14 Feb 2012 19:55:04 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([77.124.150.51]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LZE00D7E9RR0EA0@a-mtaout22.012.net.il>; Tue, 14 Feb 2012 19:55:04 +0200 (IST) In-reply-to: <87vcn9zzuf.fsf@gnu.org> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 80.179.55.172 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:148613 Archived-At: > From: Chong Yidong > 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 machine? 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. */ #define MAX_PARAGRAPH_SEARCH 7500 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.