Is it possible to use Aquamacs as the editor for Subversion. For example, if I do

svn propedit svn:ignore .

and I have the EDITOR variable set to "emacs", it will use GNU emacs for the editor to edit that property.

In my .profile, I've

alias emacs="open -a /Applications/Aquamacs.app/"

So calling

emacs foo.bar

opens the file in Aquamacs.

Setting the EDITOR variable to "emacs" fails to use Aquamacs. Setting the EDITOR to '"open -a /Applications/Aquamacs.app/"' DOES open the file in Aquamacs, but since open is not a blocking command (I'm guessing), Subversion continues immediately in the Terminal as if nothing was entered. In other words, it doesn't wait for the user's edits.

I can't find out if open can be called so that it blocks, or if there's another command in OSX Terminal. Obviously, I don't know if blocking would even work, since what exactly would it block on?

link|improve this question

80% accept rate
feedback

1 Answer

up vote 3 down vote accepted

You should set your EDITOR to emacsclient instead of emacs. This is a client interface to emacs internal server.

Configuration (one time):

  • set $EDITOR to emacsclient: export EDITOR=emacsclient
  • put (server-start) in your .emacs startup file

When you run your svn commit, crontab or other command which uses $EDITOR, the file will open in emacs. When you're done editing, hit C-x # to return control to svn, crontab, etc.

Take a look at this question on stackoverflow and emacs documentation on emacs server and invoking emacsclient.


Update: I use a standard emacs build, not Aquamacs, so I googled to see if there were any special tricks required for Aquamacs and emacsclient. On the emacs wiki Aquamacs FAQ, I found this snippet:

In order to use the “aquamacs” and “emacsclient” command-line tools, from the Aquamacs menu bar, Tools->Install Command Line Tools. If you are upgrading Aquamacs, you may need to re-install the Command Line Tools.

I imagine that if you don't do this, you'll be using the emacsclient that came with OS X and it might not send the right message to Aquamacs.re-install the Command Line Tools.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.