Editing macOS Text Fields with Emacs

If you’re like me, you hate dealing with text outside of Emacs. Even those of us who spend as much time as we can inside Emacs have to interact with other applications. In my case, that’s mostly Safari. The problem with Safari is that its architecture doesn’t allow extensions that will call Emacs to edit text fields the way, say, Firefox does.

MacOS, of course, recognizes many of the Emacs keybindings but you can do much better. For many years, I’ve used the operating system’s ability to assign keys to editing functions to install a fairly comprehensive set of Emacs editing keybindings but while that helps with muscle memory, it’s not really like editing with Emacs. I’ve long wished for a way of popping into Emacs to edit the text fields from other apps.

Now, happily, my wish has been answered. Take a look at this video by dmgerman that demonstrates his Edit with emacs Everywhere package. It provides just what you’d want: if you’re in any text field in any Mac application, you can press a key sequence to put up an Emacs buffer in which you can edit the text in the field and then return the edited text to the calling app. The important thing here is that you’re not just using Emacs keybindings but using Emacs itself with all its power. Perfect!

The package depends on Hammerspoon to mediate with the OS. It’s easy to install and, of course, is more generally useful but even if it weren’t, giving us the ability to edit all text fields with Emacs is worth the price of admission.

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