What Is An Emacs Page?

I’ve been reading Peter Provo’s’ book Emacs Writing Studio and one of the points he makes early on is that “word processing” is different from what it used to be. The traditional paradigm considers word processing from the point of view of the printed page but that’s no longer a useful way of looking at it. Today the written word may be published as HTML on the Web, as an e-book, as a text file, or even as a traditional printed book. Prevos’ point is that GUI word processors are no loner fit for purpose.

Oddly, Emacs never embraced the traditional paradigm, probably because it started life as a code editor and only later came to be used for writing books and other “published” entities. That raises the question of what an Emacs “page” is and how you work with it.

Many Emacs users are probably unaware that there is such a construct. The closest thing they’re familiar with is the “current screen”, which can be paged forward and backward with Ctrl+v and Meta+v. But how much data is displayed on the that screen depends on how many lines there are in the current window.

A “page” is different. It doesn’t depends of the window size and doesn’t even necessarily have a uniform size even in the same file. A “page” in Emacs is simply the text between two special markers—line feeds, ^L, be default. Hardly anyone uses them these days but they can be useful for organizing a text file into sections for easy navigation.

Charles Choi notes that although there are forward page (Ctrl+x ]) and backward-page (Ctrl+x [) commands, they don’t act in the way you might expect, which is the put the top of the page at the top of the screen.

Naturally, Choi has a solution. It’s a bit of simple Elisp that calls forward/back-page and then recenters it so that the top of page is at the top of screen. If you’re interested in working with pages, take a look at Choi’s post.

This entry was posted in General and tagged . Bookmark the permalink.