annotate man/lispref/annotations.texi @ 54:05472e90ae02 r19-16-pre2

Import from CVS: tag r19-16-pre2
author cvs
date Mon, 13 Aug 2007 08:57:55 +0200
parents ac2d302a0011
children 131b0175ea99
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 @c -*-texinfo-*-
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 @c This is part of the XEmacs Lisp Reference Manual.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 @c Copyright (C) 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 @c Copyright (C) 1995 Ben Wing.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 @c See the file lispref.texi for copying conditions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 @setfilename ../../info/annotations.info
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 @node Annotations, Display, Glyphs, top
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 @chapter Annotations
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 @cindex annotation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 An @dfn{annotation} is a pixmap or string that is not part of a buffer's
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 text but is displayed next to a particular location in a buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 Annotations can be displayed intermixed with text, in any whitespace at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 the beginning or end of a line, or in a special area at the left or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 right side of the frame called a @dfn{margin}, whose size is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 controllable. Annotations are implemented using extents
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 (@pxref{Extents}); but you can work with annotations without knowing how
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 extents work.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 @menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 * Annotation Basics:: Introduction to annotations.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 * Annotation Primitives:: Creating and deleting annotations.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 * Annotation Properties:: Retrieving and changing the characteristics
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 of an annotation.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 * Margin Primitives:: Controlling the size of the margins.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 * Locating Annotations:: Looking for annotations in a buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 * Annotation Hooks:: Hooks called at certain times during an
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 annotation's lifetime.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 @end menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 @node Annotation Basics
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 @section Annotation Basics
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 @cindex margin
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 Marginal annotations are notes associated with a particular location in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 a buffer. They may be displayed in a margin created on the left-hand or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 right-hand side of the frame, in any whitespace at the beginning or end
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 of a line, or inside of the text itself. Every annotation may have an
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 associated action to be performed when the annotation is selected. The
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 term @dfn{annotation} is used to refer to an individual note. The term
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 @dfn{margin} is generically used to refer to the whitespace before the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 first character on a line or after the last character on a line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 Each annotation has the following characteristics:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 @table @var
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 @item glyph
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 This is a glyph object and is used as the displayed representation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 of the annotation.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 @item down-glyph
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 If given, this glyph is used as the displayed representation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 of the annotation when the mouse is pressed down over the annotation.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 @item face
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 The face with which to display the glyph.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 @item side
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 Which side of the text (left or right) the annotation is displayed at.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 @item action
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 If non-@code{nil}, this field must contain a function capable of being
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 the first argument to @code{funcall}. This function is normally
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 evaluated with a single argument, the value of the @var{data} field,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 each time the annotation is selected. However, if the @var{with-event}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 parameter to @code{make-annotation} is non-@code{nil}, the function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 is called with two arguments. The first argument is the same as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 before, and the second argument is the event (a button-up event,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 usually) that activated the annotation.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 @item data
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 Not used internally. This field can contain any E-Lisp object. It is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 passed as the first argument to @var{action} described above.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 @item menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 A menu displayed when the right mouse button is pressed over the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 annotation.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 @cindex outside margin
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 @cindex inside margin
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 The margin is divided into @dfn{outside} and @dfn{inside}. The outside
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 margin is space on the left or right side of the frame which normal text
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 cannot be displayed in. The inside margin is that space between the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 leftmost or rightmost point at which text can be displayed and where the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 first or last character actually is.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 @cindex layout types
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 There are four different @dfn{layout types} which affect the exact
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 location an annotation appears.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 @table @code
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 @item outside-margin
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 The annotation is placed in the outside margin area. as close as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 possible to the edge of the frame. If the outside margin is not wide
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 enough for an annotation to fit, it is not displayed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 @item inside-margin
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 The annotation is placed in the inside margin area, as close as possible
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 to the edge of the frame. If the inside margin is not wide enough for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 the annotation to fit, it will be displayed using any available outside
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 margin space if and only if the specifier @code{use-left-overflow} or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 @code{use-right-overflow} (depending on which side the annotation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 appears in) is non-@code{nil}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 @item whitespace
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 The annotation is placed in the inside margin area, as close as possible
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 to the first or last non-whitespace character on a line. If the inside
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 margin is not wide enough for the annotation to fit, it will be
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
103 displayed if and only if the specifier @code{use-left-overflow} or
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 @code{use-right-overflow} (depending on which side the annotation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 appears in) is non-@code{nil}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 @item text
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 The annotation is placed at the position it is inserted. It will create
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 enough space for itself inside of the text area. It does not take up a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 place in the logical buffer, only in the display of the buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 @cindex layout policy
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 The current layout policy is that all @code{whitespace} annotations are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 displayed first. Next, all @code{inside-margin} annotations are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 displayed using any remaining space. Finally as many
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 @code{outside-margin} annotations are displayed as possible. The
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 @code{text} annotations will always display as they create their own
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 space to display in.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 @node Annotation Primitives
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 @section Annotation Primitives
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 @defun make-annotation glyph &optional position layout buffer with-event d-glyph rightp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 This function creates a marginal annotation at position @var{pos} in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 @var{buffer}. The annotation is displayed using @var{glyph}, which
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 should be a glyph object or a string, and is positioned using layout
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 policy @var{layout}. If @var{pos} is @code{nil}, point is used. If
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 @var{layout} is @code{nil}, @code{whitespace} is used. If @var{buffer}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 is @code{nil}, the current buffer is used.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 If @var{with-event} is non-@code{nil}, then when an annotation is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 activated, the triggering event is passed as the second arg to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 annotation function. If @var{d-glyph} is non-@code{nil} then it is used
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 as the glyph that will be displayed when button1 is down. If
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 @var{rightp} is non-@code{nil} then the glyph will be displayed on the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 right side of the buffer instead of the left.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 The newly created annotation is returned.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 @defun delete-annotation annotation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 This function removes @var{annotation} from its buffer. This does not
54
05472e90ae02 Import from CVS: tag r19-16-pre2
cvs
parents: 2
diff changeset
145 modify the buffer text.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 @defun annotationp annotation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 This function returns @code{t} if @var{annotation} is an annotation,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 @code{nil} otherwise.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 @node Annotation Properties
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 @section Annotation Properties
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 @defun annotation-glyph annotation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 This function returns the glyph object used to display @var{annotation}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 @defun set-annotation-glyph annotation glyph &optional layout side
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 This function sets the glyph of @var{annotation} to @var{glyph}, which
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 should be a glyph object. If @var{layout} is non-@code{nil}, set the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 layout policy of @var{annotation} to @var{layout}. If @var{side} is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 @code{left} or @code{right}, change the side of the buffer at which the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 annotation is displayed to the given side. The new value of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 @code{annotation-glyph} is returned.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 @defun annotation-down-glyph annotation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 This function returns the glyph used to display @var{annotation} when
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 the left mouse button is depressed on the annotation.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 @defun set-annotation-down-glyph annotation glyph
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 This function returns the glyph used to display @var{annotation} when
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 the left mouse button is depressed on the annotation to @var{glyph},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 which should be a glyph object.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 @defun annotation-face annotation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 This function returns the face associated with @var{annotation}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 @defun set-annotation-face annotation face
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 This function sets the face associated with @var{annotation} to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 @var{face}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 @defun annotation-layout annotation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 This function returns the layout policy of @var{annotation}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 @defun set-annotation-layout annotation layout
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 This function sets the layout policy of @var{annotation} to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 @var{layout}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 @defun annotation-side annotation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 This function returns the side of the buffer that @var{annotation} is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 displayed on. Return value is a symbol, either @code{left} or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 @code{right}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 @defun annotation-data annotation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 This function returns the data associated with @var{annotation}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 @defun set-annotation-data annotation data
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 This function sets the data field of @var{annotation} to @var{data}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 @var{data} is returned.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 @defun annotation-action annotation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 This function returns the action associated with @var{annotation}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 @defun set-annotation-action annotation action
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 This function sets the action field of @var{annotation} to @var{action}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 @var{action} is returned..
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 @defun annotation-menu annotation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 This function returns the menu associated with @var{annotation}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 @defun set-annotation-menu annotation menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 This function sets the menu associated with @var{annotation} to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 @var{menu}. This menu will be displayed when the right mouse button is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 pressed over the annotation.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 @defun annotation-visible annotation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 This function returns @code{t} if there is enough available space to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 display @var{annotation}, @code{nil} otherwise.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 @defun annotation-width annotation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 This function returns the width of @var{annotation} in pixels.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 @defun hide-annotation annotation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 This function removes @var{annotation}'s glyph, making it invisible.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 @defun reveal-annotation annotation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 This function restores @var{annotation}'s glyph, making it visible.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 @node Locating Annotations
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 @section Locating Annotations
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 @defun annotations-in-region start end buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 This function returns a list of all annotations in @var{buffer} which
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254 are between @var{start} and @var{end} inclusively.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 @defun annotations-at &optional position buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 This function returns a list of all annotations at @var{position} in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 @var{buffer}. If @var{position} is @code{nil} point is used. If
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 @var{buffer} is @code{nil} the current buffer is used.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 @defun annotation-list &optional buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264 This function returns a list of all annotations in @var{buffer}. If
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 @var{buffer} is @code{nil}, the current buffer is used.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 @defun all-annotations
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 This function returns a list of all annotations in all buffers in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 existence.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 @node Margin Primitives
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 @section Margin Primitives
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 @cindex margin width
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 The margin widths are controllable on a buffer-local, window-local,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 frame-local, device-local, or device-type-local basis through the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 use of specifiers. @xref{Specifiers}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 @defvr Specifier left-margin-width
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 This is a specifier variable controlling the width of the left outside
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283 margin, in characters. Use @code{set-specifier} to change its value.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 @end defvr
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 @defvr Specifier right-margin-width
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 This is a specifier variable controlling the width of the right outside
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 margin, in characters. Use @code{set-specifier} to change its value.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289 @end defvr
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 @defvr Specifier use-left-overflow
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 If non-@code{nil}, use the left outside margin as extra whitespace when
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 displaying @code{whitespace} and @code{inside-margin} annotations.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294 Defaults to @code{nil}. This is a specifier variable; use
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 @code{set-specifier} to change its value.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 @end defvr
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298 @defvr Specifier use-right-overflow
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299 If non-@code{nil}, use the right outside margin as extra whitespace when
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300 displaying @code{whitespace} and @code{inside-margin} annotations.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 Defaults to @code{nil}. This is a specifier variable; use
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302 @code{set-specifier} to change its value.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303 @end defvr
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305 @defun window-left-margin-pixel-width &optional window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306 This function returns the width in pixels of the left outside margin of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307 @var{window}. If @var{window} is @code{nil}, the selected window is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308 assumed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311 @defun window-right-margin-pixel-width &optional window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312 This function returns the width in pixels of the right outside margin of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313 @var{window}. If @var{window} is @code{nil}, the selected window is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314 assumed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317 The margin colors are controlled by the faces @code{left-margin} and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 @code{right-margin}. These can be set using the X resources
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 @code{Emacs.left-margin.background} and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320 @code{Emacs.left-margin.foreground}; likewise for the right margin.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 @node Annotation Hooks
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324 @section Annotation Hooks
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325 @cindex annotation hooks
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327 The following three hooks are provided for use with the marginal annotations:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329 @table @code
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330 @item before-delete-annotation-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331 This hook is called immediately before an annotation is destroyed. It
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332 is passed a single argument, the annotation being destroyed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334 @item after-delete-annotation-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335 This normal hook is called immediately after an annotation is destroyed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337 @item make-annotation-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338 This hook is called immediately after an annotation is created. It is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 passed a single argument, the newly created annotation.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340 @end table