emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [Orgmode] Re: Automatic indentation of org tree


From: Carsten Dominik
Subject: Re: [Orgmode] Re: Automatic indentation of org tree
Date: Mon, 3 Aug 2009 06:36:17 +0200


On Jul 28, 2009, at 9:32 PM, User wrote:

Bastien <bastienguerry <at> 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.
address@hidden
http://lists.gnu.org/mailman/listinfo/emacs-orgmode





reply via email to

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