Aquamacs emacsedit

HollenbackNet – MuttOnMacOs provides a good solution (via this mailing list post) for anyone who wants to use Aquamacs as an editor for a command-line-based application. To wit: don’t use emacsclient directly; create a little script like this:

#!/bin/sh

# script to force Aquamacs to open in front of terminal
open -a Aquamacs\ Emacs
/Applications/Aquamacs\ Emacs.app/Contents/MacOS/bin/emacsclient "$@"
# Now make sure the focus goes back to the terminal when we are done
open -a Terminal

in a file called, say, emacsclienthack.sh, and reference that shell script instead of emacsclient itself. Makes things quite pleasant.