views:

361

answers:

2

I use emacs on my mac to program in Xcode. It works really well for the most part. I double click on a file in xcode, and it pulls it up in an existing emacs window. I compile, and get syntax errors, double click, and they come up in the active emacs window. great.

This is all XCode talking to emacs. Does anyone know of a way to get emacs to talk to XCode? For example, I want to be able to set a breakpoint in emacs and have the XCode version of gdb acknowledge it.

A: 

Sounds like a job for a new plugin!

samoz
This isn't really an answer...couldn't you have posted this as a comment on the question?
A. Levy
+5  A: 

You can actually use AppleScript to set breakpoints in XCode from within Emacs by embedding the AppleScript inside of elisp.

This page contains the code you need. It's in Korean, but there's actually not much Korean to understand. The first code block is just a straight AppleScript example that was used to develop the breakpoint code. The second block is the one you want. It embeds the first example in an elisp snippet that you can add to your .emacs file.

Other communication can be done using the same trick. Just figure out how to do what you want in AppleScript and then embed that AppleScript in elisp within Emacs.

BTW, here is the documentation for do-applescript, the lisp function, available on the Mac, that lets you call AppleScript.

Naaff
Ok, the line "This page contains the code you need. It's in Korean, but.." is probably the strangest helpful line I've ever seen B-), but it works great. thanks!
Brian Postow
Glad to help. I don't usually post links to Korean pages, but, in this case, it was just a good fit for your question. ;)
Naaff