Changes between Version 1 and Version 2 of HemlockProgrammer/HighLevelTextPrimitives


Ignore:
Timestamp:
Jan 15, 2008, 11:01:35 PM (12 years ago)
Author:
gz
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • HemlockProgrammer/HighLevelTextPrimitives

    v1 v2  
     1[HemlockProgrammer Back to Table of Contents]
    12[[PageOutline]]
    23
     
    1011logical pages and for formatting text forms.
    1112
    12 == 15.1 Indenting Text ==
    13 
    14 Indent Function         (initial value tab-to-tab-stop) [Variable]
    15                
     13== 15.1 Indenting Text ==#IndentingText
     14
     15`Indent Function`       (initial value tab-to-tab-stop) [Variable]
     16
    1617The value of this variable determines how indentation is done, and it
    1718is a function which is passed a mark as its argument. The function
     
    2324indentation for Lisp code.
    2425
    25 Indent with Tabs        (initial value indent-using-tabs)        [Variable]
    26 
    27 Spaces per Tab          (initial value 8)        [Variable]
    28                
    29 Indent with Tabs holds a function that takes a mark and a number of
    30 spaces. The function will insert a maximum number of tabs and a
    31 minimum number of spaces at mark to move the specified number of
    32 columns. The default definition uses Spaces per Tab to determine the
    33 size of a tab. Note, Spaces per Tab is not used everywhere in Hemlock
    34 yet, so changing this variable could have unexpected results.
    35 
    36 indent-region   region   [Function]
    37 
    38 indent-region-for-commands      region   [Function]
    39                
     26`Indent with Tabs` (initial value nil)     [Variable][[BR]]
     27`Spaces per Tab`        (initial value 8)        [Variable][[BR]]
     28
     29Indent with Tabs should be true if indenting should use tabs
     30whenever possible. If nil, the default, it only uses spaces.
     31Spaces per Tab defines the size of a tab.
     32
     33`indent-region`         region   [Function][[BR]]
     34`indent-region-for-commands`    region   [Function][[BR]]
     35
    4036indent-region invokes the value of Indent Function on every line of
    4137region. indent-region-for-commands uses indent-region but first saves
    4238the region for the Undo command.
    4339
    44 
    45 delete-horizontal-space         mark     [Function]
    46                
    47 This deletes all characters with a Space attribute (see section 9.5)
     40`delete-horizontal-space`       mark     [Function]
     41
     42This deletes all characters on either side of mark with a Space attribute (see section 9.5)
    4843of 1.
    4944
    50 == 15.2. Lisp Text Buffers ==
     45== 15.2. Lisp Text Buffers ==#LispTextBuffers
    5146
    5247Hemlock bases its Lisp primitives on parsing a block of the buffer and
     
    6358inconsistency.
    6459
    65 pre-command-parse-check         mark for-sure    [Function]
    66 
    67 Parse Start Function    (initial value start-of-parse-block)     [Variable]
    68 
    69 Parse End Function      (initial value end-of-parse-block)       [Variable]
    70 
    71 Minimum Lines Parsed    (initial value 50)       [Variable]
    72 
    73 Maximum Lines Parsed    (initial value 500)      [Variable]
    74 
    75 Defun Parse Goal        (initial value 2)        [Variable]
    76                
     60`pre-command-parse-check`       mark for-sure    [Function][[BR]]
     61`Parse Start Function`  (initial value start-of-parse-block)     [Variable][[BR]]
     62`Parse End Function`    (initial value end-of-parse-block)       [Variable][[BR]]
     63`Minimum Lines Parsed`          (initial value 50)       [Variable][[BR]]
     64`Maximum Lines Parsed`          (initial value 500)      [Variable][[BR]]
     65`Defun Parse Goal`      (initial value 2)        [Variable][[BR]]
     66
    7767pre-command-parse-check calls Parse Start Function and Parse End
    7868Function on mark to get two marks. It then parses all the lines
     
    9282
    9383
    94 form-offset     mark count      [Function]
    95                
     84`form-offset`   mark count      [Function]
     85
    9686This tries to move mark count forms forward if positive or -count
    9787forms backwards if negative. Mark is always moved. If there were
     
    10090
    10191
    102 
    103 top-level-offset        mark count       [Function]
    104                
     92`top-level-offset`      mark count       [Function]
     93
    10594This tries to move mark count top level forms forward if positive or
    10695-count top level forms backwards if negative. If there were enough top
     
    11099
    111100
    112 mark-top-level-form     mark1 mark2      [Function]
    113                
     101`mark-top-level-form`   mark1 mark2      [Function]
     102
    114103This moves mark1 and mark2 to the beginning and end, respectively, of
    115104the current or next top level form. Mark1 is used as a reference to
     
    122111
    123112
    124 defun-region    mark    [Function]
    125                
     113`defun-region`          mark    [Function]
     114
    126115This returns a region around the current or next defun with respect to
    127116mark. Mark is not used to form the region. If there is no appropriate
     
    131120
    132121
    133 inside-defun-p          mark     [Function]
    134 
    135 start-defun-p   mark     [Function]
    136                
     122`inside-defun-p`        mark     [Function][[BR]]
     123`start-defun-p`         mark     [Function][[BR]]
     124
    137125These return, respectively, whether mark is inside a top level form or
    138126at the beginning of a line immediately before a character whose Lisp
     
    140128
    141129
    142 
    143 forward-up-list         mark     [Function]
    144 
    145 backward-up-list        mark     [Function]
    146                
     130`forward-up-list`       mark     [Function][[BR]]
     131`backward-up-list`      mark     [Function][[BR]]
     132
    147133Respectively, these move mark immediately past a character whose Lisp
    148134Syntax (see section 9.5) value is :closing-paren or immediately before
     
    150136
    151137
    152 
    153 valid-spot      mark forwardp    [Function]
    154                
     138`valid-spot`    mark forwardp    [Function]
     139
    155140This returns t or nil depending on whether the character indicated by
    156141mark is a valid spot. When forwardp is set, use the character after
     
    159144
    160145
    161 
    162 defindent       name count       [Function]
    163                
     146`defindent`     name count       [Function]
     147
    164148This defines the function with name to have count special
    165149arguments. indent-for-lisp, the value of Indent Function (see section
     
    171155distinct from "mumble:with-a-mumble".
    172156
    173 == 15.3. English Text Buffers ==
     157== 15.3. English Text Buffers ==#EnglishTextBuffers
    174158
    175159This section describes some routines that understand basic English
    176160language forms.
    177161
    178 word-offset     mark count      [Function]
    179                
     162`word-offset`   mark count      [Function]
     163
    180164This moves mark count words forward (if positive) or backwards (if
    181165negative). If mark is in the middle of a word, that counts as one. If
     
    186170
    187171
    188 
    189 sentence-offset         mark count       [Function]
    190                
     172`sentence-offset`       mark count       [Function]
     173
    191174This moves mark count sentences forward (if positive) or backwards (if negative). If mark is in the middle of a sentence, that counts as one. If there were count (-count if negative) sentences in the appropriate direction, this returns mark, otherwise nil. This always moves mark.
    192175
     
    200183
    201184
    202 paragraph-offset        mark count &optional prefix      [Function]
    203 Paragraph Delimiter Function    (initial value )         [Variable]
    204                
     185`paragraph-offset`      mark count &optional prefix      [Function][[BR]]
     186`Paragraph Delimiter Function`          (initial value )         [Variable][[BR]]
     187
    205188This moves mark count paragraphs forward (if positive) or backwards
    206189(if negative). If mark is in the middle of a paragraph, that counts as
     
    247230
    248231
    249 mark-paragraph          mark1 mark2      [Function]
    250                
     232`mark-paragraph`        mark1 mark2      [Function]
     233
    251234This marks the next or current paragraph, setting mark1 to the
    252235beginning and mark2 to the end. This uses Fill Prefix (see section
     
    258241
    259242
    260 == 15.4. Logical Pages ==
    261 
    262 Logical pages are a way of dividing a file into coarse divisions. This
    263 is analogous to dividing a paper into sections, and Hemlock provides
    264 primitives for moving between the pages of a file and listing a
    265 directory of the page titles. Pages are separated by Page Delimiter
    266 characters (see section 9.5) that appear at the beginning of a line.
    267 
    268 goto-page       mark n   [Function]
    269                
    270 This moves mark to the absolute page numbered n. If there are less
    271 than n pages, it signals an editor-error. If it returns, it returns
    272 mark. Hemlock numbers pages starting with one for the page delimited
    273 by the beginning of the buffer and the first Page Delimiter (or the
    274 end of the buffer).
    275 
    276 
    277 
    278 page-offset     mark n   [Function]
    279                
    280 This moves mark forward n (-n backwards, if n is negative) Page
    281 Delimiter characters that are in the zero'th line position. If a Page
    282 Delimiter is the immediately next character after mark (or before
    283 mark, if n is negative), then skip it before starting. This always
    284 moves mark, and if there were enough pages to move over, it returns
    285 mark; otherwise, it returns nil.
    286 
    287 
    288 
    289 page-directory          buffer   [Function]
    290                
    291 This returns a list of each first non-blank line in buffer that
    292 follows a Page Delimiter character that is in the zero'th line
    293 position. This includes the first line of the buffer as the first page
    294 title. If a page is empty, then its title is the empty string.
    295 
    296 
    297 
    298 display-page-directory          stream directory         [Function]
    299                
    300 This writes the list of strings, directory, to stream, enumerating
    301 them in a field three wide. The number and string are separated by two
    302 spaces, and the first line contains headings for the page numbers and
    303 title strings.
    304 
    305 
    306 == 15.5. Filling ==
     243== 15.4. Logical Pages ==#LogicalPages
     244
     245Logical pages are not supported at this time.
     246
     247== 15.5. Filling ==#Filling
    307248
    308249Filling is an operation on text that breaks long lines at word
     
    315256but it knows two spaces follow sentences (see section 15.3).
    316257
    317 Fill Column     (initial value 75)       [Variable]
    318 
    319 Fill Prefix     (initial value nil)      [Variable]
    320                
     258`Fill Column`   (initial value 75)       [Variable][[BR]]
     259`Fill Prefix`   (initial value nil)      [Variable][[BR]]
     260
    321261These variables hold the default values of the prefix and column
    322262arguments to Hemlock's filling primitives. If Fill Prefix is nil, then
     
    324264
    325265
    326 
    327 fill-region     region &optional prefix column   [Function]
    328                
     266`fill-region`   region &optional prefix column   [Function]
     267
    329268This deletes any blank lines in region and fills it according to
    330269prefix and column. Prefix and column default to Fill Prefix and Fill
     
    332271
    333272
    334 
    335 fill-region-by-paragraphs       region &optional prefix column   [Function]
    336                
     273`fill-region-by-paragraphs`     region &optional prefix column   [Function]
     274
    337275This finds paragraphs (see section 15.3) within region and fills them
    338276with fill-region. This ignores blank lines between paragraphs. Prefix
     
    341279
    342280
     281
     282[HemlockProgrammer Back to Table of Contents]