IrrationalRose

Introducing Emacs Launcher April 20, 2015

Emacs Launcher is an OS X menubar app to conveniently manage Emacs in server/client mode and offers OS X integrations such as Drag’n Drop and “Open with …” support.

My motivation to make Emacs Launcher was simply because Emacs launches slowly. Every time you run emacs some.file a new instance of Emacs is launched and it takes a really long time to load all the scripts/plugins/etc before you can actually edit the file.

There is a faster way to use Eamcs. Emacs can be used in server/client mode where the server only need to be launched once (via emacs —daemon) and each client can be launched pretty much instantly (via emacsclient some.file) and connect to the server to do the editing.

However, having to manually launch Emacs server/client in a terminal is tedious. More importantly, having to manually keep track of a running server in the terminal just isn’t a very OS X way of doing things.

I also wanted to take this opportunity to lear Swift. So I wrote Emacs Launcher in Swift, which was actually really fun.

The way Emacs Launcher works is very simple. You can open files with Emacs Launcher by either …

  • Dragging’n Dropping onto the menubar icon; or …
  • Selecting “Open with …” from Finder

… and at which point Emacs Launcher will …

  • Check if there is a running instance of Emacs in daemon mode, and if there isn’t then launch one
  • Launch an instance of Emacs client to connect the the daemon from the previous step

Simply put, Emacs Launcher ensures the Emacs server is running before launching an Emacs-client to connect to the server, which IMO, is something that should really just be built into Emacs itself.

You can download Emacs Launcher and checkout its source code from its GitHub repo.

If graphical user interface it just not your thing but you still want the convenience of a managed Emacs server/client setup, you can use a handy shell script I wrote before making Emacs Launcher. It’s compatible with Emacs Launcher meaning they can start/stop/restart Emacs server instances for each other.