annotate man/lispref/annotations.texi @ 2028:2ba4f06a264d

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