--- Begin Message ---
Subject: |
display margins |
Date: |
Tue, 11 Dec 2001 20:00:23 +0100 |
What are the display margins intended for?
I mean: this seems to be a really nifty feature, but I do not quite
understand what it's supposed purpose is. In other words: what usage
had the developers in their minds when they implemented this?
I can display text on the margin by putting a text property on a text in
the buffer like this:
(put-text-property (point-min) 30
'display '((margin left-margin) "test"))
Then this text becomes invisible and the word "test" appears on the
left margin.
Now if I want to ...
1. ... display additional information in the margin, I have to put
some dummy text to the buffer and add my informational text to it
as a text property, like above.
I would prefer a function that let's me add some text directly to
the margin.
2. ... display some buffer-text in the margin instead of in the
buffer, then I have to read this text to a string first, then put
this string as a display-text property on that text. Like this:
(put-text-property
1 30 'display `((margin left-margin)
,(buffer-substring 1 30)))
I also tried this -- but with no avail:
(put-text-property 1 10 'display `(margin left-margin))
[This is what I would have thought after reading the Info doc would
be the right thing. Is this a doc-bug or is it my fault?]
I guess I did not get the intention for implementing the
margin. Therefore my question.
Also: from the Elisp-Reference I got the impression that the margin is
something local to a window. But obviously it is a buffer related
thing.
'oliver
PS: Did I already mention in this NG what a great and wonderful thing
Emacs 21 is? Whenever I read the Reference I feel like a child that
can not decide which present under the christmas tree to open first.
--
21 Frimaire an 210 de la Révolution
--- End Message ---