Thursday, October 1, 2026

What is spook?

What is spook?

The Emacs function spook is not what you think it is. It doesn't make creepy noises, draw scary ASCII art or change the theme to orange on black. In fact it has nothing at all to do with Halloween, ghosts, monsters, pandemics or IRS audits.

What it does is insert words and phrases into the current buffer "to help give your message ... attractiveness for automated keyword scanners."

What kind of words or phrases might you expect to see? To find out I invoked spook while composing this content. Here's what it added:

TELINT Drug North Korea Security Consulting Virii Abu Ghraib Fort Hancock CUD AMEMB Vaccine MARTA racal E.O.D. Blizzard Nigeria

It's easy1 to configure spook to insert an alternate set of words and phrases -- just change the file name in the variable spook-phrases-file from "spook.lines" to the name of the alternate file. Unfortunately it must reside in the Emacs data directory; the file's location is fixed. The variable can be found in the Spook customization group, whose parent group is Games.

Even with only 72 lines in its source code file,2 spook demonstrates how to insert one or more random lines from a file into the current buffer.


1 It's "easy" if you have Administrator permissions.

2 The 72 lines is the entire spook.el file; the first 48% of the file provides the usual comments that describe the GNU GPL, author, maintainer info as well as documentation.