Chapter 10. A Comprehensive Example

This chapter is the culmination of our programming examples. It is a substantial major mode implementing a crossword puzzle editor—clearly a use which the designers of Emacs didn’t foresee, but implementable nonetheless. The straightforwardness of designing and implementing Crossword mode demonstrates Emacs’s true potential as an application-building toolkit.

After devising a data model for a crossword puzzle editing application, we’ll construct a user interface for it, creating functions for displaying a representation of our data model and restricting input to the set of operations we allow on it. We’ll write commands that go on the Emacs menu and commands that communicate with external processes. In doing so, we’ll exploit the Lisp techniques we’ve learned for performing complex logic and string manipulation.

New York Times Rules

I’m a big fan of crossword puzzles. I used to do the New York Times crossword puzzle daily. I frequently found myself amazed at the skill that must go into constructing a crossword puzzle, and wanted to try my hand at it. My initial attempts were on graph paper, but I quickly found that crossword puzzle creation involves so much trial and error (at least for me) that by the time I was halfway through, my eraser would be tearing holes in the paper! I hit on the idea of writing ...

Get Writing GNU Emacs Extensions now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.