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: bidi-display-reordering is now non-nil by default Date: Sun, 31 Jul 2011 08:22:39 -0400 Message-ID: References: <20110731.082721.451360942.wl@gnu.org> <20110731.085115.40009301.wl@gnu.org> <877h6yanje.fsf@fencepost.gnu.org> <878vre95g3.fsf@fencepost.gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1312114975 31936 80.91.229.12 (31 Jul 2011 12:22:55 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 31 Jul 2011 12:22:55 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jul 31 14:22:50 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QnV2f-0002tw-7y for ged-emacs-devel@m.gmane.org; Sun, 31 Jul 2011 14:22:49 +0200 Original-Received: from localhost ([::1]:40635 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QnV2e-0002eT-P2 for ged-emacs-devel@m.gmane.org; Sun, 31 Jul 2011 08:22:48 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:49815) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QnV2Z-0002eG-Ca for emacs-devel@gnu.org; Sun, 31 Jul 2011 08:22:47 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QnV2V-000621-4q for emacs-devel@gnu.org; Sun, 31 Jul 2011 08:22:43 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]:41971) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QnV2V-00061v-25 for emacs-devel@gnu.org; Sun, 31 Jul 2011 08:22:39 -0400 Original-Received: from eliz by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1QnV2V-000547-0j for emacs-devel@gnu.org; Sun, 31 Jul 2011 08:22:39 -0400 In-reply-to: (message from Lars Magne Ingebrigtsen on Sun, 31 Jul 2011 13:07:13 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.10 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:142560 Archived-At: > From: Lars Magne Ingebrigtsen > Date: Sun, 31 Jul 2011 13:07:13 +0200 > > Eli Zaretskii writes: > > >> So we are apparently searching for the paragraph beginning of a > >> humongous paragraph for each keystroke. > > > > In the case in point, yes. Also for each cursor motion command. > > Can't this information be cached somehow? I think it would be a very complicated caching, because you cannot determine whether you are still inside the same paragraph without finding the beginning and the end of that paragraph. Since Emacs is an editor, i.e. most buffers get their text modified, you'd need to update your notion of the paragraph beginning and end very frequently, so you are back at the same problem: the need to find the paragraph beginning as a prerequisite for correct redisplay (but now you also need to find its end, which will eat up more cycles). Even with paragraph beginning and end in hand, there are still complications, because inserting a character at the paragraph beginning can change its base direction. And that character does not have to be the very first character of the paragraph, it can be preceded by any number of so-called "neutral" and "weak" characters, like punctuation and whitespace, that have no directionality of their own, but instead take the direction of surrounding "strong" characters. Doing this correctly and efficiently will require non-trivial infrastructure, which is not something to consider when the pretest is about to start, I think. So I'd rather we didn't implement such a cache if it can be avoided.