[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Feature proposal/request: Indentation driven by display engine
From: |
Carsten Dominik |
Subject: |
Feature proposal/request: Indentation driven by display engine |
Date: |
Sat, 24 May 2008 14:15:59 +0200 |
Hi,
I have a proposal to make:
Recently, I have experimented with an idea, to create
indentation on the Emacs display.
For example, in an outline structure
* level 1
text under level 1
** Level 2
text under level 1
I would like to display this as:
* level 1
text under level 1
** Level 2
text under level 1
without actually inserting white space at the beginning of
each line. So effectively I would like to shift the location
of the left margin on a per-line basis.
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.
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.
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.
Would that be something useful to add? Anyone who would
volunteer to implement this, because I frankly have no
idea how the display engine works internally.
Or are there other comments, for example how this dynamic
indentation could be implemented in a different way?
Thanks for listening.
- Carsten