Changes between Version 3 and Version 4 of HemlockProgrammer/CharacterAttributes


Ignore:
Timestamp:
Jan 15, 2008, 1:29:38 AM (12 years ago)
Author:
gz
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • HemlockProgrammer/CharacterAttributes

    v3 v4  
     1[HemlockProgrammer Back to Table of Contents]
    12[[PageOutline]]
    23
    34= 9. Character Attributes =
    45
    5 == 9.1. Introduction ==
     6== 9.1. Introduction ==#Introduction
    67
    78Character attributes provide a global database of information about
     
    303120).
    3132
    32 syntax-char-code-limit [Constant]
    33 
    34 The exclusive upper bound on character codes which are significant in
    35 the character attribute functions.  Font and bits are always ignored.
    36 
    37 == 9.2. Character Attribute Names ==
     33== 9.2. Character Attribute Names ==#CharacterAttributeNames
    3834
    3935As for Hemlock variables, character attributes have a user visible
     
    4238spaces, is translated into a keyword by replacing all spaces with
    4339hyphens and interning this string in the keyword package.  The
    44 attribute named Ada Syntax would thus become :ada-syntax.
     40attribute named "Ada Syntax" would thus become :ada-syntax.
    4541
    46 *character-attribute-names* [Variable]
     42`*character-attribute-names*` [Variable]
    4743
    4844Whenever a character attribute is defined, its name is entered in this
    4945string table (page 69), with the corresponding keyword as the value.
    5046
    51 == 9.3. Character Attribute Functions ==
     47== 9.3. Character Attribute Functions ==#CharacterAttributeFunctions
    5248
    53 defattribute name documentation &optional type initial-value [Function]
     49`defattribute` name documentation &optional type initial-value [Function]
    5450
    5551This function defines a new character attribute with name, a
    56 simple-string.  Character attribute operations take attribute
     52string.  Character attribute operations take attribute
    5753arguments as a keyword whose name is name uppercased with spaces
    5854replaced by hyphens.
     
    6258Type, which defaults to (mod 2), specifies what type the values of the
    6359character attribute are.  Values of a character attribute may be of
    64 any type which may be specified tomake-array. Initial-value (default
     60any type which may be specified to make-array. Initial-value (default
    65610) is the value which all characters will initially have for this
    6662attribute.
    6763
    68 character-attribute-nameattribute [Function]
     64`character-attribute-name` attribute [Function][[BR]]
     65`character-attribute-documentation` attribute [Function][[BR]]
    6966
    70 character-attribute-documentationattribute [Function]
     67These functions return the name or documentation for attribute.
    7168
    72 These functions return the name or documentation forattribute.
    73 
    74 character-attribute attribute character [Function]
    75 
    76 Character Attribute Hook [Hemlock Variable]
     69`character-attribute` attribute character [Function][[BR]]
     70`Character Attribute Hook` [Hemlock Variable][[BR]]
    7771
    7872character-attribute returns the value of attribute for character. This
     
    8882use of character attributes in many cases.
    8983
    90 character-attribute-p symbol [Function]
     84`character-attribute-p` symbol [Function]
    9185
    9286This function returns t if symbolis the name of a character attribute,
    9387nil otherwise.
    9488
    95 shadow-attribute attribute character value mode [Function]
    96 
    97 Shadow Attribute Hook [Hemlock Variable]
     89`shadow-attribute` attribute character value mode [Function][[BR]]
     90`Shadow Attribute Hook` [Hemlock Variable][[BR]]
    9891
    9992This function establishes value as the value of character's attribute
     
    10497the global one.
    10598
    106 unshadow-attribute attribute character mode [Function]
    107 
    108 Unshadow Attribute Hook [Hemlock Variable]
     99`unshadow-attribute` attribute character mode [Function][[BR]]
     100`Unshadow Attribute Hook` [Hemlock Variable][[BR]]
    109101
    110102Make the value of attribute for character no longer be shadowed in
     
    112104this function is called.
    113105
    114 find-attribute mark attribute &optional test [Function]
    115 
    116 reverse-find-attribute mark attribute &optional test [Function]
     106`find-attribute` mark attribute &optional test [Function][[BR]]
     107`reverse-find-attribute` mark attribute &optional test [Function][[BR]]
    117108
    118109These functions find the next (or previous) character with some value
     
    122113for reverse-find-attribute) the character which satisfied the test.
    123114If no characters satisfy the test, then these return nil, and mark
    124 remains unmodified. Test defaults to not zerop. There is no guarantee
     115remains unmodified. Test defaults to `#'not-zerop`. There is no guarantee
    125116that the test is applied in any particular fashion, so it should have
    126117no side effects and depend only on its argument.
    127118
    128 == 9.4. Character Attribute Hooks ==
     119`find-not-attribute` mark attribute [Function][[BR]]
     120`reverse-find-not-attribute` mark attribute [Function][[BR]]
     121
     122These are equivalent to (find-attribute mark attribute #'zerop) and
     123(reverse-find-attribute mark attribute #'zerop), respectively.
     124
     125== 9.4. Character Attribute Hooks ==#CharacterAttributeHooks
    129126
    130127It is often useful to use the character attribute mechanism as an
     
    132129is stored elsewhere.  For example, some implementation of Hemlock
    133130might decide to define a Print Representation attribute which controls
    134 how a character is displayed on the screen.
     131how a character is displayed on an output device.
    135132
    136133To make this easy to do, each attribute has a list of hook functions
     
    138135the current value changes for any reason.
    139136
    140 character-attribute-hooks attribute [Function]
     137`character-attribute-hooks` attribute [Function]
    141138
    142139Return the current hook list for attribute. This may be set with
     
    144141manipulate these lists.
    145142
    146 == 9.5. System Defined Character Attributes ==
     143== 9.5. System Defined Character Attributes ==#SystemDefinedCharacterAttributes
    147144
    148145These are predefined in Hemlock:
    149146
    150  Whitespace::
     147 "Whitespace"::
    151148 A value of 1 indicates the character is whitespace.
    152149
    153  Word Delimiter::
     150 "Word Delimiter"::
    154151 A value of 1 indicates the character separates words (see section 15.3).
    155152
    156  Digit::
    157  A value of 1 indicates the character is a base ten digit.  This may
    158  be shadowed in modes or buffers to mean something else.
    159  
    160  Space::
     153 "Space"::
    161154 This is like Whitespace, but it should not include Newline. Hemlock
    162155 uses this primarily for handling indentation on a line.
    163156
    164  Sentence Terminator::
     157 "Sentence Terminator"::
    165158 A value of 1 indicates these characters terminate sentences (see section 15.3).
    166159
    167  Sentence Closing Char::
     160 "Sentence Closing Char"::
    168161 A value of 1 indicates these delimiting characters, such as " or ),
    169162 may follow a Sentence Terminator (see section 15.3).
    170163
    171  Paragraph Delimiter::
     164 "Paragraph Delimiter"::
    172165 A value of 1 indicates these characters delimit paragraphs when they
    173166 begin a line (see section 15.3).
    174167
    175  Page Delimiter::
     168 "Page Delimiter"::
    176169 A value of 1 indicates this character separates logical pages (see
    177170 section 15.4) when it begins a line.
    178171
    179  Scribe Syntax::
    180  This uses the following symbol values:
    181 
    182   * nil  These characters have no interesting properties.
    183 
    184   * :escape  This is @ for the Scribe formatting language.
    185 
    186   * :open-paren  These characters begin delimited text.
    187 
    188   * :close-paren  These characters end delimited text.
    189  
    190   * :space  These characters can terminate the name of a formatting command.
    191 
    192   * :newline  These characters can terminate the name of a formatting command.
    193 
    194  Lisp Syntax::
     172 "Lisp Syntax"::
    195173 This uses symbol values from the following:
    196174
     
    215193  * :constituent  These characters are constitute symbol names.
    216194
     195
     196[HemlockProgrammer Back to Table of Contents]