From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [dev] org-indent-mode patch Date: Thu, 21 Jul 2011 17:14:55 +0200 Message-ID: <87livrr7gw.fsf@gmail.com> References: <87ipvnng95.fsf@gmail.com> <67BE727C-BFCE-4862-9DCC-AFA4201F3DA2@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:51930) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qjv2s-00019R-Ck for emacs-orgmode@gnu.org; Thu, 21 Jul 2011 11:20:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qjuxq-0002P6-8C for emacs-orgmode@gnu.org; Thu, 21 Jul 2011 11:15:06 -0400 Received: from mail-wy0-f169.google.com ([74.125.82.169]:41309) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qjuxp-0002P2-W5 for emacs-orgmode@gnu.org; Thu, 21 Jul 2011 11:15:02 -0400 Received: by wyg36 with SMTP id 36so1114394wyg.0 for ; Thu, 21 Jul 2011 08:15:01 -0700 (PDT) In-Reply-To: <67BE727C-BFCE-4862-9DCC-AFA4201F3DA2@gmail.com> (Carsten Dominik's message of "Mon, 14 Mar 2011 08:51:27 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Carsten Dominik Cc: Org Mode List Hello, Carsten Dominik writes: > On 13.3.2011, at 17:21, Nicolas wrote: > >> I'd like to submit the following org-indent-mode patch for testing. >> >> >> It implements two things: >> >> 1. It indents correctly text when using visual-line-mode; >> 2. It removes the idle timer previous implementation was using, which >> means it won't refresh indentation more often than necessary. >> >> Unfortunately, there is a price to pay: >> >> 1. Initialization will be much longer for large Org files, but I've >> added a message to the user saying so. >> 2. It is a bit slower, as the algorithm has more things to check. >> >> >> Last point is obviously my main concern. Although not noticeable on my >> not-so-recent laptop, I don't know how it behaves on old machines. >> > Initial testing seems to show that this works well, very nice. > > The delay at the beginning is long, and it might be annoying > when org pulls in a buffer just to look something up, > without org-inhibit-startup scoped into the file loading. > > Maybe one could arrange for the initialization to happen just > before the buffer is first *displayed* (I do not know if that > is possible). > > Just one nitpicking: The idle timer may force updating when > not necessary - but using after-change-functions will update after > each character inserted. So in fact your code might be updating > more often at least while typing - maybe not while looking at > the buffer and jumping around. I am not a fast typist, but maybe > fast typists will notice significant delays, in particular > while writing inside a very long section? In order to circumvent the slow process at initialization, I've implemented an asynchronous initialization. Thus, one can open the buffer and start to write in it before initialization is complete. Once it is done, everything else is synchronous again. I think it is a good compromise. It needs testing though. Thus, if anyone is interested, I'll gladly hear his feedback. The branch is located at : git://github.com/ngz/org-mode-lists.git indent-patch-no-timer Regards, -- Nicolas Goaziou