07/22/2009

Stop opening new frames in Emacs 23

NS Frame customization

I've recently starting using some cocoa nightlies of Emacs 23 as my main editor. It's a bit crashy in places and it took some fixing of my main config files, but it's a lot of fun.

My biggest gripe with it has been how it opens files. Sure, C-x C-f works as you'd expect, but something changed with the way it opens files in other ways. For example, when you drag and drop a file onto the dock icon, it opens the file in a new frame. It also opens files in a new frame when I use my handy command line script (which essentially calls open -a).

I know aquamacs has done this for a while, but I always hated it. So I was esspecially disheartened to see this behaviour make it into standard Emacs... especially since I couldn't figure out how to fix it.

Well, after asking in irc, hober suggested that I do (global-set-key drag-and-drop-something-or-other 'ns-something-or-other). This led me to try M-x customize-group RET ns. Naturally that worked and I found Ns Pop Up Frames. Set that to Never and you're good to go. I'm assuming you could also just do this in your .emacs: (setq ns-pop-up-frames nil).

Something new every day.