Emacs: Everything’s a Buffer

It’s a commonplace that one of the features of Emacs is that everything’s a buffer and that this is a feature. Marcin Borkowski (mbork) has a short post that demonstrates the power that this brings.

The TL;DR is that he had a long file name comprised of several words one of which was hard to spell correctly. He wanted to check if he’d spelled it correctly and, if not, correct the spelling. Think for a moment how you’d solve that problem.

If you’re not an Emacser, your solution probably involves somehow isolating the file name, extracting the word in question, running it through a spell checker, and finally renaming the file either manually or through a file manager.

Borkowski’s solution was much simpler: he leveraged the fact that like everything else in Emacs, the Dired display is actually a buffer and therefore subject to the usual Emacs editing manipulations. He simply turned on Dired buffer editing, ran spell check on the word in question, and saved the results. All without leaving the comfort of Emacs. Take a look at Borkowski’s post for the details.

As Borkowski says, no other editor has this level of integration between the various subsystems. Buffers, like many things in Emacs, are easy to take for granted but they are the source of a lot of power.

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