Marginal annotations are notes associated with a particular location in a buffer. They may be displayed in a margin created on the left-hand or right-hand side of the frame, in any whitespace at the beginning or end of a line, or inside of the text itself. Every annotation may have an associated action to be performed when the annotation is selected. The term annotation is used to refer to an individual note. The term margin is generically used to refer to the whitespace before the first character on a line or after the last character on a line.
Each annotation has the following characteristics:
nil, this field must contain a function capable of being
the first argument to funcall. This function is normally
evaluated with a single argument, the value of the data field,
each time the annotation is selected. However, if the with-event
parameter to make-annotation is non-nil, the function
is called with two arguments. The first argument is the same as
before, and the second argument is the event (a button-up event,
usually) that activated the annotation.
The margin is divided into outside and inside. The outside margin is space on the left or right side of the frame which normal text cannot be displayed in. The inside margin is that space between the leftmost or rightmost point at which text can be displayed and where the first or last character actually is.
There are four different layout types which affect the exact location an annotation appears.
outside-margininside-marginuse-left-overflow or
use-right-overflow (depending on which side the annotation
appears in) is non-nil.
whitespaceuse-left-overflow or
use-right-overflow (depending on which side the annotation
appears in) is non-nil.
textThe current layout policy is that all whitespace annotations are
displayed first. Next, all inside-margin annotations are
displayed using any remaining space. Finally as many
outside-margin annotations are displayed as possible. The
text annotations will always display as they create their own
space to display in.