Previous: Other Display Specs, Up: Display Property
A buffer can have blank areas called display margins on the left
and on the right. Ordinary text never appears in these areas, but you
can put things into the display margins using the display
property.
To put text in the left or right display margin of the window, use a
display specification of the form (margin right-margin) or
(margin left-margin) on it. To put an image in a display margin,
use that display specification along with the display specification for
the image. Unfortunately, there is currently no way to make
text or images in the margin mouse-sensitive.
If you put such a display specification directly on text in the
buffer, the specified margin display appears instead of that
buffer text itself. To put something in the margin in
association with certain buffer text without preventing or altering
the display of that text, put a before-string property on the
text and put the display specification on the contents of the
before-string.
Before the display margins can display anything, you must give them a nonzero width. The usual way to do that is to set these variables:
This variable specifies the width of the left margin. It is buffer-local in all buffers.
This variable specifies the width of the right margin. It is buffer-local in all buffers.
Setting these variables does not immediately affect the window. These
variables are checked when a new buffer is displayed in the window.
Thus, you can make changes take effect by calling
set-window-buffer.
You can also set the margin widths immediately.