comparison man/lispref/specifiers.texi @ 444:576fb035e263 r21-2-37

Import from CVS: tag r21-2-37
author cvs
date Mon, 13 Aug 2007 11:36:19 +0200
parents abe6d1db359e
children 9eddcb9548e2
comparison
equal deleted inserted replaced
443:a8296e22da4e 444:576fb035e263
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 480
481 @deffn Macro let-specifier specifier-list &rest body 481 @defspec let-specifier specifier-list &rest body
482 This special form temporarily adds specifications to specifiers, 482 This special form temporarily adds specifications to specifiers,
483 evaluates forms in @var{body} and restores the specifiers to their 483 evaluates forms in @var{body} and restores the specifiers to their
484 previous states. The specifiers and their temporary specifications are 484 previous states. The specifiers and their temporary specifications are
485 listed in @var{specifier-list}. 485 listed in @var{specifier-list}.
486 486
514 514
515 @example 515 @example
516 (let-specifier ((modeline-shadow-thickness 0 (selected-window))) 516 (let-specifier ((modeline-shadow-thickness 0 (selected-window)))
517 (sit-for 1)) 517 (sit-for 1))
518 @end example 518 @end example
519 @end deffn 519 @end defspec
520 520
521 @defun set-specifier specifier value &optional how-to-add 521 @defun set-specifier specifier value &optional locale tag-set how-to-add
522 This function adds some specifications to @var{specifier}. @var{value} 522 This function adds some specifications to @var{specifier}. @var{value}
523 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
524 specification), a list of tagged and/or untagged instantiators (added as 524 specification), a list of tagged and/or untagged instantiators (added as
525 a global specification), a cons of a locale and instantiator or locale 525 a global specification), a cons of a locale and instantiator or locale
526 and instantiator list, a list of such conses, or nearly any other 526 and instantiator list, a list of such conses, or nearly any other
527 reasonable form. More specifically, @var{value} can be anything 527 reasonable form. More specifically, @var{value} can be anything
528 accepted by @code{canonicalize-spec-list}. 528 accepted by @code{canonicalize-spec-list}.
529 529
530 @var{how-to-add} is the same as in @code{add-spec-to-specifier}. 530 @var{locale}, @var{tag-set}, and @var{how-to-add} are the same as in
531 @code{add-spec-to-specifier}.
531 532
532 Note that @code{set-specifier} is exactly complementary to 533 Note that @code{set-specifier} is exactly complementary to
533 @code{specifier-specs} except in the case where @var{specifier} has no 534 @code{specifier-specs} except in the case where @var{specifier} has no
534 specs at all in it but @code{nil} is a valid instantiator (in that case, 535 specs at all in it but @code{nil} is a valid instantiator (in that case,
535 @code{specifier-specs} will return @code{nil} (meaning no specs) and 536 @code{specifier-specs} will return @code{nil} (meaning no specs) and
624 625
625 If @var{locale} is a particular locale (a window, buffer, frame, device, 626 If @var{locale} is a particular locale (a window, buffer, frame, device,
626 or the symbol @code{global}), a spec-list consisting of the 627 or the symbol @code{global}), a spec-list consisting of the
627 specification for that locale will be returned. 628 specification for that locale will be returned.
628 629
629 If @var{locale} is a locale type (i.e. a symbol @code{window}, 630 If @var{locale} is a locale type (i.e. one of the symbols @code{window},
630 @code{buffer}, @code{frame}, or @code{device}), a spec-list of the 631 @code{buffer}, @code{frame}, or @code{device}), a spec-list of the
631 specifications for all locales of that type will be returned. 632 specifications for all locales of that type will be returned.
632 633
633 If @var{locale} is @code{nil} or the symbol @code{all}, a spec-list of 634 If @var{locale} is @code{nil} or the symbol @code{all}, a spec-list of
634 all specifications in @var{specifier} will be returned. 635 all specifications in @var{specifier} will be returned.
637 @code{all}; the result is as if @code{specifier-spec-list} were called 638 @code{all}; the result is as if @code{specifier-spec-list} were called
638 on each element of the list and the results concatenated together. 639 on each element of the list and the results concatenated together.
639 640
640 Only instantiators where @var{tag-set} (a list of zero or more tags) is 641 Only instantiators where @var{tag-set} (a list of zero or more tags) is
641 a subset of (or possibly equal to) the instantiator's tag set are 642 a subset of (or possibly equal to) the instantiator's tag set are
642 returned. (The default value of@code{ nil} is a subset of all tag sets, 643 returned. (The default value of @code{nil} is a subset of all tag sets,
643 so in this case no instantiators will be screened out.) If @var{exact-p} 644 so in this case no instantiators will be screened out.) If @var{exact-p}
644 is non-@code{nil}, however, @var{tag-set} must be equal to an 645 is non-@code{nil}, however, @var{tag-set} must be equal to an
645 instantiator's tag set for the instantiator to be returned. 646 instantiator's tag set for the instantiator to be returned.
646 @end defun 647 @end defun
647 648
920 A specifier is an object that can be used to keep track of a property 921 A specifier is an object that can be used to keep track of a property
921 whose value can be per-buffer, per-window, per-frame, or per-device, 922 whose value can be per-buffer, per-window, per-frame, or per-device,
922 and can further be restricted to a particular device-type or device-class. 923 and can further be restricted to a particular device-type or device-class.
923 Specifiers are used, for example, for the various built-in properties of a 924 Specifiers are used, for example, for the various built-in properties of a
924 face; this allows a face to have different values in different frames, 925 face; this allows a face to have different values in different frames,
925 buffers, etc. For more information, see `specifier-instance', 926 buffers, etc. For more information, see @code{specifier-instance},
926 `specifier-specs', and `add-spec-to-specifier'; or, for a detailed 927 @code{specifier-specs}, and @code{add-spec-to-specifier}; or, for a detailed
927 description of specifiers, including how they are instantiated over a 928 description of specifiers, including how they are instantiated over a
928 particular domain (i.e. how their value in that domain is determined), 929 particular domain (i.e. how their value in that domain is determined),
929 see the chapter on specifiers in the XEmacs Lisp Reference Manual. 930 see the chapter on specifiers in the XEmacs Lisp Reference Manual.
930 931
931 @var{type} specifies the particular type of specifier, and should be one 932 @var{type} specifies the particular type of specifier, and should be one
1022 specifier locale. Valid locales are a device, a frame, a window, a 1023 specifier locale. Valid locales are a device, a frame, a window, a
1023 buffer, and @code{global}. (@code{nil} is not valid.) 1024 buffer, and @code{global}. (@code{nil} is not valid.)
1024 @end defun 1025 @end defun
1025 1026
1026 @defun valid-specifier-locale-type-p locale-type 1027 @defun valid-specifier-locale-type-p locale-type
1027 Given a specifier @var{locale-type}, this function returns non-nil if it 1028 Given a specifier @var{locale-type}, this function returns non-@code{nil} if it
1028 is valid. Valid locale types are the symbols @code{global}, 1029 is valid. Valid locale types are the symbols @code{global},
1029 @code{device}, @code{frame}, @code{window}, and @code{buffer}. (Note, 1030 @code{device}, @code{frame}, @code{window}, and @code{buffer}. (Note,
1030 however, that in functions that accept either a locale or a locale type, 1031 however, that in functions that accept either a locale or a locale type,
1031 @code{global} is considered an individual locale.) 1032 @code{global} is considered an individual locale.)
1032 @end defun 1033 @end defun
1099 so in this case no instantiators will be screened out.) If @var{exact-p} 1100 so in this case no instantiators will be screened out.) If @var{exact-p}
1100 is non-@code{nil}, however, @var{tag-set} must be equal to an 1101 is non-@code{nil}, however, @var{tag-set} must be equal to an
1101 instantiator's tag set for the instantiator to be copied. 1102 instantiator's tag set for the instantiator to be copied.
1102 1103
1103 Optional argument @var{how-to-add} specifies what to do with existing 1104 Optional argument @var{how-to-add} specifies what to do with existing
1104 specifications in @var{dest}. If nil, then whichever locales or locale 1105 specifications in @var{dest}. If @code{nil}, then whichever locales or locale
1105 types are copied will first be completely erased in @var{dest}. 1106 types are copied will first be completely erased in @var{dest}.
1106 Otherwise, it is the same as in @code{add-spec-to-specifier}. 1107 Otherwise, it is the same as in @code{add-spec-to-specifier}.
1107 @end defun 1108 @end defun
1108 1109
1109 @defun remove-specifier specifier &optional locale tag-set exact-p 1110 @defun remove-specifier specifier &optional locale tag-set exact-p