June, 2008 Archive

Duplicating an Application to split window Spaces assignments in Leopard

June 26th, 2008 by David Saff in Uncategorized

I’m coming up on my first anniversary developing software in MacLand.  By and large, I can’t explain what took me so long, and I happily upgraded soon after to OS X 10.5, Leopard.

What follows is one of those blog posts that is more likely to be useful to a random person hitting here from a Google search than regular (?!) readers of this blog.  You’ve been warned.

It’s been noted that Spaces is a great tool for organizing applications, but it has the odd idea that Spaces should be assigned by Application, rather than by window.  This is rather silly, since for each development project, I’m likely to have a browser window or two open, plus a terminal or Emacs instance, plus, often, an Eclipse workspace, and these have much more to do with each other than with other windows from the same applications.

It’s especially annoying, because I have one Emacs window that I’d like to follow me to all Spaces, while the others stay put.  I finally figured out how to make this happen: convince OS X that I have two totally different applications that happen to both run Emacs:

  1. Copy Emacs.app from the Applications folder to some other location (say, the Desktop)
  2. Rename Emacs.app to Glemacs.app (I can explain the name, if anyone comments and asks…)
  3. In Finder, right click on Glemacs, and Show Package Contents.
  4. Browse to Contents/MacOS, and rename Emacs to Glemacs
  5. Go back and edit Contents/Info.plist.  Look for this text:
  6. <key>CFBundleExecutable</key>

    and edit like so:

  7. Finally, copy Glemacs from your Desktop back into Applications (copying it back in triggers some necessary registration.

Now, OS X recognizes two different Applications, Emacs, and Glemacs, and you can change Spaces settings for them independently. Share and Enjoy.