48.4 How a Specifier Is Instanced
Instancing of a specifier in a particular window domain proceeds as
follows:
- First, SXEmacs searches for a specification whose locale is the same as
the window. If that fails, the search is repeated, looking for a locale
that is the same as the window’s buffer. If that fails, the search is
repeated using the window’s frame, then using the device that frame is
on. Finally, the specification whose locale is the symbol
global
(if there is such a specification) is considered.
- The inst-pairs contained in the specification that was found are
considered in their order in the inst-list, looking for one whose tag
set matches the device that is derived from the window domain. (The
tag set is an unordered list of zero or more tag symbols. For all
tags that have predicates associated with them, the predicate must
match the device.)
- If a matching tag set is found, the corresponding instantiator is passed
to the specifier’s instantiation method, which is specific to the type
of the specifier. If it succeeds, the resulting instance object is
returned as the result of the instancing and the instancing is done.
Otherwise, the operation continues, looking for another matching
inst-pair in the current specification.
- When there are no more inst-pairs to be considered in the current
specification, the search starts over, looking for another specification
as in the first step above.
- If all specifications are exhausted and no instance object can be
derived, the instancing fails. (Actually, this is not completely true.
Some specifier objects for built-in properties have a fallback
value, which is either an inst-list or another specifier object, that is
consulted if the instancing is about to fail. If it is an inst-list,
the searching proceeds using the inst-pairs in that list. If it is a
specifier, the entire instancing starts over using that specifier
instead of the given one. Fallback values are set by the C code and
cannot be modified, except perhaps indirectly, using any Lisp functions.
The purpose of them is to supply some values to make sure that
instancing of built-in properties can’t fail and to implement some basic
specifier inheritance, such as the fact that faces inherit their
properties from the
default
face.)
It is also possible to instance a specifier over a frame domain or
device domain instead of over a window domain. The C code, for example,
instances the top-toolbar-height
variable over a frame domain in
order to determine the height of a frame’s top toolbar. Instancing over
a frame or device is similar to instancing over a window except that
specifications for locales that cannot be derived from the domain are
ignored. Specifically, instancing over a frame looks first for frame
locales, then device locales, then the global
locale. Instancing
over a device domain looks only for device locales and the global
locale.