Multiple Emacs instances in OSX
March 18, 2011
Here is a very simple tip that has been really useful to me over the last few months.
The way I work in Emacs is by opening lots and lots of files and then quickly selecting the buffer I want with ido-mode.
However, this breaks down if I have more than one project loaded in my Emacs session. For example, when working on Rails projects, I want to be able to find the routes.rb file with just a few keystrokes. To avoid restarting Emacs whenever I switch project, I need multiple instances running simultaneously, which is not “supported” in OSX (or rather, it’s just not the OSX way).
To workaround this, I use a really simple hack: Copying Emacs
So to create Emacs2 and Emacs3 in addition to just Emacs, do
cp -r /Applications/Emacs.app /Applications/Emacs2.app cp -r /Applications/Emacs.app /Applications/Emacs3.app
That’s it! Now you can fire up three Emacs instances at the same time. Next step will be to replace the icons of the clones to make it easier to spot them when switching applications.
As discussed in the comments below, I can just start new instances with “open -n -a Emacs.app”. Thanks tali713 for bringing this to my attention!