From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Re: Automatic indentation of org tree Date: Mon, 3 Aug 2009 06:36:17 +0200 Message-ID: <0658D056-C67F-4659-97E7-85D6E8360CEA@gmail.com> References: <871vo1agq1.fsf@bzg.ath.cx> <87r5w13taq.fsf@bzg.ath.cx> Mime-Version: 1.0 (Apple Message framework v935.3) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MXpHf-0008SN-QF for emacs-orgmode@gnu.org; Mon, 03 Aug 2009 00:36:27 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MXpHc-0008M5-8n for emacs-orgmode@gnu.org; Mon, 03 Aug 2009 00:36:27 -0400 Received: from [199.232.76.173] (port=41574 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MXpHb-0008Ln-NA for emacs-orgmode@gnu.org; Mon, 03 Aug 2009 00:36:23 -0400 Received: from mail-ew0-f211.google.com ([209.85.219.211]:56731) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MXpHb-0002tP-6F for emacs-orgmode@gnu.org; Mon, 03 Aug 2009 00:36:23 -0400 Received: by ewy7 with SMTP id 7so1040297ewy.42 for ; Sun, 02 Aug 2009 21:36:22 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: User Cc: emacs-orgmode@gnu.org On Jul 28, 2009, at 9:32 PM, User wrote: > Bastien googlemail.com> writes: >> >> I tested your code but there are several problems: it is not usable >> on >> big files, > > The size of the file shouldn't matter, since only lines in the > current window are indented. Probably, some trivial bug remained > in it which my tests didn't cover. Thanks for being interested in this functionality which I wanted to have for a very long time, and which I have tried to implement several times in the past, without success. Bastien is right that your solution is not working in large files. The reason for this is outline folding. The current window can contain an arbitrary number of lines if these are hidden under a headline. If you try your solution on such file, you will see the large delay caused by the indentation. In addition, the huge number of markers produced to track the overlays will bog down any editing attempts. In fact, your package has just the same problems as my org-indent.el that has been in the contrib directory for some time. Incidentally, I have worked during my vacation on a solution that uses text properties (line-prefix and wrap-prefix) and hooks into font-lock. The reason why it uses font-lock is because the only the display engine is fast enough to figure out which text will be indeed be displayed. The reason why I am using text properties is because they do not seem to use markers and do not slow down editing even if the entire buffer has the properties attached. I am also using a different approach for the headline stars, by enforcing hidestars, and indenting the headline half as much as the text lines to implement a complete clean view with a single command (or startup option....) This solution is for Emacs 23 only, but I believe it is more stable, so I am shipping it now with Org. If anyone wants to try before the next release, put #+STARTUP: indent into a file after pulling the latest git version. - Carsten > >> and even on small files the auto-indentation is confusing. >> For example, stars get indented while there should not. > > It's a matter of taste. I didn't find it confusing. But it's > trivial to change it to avoid indenting header lines. > >> I guess this is still work-in-progress -- hope you'll find ways >> to fix the problems above! > > It's a proof-of-concept package, but I think the underlining > concept is solid. If someone motivated spends a little time on it > then I'm sure the problems can be ironed out quickly. > > > > > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode