comparison man/lispref/specifiers.texi @ 290:c9fe270a4101 r21-0b43

Import from CVS: tag r21-0b43
author cvs
date Mon, 13 Aug 2007 10:36:47 +0200
parents 360340f9fd5f
children 54f7aa390f4f
comparison
equal deleted inserted replaced
289:6e6992ccc4b6 290:c9fe270a4101
139 of the default face and @dfn{instances} it in the domain given by that 139 of the default face and @dfn{instances} it in the domain given by that
140 window; in other words, it asks the specifier, ``What is your value in 140 window; in other words, it asks the specifier, ``What is your value in
141 this window?''. 141 this window?''.
142 142
143 More specifically, a specifier contains a set of @dfn{specifications}, 143 More specifically, a specifier contains a set of @dfn{specifications},
144 each of which associates a @dfn{locale} (a buffer object, a window 144 each of which associates a @dfn{locale} (a window object, a buffer
145 object, a frame object, a device object, or the symbol @code{global}) 145 object, a frame object, a device object, or the symbol @code{global})
146 with an @dfn{inst-list}, which is a list of one or more 146 with an @dfn{inst-list}, which is a list of one or more
147 @dfn{inst-pairs}. (For each possible locale, there can be at most one 147 @dfn{inst-pairs}. (For each possible locale, there can be at most one
148 specification containing that locale.) Each inst-pair is a cons of a 148 specification containing that locale.) Each inst-pair is a cons of a
149 @dfn{tag set} (an unordered list of zero or more symbols, or @dfn{tags}) 149 @dfn{tag set} (an unordered list of zero or more symbols, or @dfn{tags})
208 follows: 208 follows:
209 209
210 @itemize @bullet 210 @itemize @bullet
211 @item 211 @item
212 First, XEmacs searches for a specification whose locale is the same as 212 First, XEmacs searches for a specification whose locale is the same as
213 the window's buffer. If that fails, the search is repeated, looking for 213 the window. If that fails, the search is repeated, looking for a locale
214 a locale that is the same as the window itself. If that fails, the 214 that is the same as the window's buffer. If that fails, the search is
215 search is repeated using the window's frame, then using the device that 215 repeated using the window's frame, then using the device that frame is
216 frame is on. Finally, the specification whose locale is the symbol 216 on. Finally, the specification whose locale is the symbol @code{global}
217 @code{global} (if there is such a specification) is considered. 217 (if there is such a specification) is considered.
218 @item 218 @item
219 The inst-pairs contained in the specification that was found are 219 The inst-pairs contained in the specification that was found are
220 considered in their order in the inst-list, looking for one whose tag 220 considered in their order in the inst-list, looking for one whose tag
221 set matches the device that is derived from the window domain. (The 221 set matches the device that is derived from the window domain. (The
222 tag set is an unordered list of zero or more tag symbols. For all 222 tag set is an unordered list of zero or more tag symbols. For all
223 tags that have predicates associated with them, the predicate must 223 tags that have predicates associated with them, the predicate must
224 match the device.) 224 match the device.)
225 @item 225 @item
226 If a matching tag set is found, the corresponding instantiator is passed 226 If a matching tag set is found, the corresponding instantiator is passed
397 @node Adding Specifications 397 @node Adding Specifications
398 @section Adding specifications to a Specifier 398 @section Adding specifications to a Specifier
399 399
400 @defun add-spec-to-specifier specifier instantiator &optional locale tag-set how-to-add 400 @defun add-spec-to-specifier specifier instantiator &optional locale tag-set how-to-add
401 This function adds a specification to @var{specifier}. The 401 This function adds a specification to @var{specifier}. The
402 specification maps from @var{locale} (which should be a buffer, window, 402 specification maps from @var{locale} (which should be a window, buffer,
403 frame, device, or the symbol @code{global}, and defaults to 403 frame, device, or the symbol @code{global}, and defaults to
404 @code{global}) to @var{instantiator}, whose allowed values depend on the 404 @code{global}) to @var{instantiator}, whose allowed values depend on the
405 type of the specifier. Optional argument @var{tag-set} limits the 405 type of the specifier. Optional argument @var{tag-set} limits the
406 instantiator to apply only to the specified tag set, which should be a 406 instantiator to apply only to the specified tag set, which should be a
407 list of tags all of which must match the device being instantiated over 407 list of tags all of which must match the device being instantiated over
451 451
452 where 452 where
453 453
454 @itemize @bullet 454 @itemize @bullet
455 @item 455 @item
456 @var{locale} := a buffer, a window, a frame, a device, or @code{global} 456 @var{locale} := a window, a buffer, a frame, a device, or @code{global}
457 @item 457 @item
458 @var{tag-set} := an unordered list of zero or more @var{tags}, each of 458 @var{tag-set} := an unordered list of zero or more @var{tags}, each of
459 which is a symbol 459 which is a symbol
460 @item 460 @item
461 @var{tag} := a device class (@pxref{Consoles and Devices}), a device type, 461 @var{tag} := a device class (@pxref{Consoles and Devices}), a device type,
475 @code{add-spec-to-specifier}. 475 @code{add-spec-to-specifier}.
476 476
477 In many circumstances, the higher-level function @code{set-specifier} is 477 In many circumstances, the higher-level function @code{set-specifier} is
478 more convenient and should be used instead. 478 more convenient and should be used instead.
479 @end defun 479 @end defun
480
481 @deffn Macro let-specifier specifier-list &rest body
482 This special form temporarily adds specifications to specifiers,
483 evaluates forms in @var{body} and restores the specifiers to their
484 previous states. The specifiers and their temporary specifications are
485 listed in @var{specifier-list}.
486
487 The format of @var{specifier-list} is
488
489 @example
490 ((@var{specifier} @var{value} &optional @var{locale} @var{tag-set} @var{how-to-add}) ...)
491 @end example
492
493 @var{specifier} is the specifier to be temporarily modified.
494 @var{value} is the instantiator to be temporarily added to specifier in
495 @var{locale}. @var{locale}, @var{tag-set} and @var{how-to-add} have the
496 same meaning as in @code{add-spec-to-specifier}.
497
498 This special form is implemented as a macro; the code resulting from
499 macro expansion will add specifications to specifiers using
500 @code{add-spec-to-specifier}. After forms in @var{body} are evaluated,
501 the temporary specifications are removed and old specifier spec-lists
502 are restored.
503
504 @var{locale}, @var{tag-set} and @var{how-to-add} may be omitted, and
505 default to @code{nil}. The value of the last form in @var{body} is
506 returned.
507
508 NOTE: If you want the specifier's instance to change in all
509 circumstances, use @code{(selected-window)} as the @var{locale}. If
510 @var{locale} is @code{nil} or omitted, it defaults to @code{global}.
511
512 The following example removes the 3D modeline effect in the currently
513 selected window for the duration of a second:
514
515 @example
516 (let-specifier ((modeline-shadow-thickness 0 (selected-window)))
517 (sit-for 1))
518 @end example
519 @end deffn
480 520
481 @defun set-specifier specifier value &optional how-to-add 521 @defun set-specifier specifier value &optional how-to-add
482 This function adds some specifications to @var{specifier}. @var{value} 522 This function adds some specifications to @var{specifier}. @var{value}
483 can be a single instantiator or tagged instantiator (added as a global 523 can be a single instantiator or tagged instantiator (added as a global
484 specification), a list of tagged and/or untagged instantiators (added as 524 specification), a list of tagged and/or untagged instantiators (added as
580 620
581 @defun specifier-spec-list specifier &optional locale tag-set exact-p 621 @defun specifier-spec-list specifier &optional locale tag-set exact-p
582 This function returns the spec-list of specifications for 622 This function returns the spec-list of specifications for
583 @var{specifier} in @var{locale}. 623 @var{specifier} in @var{locale}.
584 624
585 If @var{locale} is a particular locale (a buffer, window, frame, device, 625 If @var{locale} is a particular locale (a window, buffer, frame, device,
586 or the symbol @code{global}), a spec-list consisting of the 626 or the symbol @code{global}), a spec-list consisting of the
587 specification for that locale will be returned. 627 specification for that locale will be returned.
588 628
589 If @var{locale} is a locale type (i.e. a symbol @code{buffer}, 629 If @var{locale} is a locale type (i.e. a symbol @code{window},
590 @code{window}, @code{frame}, or @code{device}), a spec-list of the 630 @code{buffer}, @code{frame}, or @code{device}), a spec-list of the
591 specifications for all locales of that type will be returned. 631 specifications for all locales of that type will be returned.
592 632
593 If @var{locale} is @code{nil} or the symbol @code{all}, a spec-list of 633 If @var{locale} is @code{nil} or the symbol @code{all}, a spec-list of
594 all specifications in @var{specifier} will be returned. 634 all specifications in @var{specifier} will be returned.
595 635
751 general. In most cases, the domain is an Emacs window. In that case 791 general. In most cases, the domain is an Emacs window. In that case
752 specifications are searched for as follows: 792 specifications are searched for as follows:
753 793
754 @enumerate 794 @enumerate
755 @item 795 @item
796 A specification whose locale is the window itself;
797 @item
756 A specification whose locale is the window's buffer; 798 A specification whose locale is the window's buffer;
757 @item
758 A specification whose locale is the window itself;
759 @item 799 @item
760 A specification whose locale is the window's frame; 800 A specification whose locale is the window's frame;
761 @item 801 @item
762 A specification whose locale is the window's frame's device; 802 A specification whose locale is the window's frame's device;
763 @item 803 @item