topfunky / PeepOpen-Issues

Bug reports and feature requests for the PeepOpen application
http://peepcode.com/products/peepopen
41 stars 1 forks source link

ns-pop-up-frames not working in Cocoa Emacs #271

Open magnars opened 12 years ago

magnars commented 12 years ago

I've installed the latest Cocoa Emacs 23 using homebrew.

I've added (setq ns-pop-up-frames nil) to my init.el, but Peepopen still opens files in new instances of Emacs.

Any way of fixing this? Could I get Peepopen to just do a emacsclient -n instead perhaps?

Thanks!

magnars commented 12 years ago

I'm guessing that ns-pop-up-frames does nothing, because PeepOpen actually launches an entirely new instance of Emacs. I've been trying to dig through the PeepOpen source code to find how Emacs is started, but my Objective C is sorely lacking. :-P

magnars commented 12 years ago

I actually fixed this on my computer by creating an AppleScript application EmacsClient.app:

on open these_items
    set this_item to item 1 of these_items
    set file_path to (the POSIX path of this_item)
    tell application "Terminal"
        do shell script "/Applications/Emacs.app/Contents/MacOS/bin/emacsclient -n " & file_path & ""
    end tell
end open

and then changing the function that opens peepopen:

(format "open 'peepopen://%s?editor=%s'"
         (expand-file-name root)
         "EmacsClient")