Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

up vote 4 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.

share|improve this answer

This seems to work:

export EDITOR="/usr/bin/open -n -W -a /Applications/Aquamacs.app"
share|improve this answer
    
In order to use Aquamacs with Git I had to apply this, and set core.editor to emacsclient. –  Dror Nov 30 '12 at 16:02

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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