annotate man/lispref/specifiers.texi @ 267:966663fcf606 r20-5b32

Import from CVS: tag r20-5b32
author cvs
date Mon, 13 Aug 2007 10:26:29 +0200
parents 360340f9fd5f
children c9fe270a4101
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) 1995, 1996 Ben Wing.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 @c See the file lispref.texi for copying conditions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 @setfilename ../../info/specifiers.info
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 @node Specifiers, Faces and Window-System Objects, Extents, top
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 @chapter Specifiers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 @cindex specifier
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 A specifier is an object used to keep track of a property whose value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 may vary depending on the particular situation (e.g. particular buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 displayed in a particular window) that it is used in. The value of many
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 built-in properties, such as the font, foreground, background, and such
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 properties of a face and variables such as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 @code{modeline-shadow-thickness} and @code{top-toolbar-height}, is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 actually a specifier object. The specifier object, in turn, is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ``instanced'' in a particular situation to yield the real value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 of the property in that situation.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 @defun specifierp object
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 This function returns non-@code{nil} if @var{object} is a specifier.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 @menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 * Introduction to Specifiers:: Specifiers provide a clean way for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 display and other properties to vary
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 (under user control) in a wide variety
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 of contexts.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 * Specifiers In-Depth:: Gory details about specifier innards.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 * Specifier Instancing:: Instancing means obtaining the ``value'' of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 a specifier in a particular context.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 * Specifier Types:: Specifiers come in different flavors.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 * Adding Specifications:: Specifications control a specifier's ``value''
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 by giving conditions under which a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 particular value is valid.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 * Retrieving Specifications:: Querying a specifier's specifications.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 * Specifier Tag Functions:: Working with specifier tags.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 * Specifier Instancing Functions::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 Functions to instance a specifier.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 * Specifier Example:: Making all this stuff clearer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 * Creating Specifiers:: Creating specifiers for your own use.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 * Specifier Validation Functions::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 Validating the components of a specifier.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 * Other Specification Functions::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 Other ways of working with specifications.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 @end menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 @node Introduction to Specifiers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 @section Introduction to Specifiers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 Sometimes you may want the value of a property to vary depending on
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 the context the property is used in. A simple example of this in XEmacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 is buffer-local variables. For example, the variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 @code{modeline-format}, which controls the format of the modeline, can
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 have different values depending on the particular buffer being edited.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 The variable has a default value which most modes will use, but a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 specialized package such as Calendar might change the variable so
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 as to tailor the modeline to its own purposes.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 Other properties (such as those that can be changed by the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 @code{modify-frame-parameters} function, for example the color of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 text cursor) can have frame-local values, although it might also make
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 sense for them to have buffer-local values. In other cases, you might
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 want the property to vary depending on the particular window within the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 frame that applies (e.g. the top or bottom window in a split frame), the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 device type that that frame appears on (X or tty), etc. Perhaps you can
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 envision some more complicated scenario where you want a particular
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 value in a specified buffer, another value in all other buffers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 displayed on a particular frame, another value in all other buffers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 displayed in all other frames on any mono (two-color, e.g. black and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 white only) displays, and a default value in all other circumstances.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 A @dfn{specifier} is a generalization of this, allowing a great deal
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 of flexibility in controlling exactly what value a property has in which
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 circumstances. It is most commonly used for display properties, such as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 an image or the foreground color of a face. As a simple example, you can
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 specify that the foreground of the default face be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 @itemize @bullet
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 blue for a particular buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 green for all other buffers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 @end itemize
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 As a more complicated example, you could specify that the foreground of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 the default face be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 @itemize @bullet
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 forest green for all buffers displayed in a particular Emacs window, or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 green if the X server doesn't recognize the color @samp{forest green}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 blue for all buffers displayed in a particular frame
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 red for all other buffers displayed on a color device
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 white for all other buffers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 @end itemize
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 @node Specifiers In-Depth
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 @section In-Depth Overview of a Specifier
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 @cindex specification (in a specifier)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 @cindex domain (in a specifier)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 @cindex locale (in a specifier)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 @cindex instantiator (in a specifier)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 @cindex instancing (in a specifier)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 @cindex instance (in a specifier)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 @cindex inst-list (in a specifier)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 @cindex inst-pair (in a specifier)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 @cindex tag (in a specifier)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 @cindex tag set (in a specifier)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 @cindex specifier, specification
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 @cindex specifier, domain
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 @cindex specifier, locale
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 @cindex specifier, instantiator
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 @cindex specifier, instancing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 @cindex specifier, instance
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 @cindex specifier, inst-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 @cindex specifier, inst-pair
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 @cindex specifier, tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 @cindex specifier, tag set
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 A specifier object encapsulates a set of @dfn{specifications}, each of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 which says what its value should be if a particular condition applies.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 For example, one specification might be ``The value should be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 darkseagreen2 on X devices'' another might be ``The value should be blue
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 in the *Help* buffer''. In specifier terminology, these conditions are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 called @dfn{locales} and the values are called @dfn{instantiators}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 Given a specifier, a logical question is ``What is its value in a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 particular situation?'' This involves looking through the specifications
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 to see which ones apply to this particular situation, and perhaps
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 preferring one over another if more than one applies. In specifier
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 terminology, a ``particular situation'' is called a @dfn{domain}, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 determining its value in a particular domain is called @dfn{instancing}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 Most of the time, a domain is identified by a particular window. For
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 example, if the redisplay engine is drawing text in the default face in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 a particular window, it retrieves the specifier for the foreground color
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 of the default face and @dfn{instances} it in the domain given by that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 window; in other words, it asks the specifier, ``What is your value in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 this window?''.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 More specifically, a specifier contains a set of @dfn{specifications},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 each of which associates a @dfn{locale} (a buffer object, a window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 object, a frame object, a device object, or the symbol @code{global})
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 with an @dfn{inst-list}, which is a list of one or more
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 @dfn{inst-pairs}. (For each possible locale, there can be at most one
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 specification containing that locale.) Each inst-pair is a cons of a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 @dfn{tag set} (an unordered list of zero or more symbols, or @dfn{tags})
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 and an @dfn{instantiator} (the allowed form of this varies depending on
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 the type of specifier). In a given specification, there may be more
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 than one inst-pair with the same tag set; this is unlike for locales.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 The tag set is used to restrict the sorts of devices over which the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 instantiator is valid and to uniquely identify instantiators added by a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 particular application, so that different applications can work on the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 same specifier and not interfere with each other. Each tag can have a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 @dfn{predicate} associated with it, which is a function of one argument
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 (a device) that specifies whether the tag matches that particular
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 device. (If a tag does not have a predicate, it matches all devices.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 All tags in a tag set must match a device for the associated inst-pair
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 to be instantiable over that device. (A null tag set is perfectly
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 valid.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 The valid device types (normally @code{x}, @code{tty}, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 @code{stream}) and device classes (normally @code{color},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 @code{grayscale}, and @code{mono}) can always be used as tags, and match
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 devices of the associated type or class (@pxref{Consoles and Devices}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 User-defined tags may be defined, with an optional predicate specified.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 An application can create its own tag, use it to mark all its
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 instantiators, and be fairly confident that it will not interfere with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 other applications that modify the same specifier -- Functions that add
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 a specification to a specifier usually only overwrite existing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 inst-pairs with the same tag set as was given, and a particular tag or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 tag set can be specified when removing instantiators.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 When a specifier is instanced in a domain, both the locale and the tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 set can be viewed as specifying necessary conditions that must apply in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 that domain for an instantiator to be considered as a possible result of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 the instancing. More specific locales always override more general
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 locales (thus, there is no particular ordering of the specifications in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 a specifier); however, the tag sets are simply considered in the order
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 that the inst-pairs occur in the specification's inst-list.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 Note also that the actual object that results from the instancing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 (called an @dfn{instance object}) may not be the same as the instantiator
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 from which it was derived. For some specifier types (such as integer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 specifiers and boolean specifiers), the instantiator will be returned
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 directly as the instance object. For other types, however, this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 is not the case. For example, for font specifiers, the instantiator
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 is a font-description string and the instance object is a font-instance
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 object, which describes how the font is displayed on a particular device.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 A font-instance object encapsulates such things as the actual font name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 used to display the font on that device (a font-description string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 under X is usually a wildcard specification that may resolve to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 different font names, with possibly different foundries, widths, etc.,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 on different devices), the extra properties of that font on that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 device, etc. Furthermore, this conversion (called @dfn{instantiation})
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 might fail -- a font or color might not exist on a particular device,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 for example.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 @node Specifier Instancing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 @section How a Specifier Is Instanced
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 @cindex fallback (in a specifier)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 @cindex specifier, fallback
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 Instancing of a specifier in a particular window domain proceeds as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 follows:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 @itemize @bullet
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 First, XEmacs searches for a specification whose locale is the same as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 the window's buffer. If that fails, the search is repeated, looking for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 a locale that is the same as the window itself. If that fails, the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 search is repeated using the window's frame, then using the device that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 frame is on. Finally, the specification whose locale is the symbol
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 @code{global} (if there is such a specification) is considered.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 The inst-pairs contained in the specification that was found are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 considered in their order in the inst-list, looking for one whose tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 set matches the device that is derived from the window domain. (The
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 tag set is an unordered list of zero or more tag symbols. For all
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 tags that have predicates associated with them, the predicate must
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 match the device.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 If a matching tag set is found, the corresponding instantiator is passed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 to the specifier's instantiation method, which is specific to the type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 of the specifier. If it succeeds, the resulting instance object is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 returned as the result of the instancing and the instancing is done.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 Otherwise, the operation continues, looking for another matching
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231 inst-pair in the current specification.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 When there are no more inst-pairs to be considered in the current
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 specification, the search starts over, looking for another specification
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 as in the first step above.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 If all specifications are exhausted and no instance object can be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 derived, the instancing fails. (Actually, this is not completely true.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 Some specifier objects for built-in properties have a @dfn{fallback}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 value, which is either an inst-list or another specifier object, that is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 consulted if the instancing is about to fail. If it is an inst-list,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 the searching proceeds using the inst-pairs in that list. If it is a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 specifier, the entire instancing starts over using that specifier
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 instead of the given one. Fallback values are set by the C code and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 cannot be modified, except perhaps indirectly, using any Lisp functions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 The purpose of them is to supply some values to make sure that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 instancing of built-in properties can't fail and to implement some basic
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 specifier inheritance, such as the fact that faces inherit their
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 properties from the @code{default} face.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 @end itemize
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 It is also possible to instance a specifier over a frame domain or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 device domain instead of over a window domain. The C code, for example,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254 instances the @code{top-toolbar-height} variable over a frame domain in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 order to determine the height of a frame's top toolbar. Instancing over
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 a frame or device is similar to instancing over a window except that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 specifications for locales that cannot be derived from the domain are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 ignored. Specifically, instancing over a frame looks first for frame
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 locales, then device locales, then the @code{global} locale. Instancing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 over a device domain looks only for device locales and the @code{global}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261 locale.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 @node Specifier Types
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264 @section Specifier Types
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 There are various different types of specifiers. The type of a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267 specifier controls what sorts of instantiators are valid, how an
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 instantiator is instantiated, etc. Here is a list of built-in specifier
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 types:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 @table @code
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 @item boolean
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 The valid instantiators are the symbols @code{t} and @code{nil}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 Instance objects are the same as instantiators so no special
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 instantiation function is needed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 @item integer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 The valid instantiators are integers. Instance objects are the same as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 instantiators so no special instantiation function is needed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 @code{modeline-shadow-thickness} is an example of an integer specifier
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 (negative thicknesses indicate that the shadow is drawn recessed instead
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 of raised).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 @item natnum
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 The valid instantiators are natnums (non-negative integers). Instance
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 objects are the same as instantiators so no special instantiation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 function is needed. Natnum specifiers are used for dimension variables
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 such as @code{top-toolbar-height}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 @item generic
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 All Lisp objects are valid instantiators. Instance objects are the same
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 as instantiators so no special instantiation function is needed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294 @item font
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 The valid instantiators are strings describing fonts or vectors
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
296 indicating inheritance from the font of some face. Instance objects are
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
297 font-instance objects, which are specific to a particular device. The
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
298 instantiation method for font specifiers can fail, unlike for integer,
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
299 natnum, boolean, and generic specifiers.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 @item color
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302 The valid instantiators are strings describing colors or vectors
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303 indicating inheritance from the foreground or background of some face.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304 Instance objects are color-instance objects, which are specific to a
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
305 particular device. The instantiation method for color specifiers can fail,
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306 as for font specifiers.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308 @item image
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309 Images are perhaps the most complicated type of built-in specifier. The
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310 valid instantiators are strings (a filename, inline data for a pixmap,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311 or text to be displayed in a text glyph) or vectors describing inline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312 data of various sorts or indicating inheritance from the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313 background-pixmap property of some face. Instance objects are either
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314 strings (for text images), image-instance objects (for pixmap images),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315 or subwindow objects (for subwindow images). The instantiation method
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
316 for image specifiers can fail, as for font and color specifiers.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 @item face-boolean
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 The valid instantiators are the symbols @code{t} and @code{nil} and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320 vectors indicating inheritance from a boolean property of some face.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321 Specifiers of this sort are used for all of the built-in boolean
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322 properties of faces. Instance objects are either the symbol @code{t}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 or the symbol @code{nil}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325 @item toolbar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326 The valid instantiators are toolbar descriptors, which are lists
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327 of toolbar-button descriptors (each of which is a vector of two
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328 or four elements). @xref{Toolbar} for more information.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
331 Color and font instance objects can also be used in turn as
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
332 instantiators for a new color or font instance object. Since these
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
333 instance objects are device-specific, the instantiator can be used
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
334 directly as the new instance object, but only if they are of the same
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
335 device. If the devices differ, the base color or font of the
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
336 instantiating object is effectively used instead as the instantiator.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
337
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338 @xref{Faces and Window-System Objects} for more information on fonts,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 colors, and face-boolean specifiers. @xref{Glyphs} for more information
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340 about image specifiers. @xref{Toolbar} for more information on toolbar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341 specifiers.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343 @defun specifier-type specifier
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344 This function returns the type of @var{specifier}. The returned value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 will be a symbol: one of @code{integer}, @code{boolean}, etc., as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346 listed in the above table.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
349 Functions are also provided to query whether an object is a particular
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
350 kind of specifier:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352 @defun boolean-specifier-p object
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353 This function returns non-@code{nil} if @var{object} is a boolean
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 specifier.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357 @defun integer-specifier-p object
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358 This function returns non-@code{nil} if @var{object} is an integer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359 specifier.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 @defun natnum-specifier-p object
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363 This function returns non-@code{nil} if @var{object} is a natnum
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364 specifier.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367 @defun generic-specifier-p object
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368 This function returns non-@code{nil} if @var{object} is a generic
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 specifier.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 @defun face-boolean-specifier-p object
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373 This function returns non-@code{nil} if @var{object} is a face-boolean
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 specifier.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377 @defun toolbar-specifier-p object
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378 This function returns non-@code{nil} if @var{object} is a toolbar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379 specifier.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
381
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
382 @defun font-specifier-p object
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
383 This function returns non-@code{nil} if @var{object} is a font
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
384 specifier.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
385 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
386
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
387 @defun color-specifier-p object
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
388 This function returns non-@code{nil} if @var{object} is a color
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
389 specifier.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
390 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
391
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
392 @defun image-specifier-p object
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
393 This function returns non-@code{nil} if @var{object} is an image
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
394 specifier.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
397 @node Adding Specifications
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
398 @section Adding specifications to a Specifier
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
400 @defun add-spec-to-specifier specifier instantiator &optional locale tag-set how-to-add
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
401 This function adds a specification to @var{specifier}. The
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
402 specification maps from @var{locale} (which should be a buffer, window,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
403 frame, device, or the symbol @code{global}, and defaults to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
404 @code{global}) to @var{instantiator}, whose allowed values depend on the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
405 type of the specifier. Optional argument @var{tag-set} limits the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
406 instantiator to apply only to the specified tag set, which should be a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
407 list of tags all of which must match the device being instantiated over
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
408 (tags are a device type, a device class, or tags defined with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
409 @code{define-specifier-tag}). Specifying a single symbol for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
410 @var{tag-set} is equivalent to specifying a one-element list containing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
411 that symbol. Optional argument @var{how-to-add} specifies what to do if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
412 there are already specifications in the specifier. It should be one of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
413
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
414 @table @code
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
415 @item prepend
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
416 Put at the beginning of the current list of instantiators for @var{locale}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
417 @item append
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
418 Add to the end of the current list of instantiators for @var{locale}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
419 @item remove-tag-set-prepend
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
420 This is the default. Remove any existing instantiators whose tag set is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
421 the same as @var{tag-set}; then put the new instantiator at the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
422 beginning of the current list.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
423 @item remove-tag-set-append
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
424 Remove any existing instantiators whose tag set is the same as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
425 @var{tag-set}; then put the new instantiator at the end of the current
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
426 list.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
427 @item remove-locale
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
428 Remove all previous instantiators for this locale before adding the new
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
429 spec.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
430 @item remove-locale-type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
431 Remove all specifications for all locales of the same type as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
432 @var{locale} (this includes @var{locale} itself) before adding the new
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
433 spec.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
434 @item remove-all
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
435 Remove all specifications from the specifier before adding the new spec.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
436 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
437
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
438 @code{remove-tag-set-prepend} is the default.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
439
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
440 You can retrieve the specifications for a particular locale or locale type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
441 with the function @code{specifier-spec-list} or @code{specifier-specs}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
442 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
443
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
444 @defun add-spec-list-to-specifier specifier spec-list &optional how-to-add
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
445 This function adds a @dfn{spec-list} (a list of specifications) to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
446 @var{specifier}. The format of a spec-list is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
447
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
448 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
449 @code{((@var{locale} (@var{tag-set} . @var{instantiator}) ...) ...)}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
450 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
451
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
452 where
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
453
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
454 @itemize @bullet
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
455 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
456 @var{locale} := a buffer, a window, a frame, a device, or @code{global}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
457 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
458 @var{tag-set} := an unordered list of zero or more @var{tags}, each of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
459 which is a symbol
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
460 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
461 @var{tag} := a device class (@pxref{Consoles and Devices}), a device type,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
462 or a tag defined with @code{define-specifier-tag}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
463 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
464 @var{instantiator} := format determined by the type of specifier
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
465 @end itemize
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
466
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
467 The pair @code{(@var{tag-set} . @var{instantiator})} is called an
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
468 @dfn{inst-pair}. A list of inst-pairs is called an @dfn{inst-list}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
469 The pair @code{(@var{locale} . @var{inst-list})} is called a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
470 @dfn{specification}. A spec-list, then, can be viewed as a list of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
471 specifications.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
472
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
473 @var{how-to-add} specifies how to combine the new specifications with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
474 the existing ones, and has the same semantics as for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
475 @code{add-spec-to-specifier}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
476
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
477 In many circumstances, the higher-level function @code{set-specifier} is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
478 more convenient and should be used instead.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
479 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
480
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
481 @defun set-specifier specifier value &optional how-to-add
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
482 This function adds some specifications to @var{specifier}. @var{value}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
483 can be a single instantiator or tagged instantiator (added as a global
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
484 specification), a list of tagged and/or untagged instantiators (added as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
485 a global specification), a cons of a locale and instantiator or locale
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
486 and instantiator list, a list of such conses, or nearly any other
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
487 reasonable form. More specifically, @var{value} can be anything
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
488 accepted by @code{canonicalize-spec-list}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
489
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
490 @var{how-to-add} is the same as in @code{add-spec-to-specifier}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
491
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
492 Note that @code{set-specifier} is exactly complementary to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
493 @code{specifier-specs} except in the case where @var{specifier} has no
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
494 specs at all in it but @code{nil} is a valid instantiator (in that case,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
495 @code{specifier-specs} will return @code{nil} (meaning no specs) and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
496 @code{set-specifier} will interpret the @code{nil} as meaning ``I'm
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
497 adding a global instantiator and its value is @code{nil}''), or in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
498 strange cases where there is an ambiguity between a spec-list and an
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
499 inst-list, etc. (The built-in specifier types are designed in such a way
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
500 as to avoid any such ambiguities.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
501
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
502 If you want to work with spec-lists, you should probably not use these
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
503 functions, but should use the lower-level functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
504 @code{specifier-spec-list} and @code{add-spec-list-to-specifier}. These
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
505 functions always work with fully-qualified spec-lists; thus, there is no
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
506 ambiguity.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
507 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
508
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
509 @defun canonicalize-inst-pair inst-pair specifier-type &optional noerror
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
510 This function canonicalizes the given @var{inst-pair}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
511
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
512 @var{specifier-type} specifies the type of specifier that this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
513 @var{spec-list} will be used for.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
514
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
515 Canonicalizing means converting to the full form for an inst-pair, i.e.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
516 @code{(@var{tag-set} . @var{instantiator})}. A single, untagged
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
517 instantiator is given a tag set of @code{nil} (the empty set), and a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
518 single tag is converted into a tag set consisting only of that tag.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
519
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
520 If @var{noerror} is non-@code{nil}, signal an error if the inst-pair is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
521 invalid; otherwise return @code{t}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
522 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
523
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
524 @defun canonicalize-inst-list inst-list specifier-type &optional noerror
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
525 This function canonicalizes the given @var{inst-list} (a list of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
526 inst-pairs).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
527
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
528 @var{specifier-type} specifies the type of specifier that this @var{inst-list}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
529 will be used for.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
530
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
531 Canonicalizing means converting to the full form for an inst-list, i.e.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
532 @code{((@var{tag-set} . @var{instantiator}) ...)}. This function
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
533 accepts a single inst-pair or any abbreviation thereof or a list of
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
534 (possibly abbreviated) inst-pairs. (See @code{canonicalize-inst-pair}.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
535
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
536 If @var{noerror} is non-@code{nil}, signal an error if the inst-list is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
537 invalid; otherwise return @code{t}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
538 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
539
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
540 @defun canonicalize-spec spec specifier-type &optional noerror
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
541 This function canonicalizes the given @var{spec} (a specification).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
542
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
543 @var{specifier-type} specifies the type of specifier that this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
544 @var{spec-list} will be used for.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
545
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
546 Canonicalizing means converting to the full form for a spec, i.e.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
547 @code{(@var{locale} (@var{tag-set} . @var{instantiator}) ...)}. This
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
548 function accepts a possibly abbreviated inst-list or a cons of a locale
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
549 and a possibly abbreviated inst-list. (See
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
550 @code{canonicalize-inst-list}.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
551
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
552 If @var{noerror} is @code{nil}, signal an error if the specification is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
553 invalid; otherwise return @code{t}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
554 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
555
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
556 @defun canonicalize-spec-list spec-list specifier-type &optional noerror
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
557 This function canonicalizes the given @var{spec-list} (a list of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
558 specifications).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
559
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
560 @var{specifier-type} specifies the type of specifier that this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
561 @var{spec-list} will be used for.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
562
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
563 Canonicalizing means converting to the full form for a spec-list, i.e.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
564 @code{((@var{locale} (@var{tag-set} . @var{instantiator}) ...) ...)}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
565 This function accepts a possibly abbreviated specification or a list of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
566 such things. (See @code{canonicalize-spec}.) This is the function used
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
567 to convert spec-lists accepted by @code{set-specifier} and such into a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
568 form suitable for @code{add-spec-list-to-specifier}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
569
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
570 This function tries extremely hard to resolve any ambiguities,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
571 and the built-in specifier types (font, image, toolbar, etc.) are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
572 designed so that there won't be any ambiguities.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
573
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
574 If @var{noerror} is @code{nil}, signal an error if the spec-list is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
575 invalid; otherwise return @code{t}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
576 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
577
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
578 @node Retrieving Specifications
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
579 @section Retrieving the Specifications from a Specifier
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
580
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
581 @defun specifier-spec-list specifier &optional locale tag-set exact-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
582 This function returns the spec-list of specifications for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
583 @var{specifier} in @var{locale}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
584
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
585 If @var{locale} is a particular locale (a buffer, window, frame, device,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
586 or the symbol @code{global}), a spec-list consisting of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
587 specification for that locale will be returned.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
588
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
589 If @var{locale} is a locale type (i.e. a symbol @code{buffer},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
590 @code{window}, @code{frame}, or @code{device}), a spec-list of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
591 specifications for all locales of that type will be returned.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
592
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
593 If @var{locale} is @code{nil} or the symbol @code{all}, a spec-list of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
594 all specifications in @var{specifier} will be returned.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
595
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
596 @var{locale} can also be a list of locales, locale types, and/or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
597 @code{all}; the result is as if @code{specifier-spec-list} were called
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
598 on each element of the list and the results concatenated together.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
599
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
600 Only instantiators where @var{tag-set} (a list of zero or more tags) is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
601 a subset of (or possibly equal to) the instantiator's tag set are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
602 returned. (The default value of@code{ nil} is a subset of all tag sets,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
603 so in this case no instantiators will be screened out.) If @var{exact-p}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
604 is non-@code{nil}, however, @var{tag-set} must be equal to an
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
605 instantiator's tag set for the instantiator to be returned.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
606 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
607
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
608 @defun specifier-specs specifier &optional locale tag-set exact-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
609 This function returns the specification(s) for @var{specifier} in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
610 @var{locale}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
611
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
612 If @var{locale} is a single locale or is a list of one element
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
613 containing a single locale, then a ``short form'' of the instantiators
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
614 for that locale will be returned. Otherwise, this function is identical
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
615 to @code{specifier-spec-list}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
616
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
617 The ``short form'' is designed for readability and not for ease of use
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
618 in Lisp programs, and is as follows:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
619
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
620 @enumerate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
621 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
622 If there is only one instantiator, then an inst-pair (i.e. cons of tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
623 and instantiator) will be returned; otherwise a list of inst-pairs will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
624 be returned.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
625 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
626 For each inst-pair returned, if the instantiator's tag is @code{any},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
627 the tag will be removed and the instantiator itself will be returned
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
628 instead of the inst-pair.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
629 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
630 If there is only one instantiator, its value is @code{nil}, and its tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
631 is @code{any}, a one-element list containing @code{nil} will be returned
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
632 rather than just @code{nil}, to distinguish this case from there being
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
633 no instantiators at all.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
634 @end enumerate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
635
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
636 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
637
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
638 @defun specifier-fallback specifier
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
639 This function returns the fallback value for @var{specifier}. Fallback
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
640 values are provided by the C code for certain built-in specifiers to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
641 make sure that instancing won't fail even if all specs are removed from
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
642 the specifier, or to implement simple inheritance behavior (e.g. this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
643 method is used to ensure that faces other than @code{default} inherit
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
644 their attributes from @code{default}). By design, you cannot change the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
645 fallback value, and specifiers created with @code{make-specifier} will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
646 never have a fallback (although a similar, Lisp-accessible capability
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
647 may be provided in the future to allow for inheritance).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
648
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
649 The fallback value will be an inst-list that is instanced like
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
650 any other inst-list, a specifier of the same type as @var{specifier}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
651 (results in inheritance), or @code{nil} for no fallback.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
652
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
653 When you instance a specifier, you can explicitly request that the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
654 fallback not be consulted. (The C code does this, for example, when
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
655 merging faces.) See @code{specifier-instance}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
656 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
657
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
658 @node Specifier Tag Functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
659 @section Working With Specifier Tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
660
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
661 A specifier tag set is an entity that is attached to an instantiator
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
662 and can be used to restrict the scope of that instantiator to a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
663 particular device class or device type and/or to mark instantiators
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
664 added by a particular package so that they can be later removed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
665
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
666 A specifier tag set consists of a list of zero of more specifier tags,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
667 each of which is a symbol that is recognized by XEmacs as a tag. (The
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
668 valid device types and device classes are always tags, as are any tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
669 defined by @code{define-specifier-tag}.) It is called a ``tag set'' (as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
670 opposed to a list) because the order of the tags or the number of times
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
671 a particular tag occurs does not matter.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
672
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
673 Each tag has a predicate associated with it, which specifies whether
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
674 that tag applies to a particular device. The tags which are device
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
675 types and classes match devices of that type or class. User-defined
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
676 tags can have any predicate, or none (meaning that all devices match).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
677 When attempting to instance a specifier, a particular instantiator is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
678 only considered if the device of the domain being instanced over matches
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
679 all tags in the tag set attached to that instantiator.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
680
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
681 Most of the time, a tag set is not specified, and the instantiator gets
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
682 a null tag set, which matches all devices.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
683
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
684 @defun valid-specifier-tag-p tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
685 This function returns non-@code{nil} if @var{tag} is a valid specifier
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
686 tag.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
687 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
688
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
689 @defun valid-specifier-tag-set-p tag-set
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
690 This function returns non-@code{nil} if @var{tag-set} is a valid
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
691 specifier tag set.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
692 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
693
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
694 @defun canonicalize-tag-set tag-set
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
695 This function canonicalizes the given tag set. Two canonicalized tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
696 sets can be compared with @code{equal} to see if they represent the same
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
697 tag set. (Specifically, canonicalizing involves sorting by symbol name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
698 and removing duplicates.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
699 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
700
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
701 @defun device-matches-specifier-tag-set-p device tag-set
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
702 This function returns non-@code{nil} if @var{device} matches specifier
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
703 tag set @var{tag-set}. This means that @var{device} matches each tag in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
704 the tag set.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
705 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
706
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
707 @defun define-specifier-tag tag &optional predicate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
708 This function defines a new specifier tag. If @var{predicate} is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
709 specified, it should be a function of one argument (a device) that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
710 specifies whether the tag matches that particular device. If
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
711 @var{predicate} is omitted, the tag matches all devices.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
712
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
713 You can redefine an existing user-defined specifier tag. However, you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
714 cannot redefine the built-in specifier tags (the device types and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
715 classes) or the symbols @code{nil}, @code{t}, @code{all}, or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
716 @code{global}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
717 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
718
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
719 @defun device-matching-specifier-tag-list &optional device
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
720 This function returns a list of all specifier tags matching
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
721 @var{device}. @var{device} defaults to the selected device if omitted.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
722 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
723
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
724 @defun specifier-tag-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
725 This function returns a list of all currently-defined specifier tags.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
726 This includes the built-in ones (the device types and classes).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
727 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
728
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
729 @defun specifier-tag-predicate tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
730 This function returns the predicate for the given specifier tag.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
731 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
732
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
733 @node Specifier Instancing Functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
734 @section Functions for Instancing a Specifier
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
735
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
736 @defun specifier-instance specifier &optional domain default no-fallback
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
737 This function instantiates @var{specifier} (return its value) in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
738 @var{domain}. If no instance can be generated for this domain, return
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
739 @var{default}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
740
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
741 @var{domain} should be a window, frame, or device. Other values that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
742 are legal as a locale (e.g. a buffer) are not valid as a domain because
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
743 they do not provide enough information to identify a particular device
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
744 (see @code{valid-specifier-domain-p}). @var{domain} defaults to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
745 selected window if omitted.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
746
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
747 @dfn{Instantiating} a specifier in a particular domain means determining
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
748 the specifier's ``value'' in that domain. This is accomplished by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
749 searching through the specifications in the specifier that correspond to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
750 all locales that can be derived from the given domain, from specific to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
751 general. In most cases, the domain is an Emacs window. In that case
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
752 specifications are searched for as follows:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
753
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
754 @enumerate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
755 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
756 A specification whose locale is the window's buffer;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
757 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
758 A specification whose locale is the window itself;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
759 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
760 A specification whose locale is the window's frame;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
761 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
762 A specification whose locale is the window's frame's device;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
763 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
764 A specification whose locale is the symbol @code{global}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
765 @end enumerate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
766
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
767 If all of those fail, then the C-code-provided fallback value for this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
768 specifier is consulted (see @code{specifier-fallback}). If it is an
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
769 inst-list, then this function attempts to instantiate that list just as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
770 when a specification is located in the first five steps above. If the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
771 fallback is a specifier, @code{specifier-instance} is called recursively
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
772 on this specifier and the return value used. Note, however, that if the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
773 optional argument @var{no-fallback} is non-@code{nil}, the fallback
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
774 value will not be consulted.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
775
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
776 Note that there may be more than one specification matching a particular
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
777 locale; all such specifications are considered before looking for any
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
778 specifications for more general locales. Any particular specification
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
779 that is found may be rejected because it is tagged to a particular
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
780 device class (e.g. @code{color}) or device type (e.g. @code{x}) or both
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
781 and the device for the given domain does not match this, or because the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
782 specification is not valid for the device of the given domain (e.g. the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
783 font or color name does not exist for this particular X server).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
784
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
785 The returned value is dependent on the type of specifier. For example,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
786 for a font specifier (as returned by the @code{face-font} function), the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
787 returned value will be a font-instance object. For images, the returned
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
788 value will be a string, pixmap, or subwindow.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
789 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
790
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
791 @defun specifier-instance-from-inst-list specifier domain inst-list &optional default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
792 This function attempts to convert a particular inst-list into an
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
793 instance. This attempts to instantiate @var{inst-list} in the given
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
794 @var{domain}, as if @var{inst-list} existed in a specification in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
795 @var{specifier}. If the instantiation fails, @var{default} is returned.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
796 In most circumstances, you should not use this function; use
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
797 @code{specifier-instance} instead.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
798 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
799
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
800 @node Specifier Example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
801 @section Example of Specifier Usage
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
802
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
803 Now let us present an example to clarify the theoretical discussions we
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
804 have been through. In this example, we will use the general specifier
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
805 functions for clarity. Keep in mind that many types of specifiers, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
806 some other types of objects that are associated with specifiers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
807 (e.g. faces), provide convenience functions making it easier to work
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
808 with objects of that type.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
809
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
810 Let us consider the background color of the default face. A specifier
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
811 is used to specify how that color will appear in different domains.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
812 First, let's retrieve the specifier:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
813
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
814 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
815 (setq sp (face-property 'default 'background))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
816 @result{} #<color-specifier 0x3da>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
817 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
818
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
819 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
820 (specifier-specs sp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
821 @result{} ((#<buffer "device.c"> (nil . "forest green"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
822 (#<window on "Makefile" 0x8a2b> (nil . "hot pink"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
823 (#<x-frame "emacs" 0x4ac> (nil . "puke orange")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
824 (nil . "moccasin"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
825 (#<x-frame "VM" 0x4ac> (nil . "magenta"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
826 (global ((tty) . "cyan") (nil . "white"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
827 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
828 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
829
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
830 Then, say we want to determine what the background color of the default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
831 face is for the window currently displaying the buffer @samp{*scratch*}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
832 We call
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
833
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
834 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
835 (get-buffer-window "*scratch*")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
836 @result{} #<window on "*scratch*" 0x4ad>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
837 (window-frame (get-buffer-window "*scratch*"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
838 @result{} #<x-frame "emacs" 0x4ac>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
839 (specifier-instance sp (get-buffer-window "*scratch*"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
840 @result{} #<color-instance moccasin 47=(FFFF,E4E4,B5B5) 0x6309>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
841 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
842
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
843 Note that we passed a window to @code{specifier-instance}, not a buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
844 We cannot pass a buffer because a buffer by itself does not provide enough
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
845 information. The buffer might not be displayed anywhere at all, or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
846 could be displayed in many different frames on different devices.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
847
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
848 The result is arrived at like this:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
849
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
850 @enumerate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
851 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
852 First, we look for a specification matching the buffer displayed in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
853 window, i.e. @samp{*scratch}. There are none, so we proceed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
854 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
855 Then, we look for a specification matching the window itself. Again, there
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
856 are none.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
857 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
858 Then, we look for a specification matching the window's frame. The
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
859 specification @code{(#<x-frame "emacs" 0x4ac> . "puke orange")} is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
860 found. We call the instantiation method for colors, passing it the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
861 locale we were searching over (i.e. the window, in this case) and the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
862 instantiator (@samp{"puke orange"}). However, the particular device
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
863 which this window is on (let's say it's an X connection) doesn't
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
864 recognize the color @samp{"puke orange"}, so the specification is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
865 rejected.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
866 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
867 So we continue looking for a specification matching the window's frame.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
868 We find @samp{(#<x-frame "emacs" 0x4ac> . "moccasin")}. Again, we
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
869 call the instantiation method for colors. This time, the X server
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
870 our window is on recognizes the color @samp{moccasin}, and so the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
871 instantiation method succeeds and returns a color instance.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
872 @end enumerate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
873
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
874 @node Creating Specifiers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
875 @section Creating New Specifier Objects
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
876
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
877 @defun make-specifier type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
878 This function creates a new specifier.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
879
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
880 A specifier is an object that can be used to keep track of a property
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
881 whose value can be per-buffer, per-window, per-frame, or per-device,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
882 and can further be restricted to a particular device-type or device-class.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
883 Specifiers are used, for example, for the various built-in properties of a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
884 face; this allows a face to have different values in different frames,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
885 buffers, etc. For more information, see `specifier-instance',
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
886 `specifier-specs', and `add-spec-to-specifier'; or, for a detailed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
887 description of specifiers, including how they are instantiated over a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
888 particular domain (i.e. how their value in that domain is determined),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
889 see the chapter on specifiers in the XEmacs Lisp Reference Manual.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
890
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
891 @var{type} specifies the particular type of specifier, and should be one
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
892 of the symbols @code{generic}, @code{integer}, @code{natnum},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
893 @code{boolean}, @code{color}, @code{font}, @code{image},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
894 @code{face-boolean}, or @code{toolbar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
895
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
896 For more information on particular types of specifiers, see the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
897 functions @code{generic-specifier-p}, @code{integer-specifier-p},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
898 @code{natnum-specifier-p}, @code{boolean-specifier-p},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
899 @code{color-specifier-p}, @code{font-specifier-p},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
900 @code{image-specifier-p}, @code{face-boolean-specifier-p}, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
901 @code{toolbar-specifier-p}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
902 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
903
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
904 @defun make-specifier-and-init type spec-list &optional dont-canonicalize
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
905 This function creates and initialize a new specifier.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
906
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
907 This is a front-end onto @code{make-specifier} that allows you to create
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
908 a specifier and add specs to it at the same time. @var{type} specifies
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
909 the specifier type. @var{spec-list} supplies the specification(s) to be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
910 added to the specifier. Normally, almost any reasonable abbreviation of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
911 the full spec-list form is accepted, and is converted to the full form;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
912 however, if optional argument @var{dont-canonicalize} is non-@code{nil},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
913 this conversion is not performed, and the @var{spec-list} must already
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
914 be in full form. See @code{canonicalize-spec-list}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
915 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
916
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
917 @node Specifier Validation Functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
918 @section Functions for Checking the Validity of Specifier Components
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
919
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
920 @defun valid-specifier-domain-p domain
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
921 This function returns non-@code{nil} if @var{domain} is a valid
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
922 specifier domain. A domain is used to instance a specifier
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
923 (i.e. determine the specifier's value in that domain). Valid domains
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
924 are a window, frame, or device. (@code{nil} is not valid.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
925 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
926
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
927 @defun valid-specifier-locale-p locale
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
928 This function returns non-@code{nil} if @var{locale} is a valid
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
929 specifier locale. Valid locales are a device, a frame, a window, a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
930 buffer, and @code{global}. (@code{nil} is not valid.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
931 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
932
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
933 @defun valid-specifier-locale-type-p locale-type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
934 Given a specifier @var{locale-type}, this function returns non-nil if it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
935 is valid. Valid locale types are the symbols @code{global},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
936 @code{device}, @code{frame}, @code{window}, and @code{buffer}. (Note,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
937 however, that in functions that accept either a locale or a locale type,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
938 @code{global} is considered an individual locale.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
939 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
940
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
941 @defun valid-specifier-type-p specifier-type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
942 Given a @var{specifier-type}, this function returns non-@code{nil} if it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
943 is valid. Valid types are @code{generic}, @code{integer},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
944 @code{boolean}, @code{color}, @code{font}, @code{image},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
945 @code{face-boolean}, and @code{toolbar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
946 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
947
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
948 @defun valid-specifier-tag-p tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
949 This function returns non-@code{nil} if @var{tag} is a valid specifier
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
950 tag.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
951 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
952
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
953 @defun valid-instantiator-p instantiator specifier-type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
954 This function returns non-@code{nil} if @var{instantiator} is valid for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
955 @var{specifier-type}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
956 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
957
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
958 @defun valid-inst-list-p inst-list type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
959 This function returns non-@code{nil} if @var{inst-list} is valid for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
960 specifier type @var{type}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
961 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
962
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
963 @defun valid-spec-list-p spec-list type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
964 This function returns non-@code{nil} if @var{spec-list} is valid for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
965 specifier type @var{type}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
966 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
967
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
968 @defun check-valid-instantiator instantiator specifier-type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
969 This function signals an error if @var{instantiator} is invalid for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
970 @var{specifier-type}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
971 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
972
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
973 @defun check-valid-inst-list inst-list type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
974 This function signals an error if @var{inst-list} is invalid for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
975 specifier type @var{type}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
976 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
977
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
978 @defun check-valid-spec-list spec-list type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
979 This function signals an error if @var{spec-list} is invalid for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
980 specifier type @var{type}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
981 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
982
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
983 @node Other Specification Functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
984 @section Other Functions for Working with Specifications in a Specifier
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
985
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
986 @defun copy-specifier specifier &optional dest locale tag-set exact-p how-to-add
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
987 This function copies @var{specifier} to @var{dest}, or creates a new one
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
988 if @var{dest} is @code{nil}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
989
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
990 If @var{dest} is @code{nil} or omitted, a new specifier will be created
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
991 and the specifications copied into it. Otherwise, the specifications
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
992 will be copied into the existing specifier in @var{dest}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
993
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
994 If @var{locale} is @code{nil} or the symbol @code{all}, all
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
995 specifications will be copied. If @var{locale} is a particular locale,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
996 the specification for that particular locale will be copied. If
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
997 @var{locale} is a locale type, the specifications for all locales of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
998 that type will be copied. @var{locale} can also be a list of locales,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
999 locale types, and/or @code{all}; this is equivalent to calling
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1000 @code{copy-specifier} for each of the elements of the list. See
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1001 @code{specifier-spec-list} for more information about @var{locale}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1002
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1003 Only instantiators where @var{tag-set} (a list of zero or more tags) is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1004 a subset of (or possibly equal to) the instantiator's tag set are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1005 copied. (The default value of @code{nil} is a subset of all tag sets,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1006 so in this case no instantiators will be screened out.) If @var{exact-p}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1007 is non-@code{nil}, however, @var{tag-set} must be equal to an
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1008 instantiator's tag set for the instantiator to be copied.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1009
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1010 Optional argument @var{how-to-add} specifies what to do with existing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1011 specifications in @var{dest}. If nil, then whichever locales or locale
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1012 types are copied will first be completely erased in @var{dest}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1013 Otherwise, it is the same as in @code{add-spec-to-specifier}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1014 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1015
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1016 @defun remove-specifier specifier &optional locale tag-set exact-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1017 This function removes specification(s) for @var{specifier}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1018
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1019 If @var{locale} is a particular locale (a buffer, window, frame, device,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1020 or the symbol @code{global}), the specification for that locale will be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1021 removed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1022
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1023 If instead, @var{locale} is a locale type (i.e. a symbol @code{buffer},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1024 @code{window}, @code{frame}, or @code{device}), the specifications for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1025 all locales of that type will be removed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1026
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1027 If @var{locale} is @code{nil} or the symbol @code{all}, all
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1028 specifications will be removed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1029
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1030 @var{locale} can also be a list of locales, locale types, and/or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1031 @code{all}; this is equivalent to calling @code{remove-specifier} for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1032 each of the elements in the list.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1033
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1034 Only instantiators where @var{tag-set} (a list of zero or more tags) is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1035 a subset of (or possibly equal to) the instantiator's tag set are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1036 removed. (The default value of @code{nil} is a subset of all tag sets,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1037 so in this case no instantiators will be screened out.) If @var{exact-p}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1038 is non-@code{nil}, however, @var{tag-set} must be equal to an
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1039 instantiator's tag set for the instantiator to be removed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1040 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1041
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1042 @defun map-specifier specifier func &optional locale maparg
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1043 This function applies @var{func} to the specification(s) for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1044 @var{locale} in @var{specifier}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1045
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1046 If @var{locale} is a locale, @var{func} will be called for that locale.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1047 If @var{locale} is a locale type, @var{func} will be mapped over all
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1048 locales of that type. If @var{locale} is @code{nil} or the symbol
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1049 @code{all}, @var{func} will be mapped over all locales in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1050 @var{specifier}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1051
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1052 @var{func} is called with four arguments: the @var{specifier}, the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1053 locale being mapped over, the inst-list for that locale, and the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1054 optional @var{maparg}. If any invocation of @var{func} returns
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1055 non-@code{nil}, the mapping will stop and the returned value becomes the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1056 value returned from @code{map-specifier}. Otherwise,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1057 @code{map-specifier} returns @code{nil}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1058 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1059
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1060 @defun specifier-locale-type-from-locale locale
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1061 Given a specifier @var{locale}, this function returns its type.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1062 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1063