The lost art of page breaks in text documents

Table of Contents
  • Updated: [2021-09-23 Thu] comment from Mark

Intro

Somewhere back in Emacs’ memory of text esoterica and ideas that don’t seem to have taken off, there is support for ascii page breaks: the idea that within a single text document, “pages” could be represented by special characters. This is before the dawn of word processors or orgmode or PDF files, and this is an idea that might still be useful for some enterprising archeologist. There was a point in time when I used these functionalities to help navigate my emacs init.el file before I discovered better ways.1 Nowadays the only place I see page output is in the result of pdftotext program, which can represent whole books in one text file and so makes the useful decision to mark pages with pagebreak non-printing text characters.

You can insert one easily with C-q C-l2. Check out these functions for utilizing textual pages that come out of the box with emacs:

forward-page                             (C-x ])  Move forward to page boundary.  With arg, repeat, or go back if negative.      
mark-page                                (C-x C-p)  Put mark at end of page, point at beginning.                                   
what-page                                 Print page and line number of point.                                           
sort-pages                                Sort pages in region alphabetically; argument means descending order.          
backward-page                            (C-x [)  Move backward to page boundary.  With arg, repeat, or go fwd if negative.      
narrow-to-page                           (C-x n p)  Make text outside current page invisible.                                      
count-lines-page                         (C-x l)  Report number of lines on current page, and how many are before or after point.

Comments

Exactly the historical perspective I hoped for from one reader [2021-09-20 Mon]:

i started using emacs in 1979. back then, there were only ascii terminals, not bitmapped displays. printers handled ascii files in the obvious way. a form feed character ( ^L ) triggered a page eject. typically you’d place a form feed at the beginning of a procedure so it started on a new page boundary.

there was also a small emacs library called page-menu.el that used ^L as a delimiter. it offered a menu of “pages” and displayed the first few lines of text after the ^L to identify the page. i’m attaching it in case you find it useful.

/mark

If I receive inquiries I can pass the code on like Mark did.

Footnotes

1 I tried some lens-based modes, but by far the easiest and the best was using orgmode to tangle a literate file to all my places.

2 some info from the Indiana University archives https://kb.iu.edu/d/abaq . If anyone knows the history of why IU has a section of their archives on emacs (as do several other universities), I’d love to hear it!

Tory Anderson avatar
Tory Anderson
Full-time Web App Engineer, Digital Humanist, Researcher, Computer Psychologist