emacs-devel
[Top][All Lists]
Advanced

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

Re: Feature proposal/request: Indentation driven by display engine


From: Stefan Monnier
Subject: Re: Feature proposal/request: Indentation driven by display engine
Date: Sat, 24 May 2008 14:48:51 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

> I have been trying to implement this using display properties
> on each newline characters, displaying "\n   " instead of
> just "\n".  This basically works, but it interacts badly
> with outlining:  If I fold the text below a headline, the
> first indentation is still displayed.

Can't you remove the display property when you fold to avoid the problem?

> The next thing I tried was using overlays over each "\n",
> with an after-string property carrying the indentations.
> This works correctly with outline, but when I add thousands
> of overlays to a buffer this becomes slow and redisplay and
> editing become sluggish, probably because to the huge
> amount of markers in the buffer.

Yes, we need to improve the implementation of markers to eliminate the
O(N) complexity.  Ideally, there'd be some clever way to store the
markers directly inside the text-properties tree.

> It then occurred to me that it might be useful to support
> such a feature directly in the display engine.
> For example, if the line contains text with an `indentation'
> property, the display engine would add this amount of white
> space to before the beginning of the line, maybe also a vertical
> line indicating the location of the margin.

This property would still need to be added to every line.  So basically
all you're asking is a "before-string" text-property, maybe?

> Or are there other comments, for example how this dynamic
> indentation could be implemented in a different way?

How 'bout modifying the actual buffer text directly?


        Stefan




reply via email to

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