15.4 Logical Pages

Logical pages are a way of dividing a file into coarse divisions. This is analogous to dividing a paper into sections, and Hemlock provides primitives for moving between the pages of a file and listing a directory of the page titles. Pages are separated by Page Delimiter characters (see section 9.5) that appear at the beginning of a line. [annotate]

goto-page  mark n [Function]
          

This moves mark to the absolute page numbered n. If there are less than n pages, it signals an editor-error. If it returns, it returns mark. Hemlock numbers pages starting with one for the page delimited by the beginning of the buffer and the first Page Delimiter (or the end of the buffer). [annotate]

[annotate]

page-offset  mark n [Function]
          

This moves mark forward n (-n backwards, if n is negative) Page Delimiter characters that are in the zero'th line position. If a Page Delimiter is the immediately next character after mark (or before mark, if n is negative), then skip it before starting. This always moves mark, and if there were enough pages to move over, it returns mark; otherwise, it returns nil. [annotate]

[annotate]

page-directory  buffer [Function]
          

This returns a list of each first non-blank line in buffer that follows a Page Delimiter character that is in the zero'th line position. This includes the first line of the buffer as the first page title. If a page is empty, then its title is the empty string. [annotate]

[annotate]

display-page-directory  stream directory [Function]
          

This writes the list of strings, directory, to stream, enumerating them in a field three wide. The number and string are separated by two spaces, and the first line contains headings for the page numbers and title strings. [annotate]

[annotate]