Editing Browser Input in Emacs

One of the downsides of being a Safari user is that the extension architecture doesn’t support the functionality that other browsers do. In particular, where other browsers allow you to call out to Emacs when editing fields in the browser, this doesn’t seem possible with Safari. That’s too bad because I really hate dealing with text outside of Emacs. None of my muscle memory works and all those editing habits and shortcuts I’ve built up over the years can’t be used.

Happily, Abin Simon has a workaround. He starts with how you’d do it manually—copy the text to the clipboard and paste it to an Emacs buffer, add to or edit the text, copy the edited text back to the clipboard and paste it into the browser buffer—and automates the process. That turns out to be easier than you’d think because he leverages Hammerspoon to do the system part. The Emacs part is just a bit of simple Elisp.

This isn’t as nice a solution as a browser plugin but it’s a decent workaround. Simon’s workflow is centered around interacting with Github but it’s easily adaptable to other workflows.

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