[OS X Emacs] multiple instances of aquamacs
Norman Gray
norman at astro.gla.ac.uk
Sat Feb 9 07:51:42 EST 2013
Greetings.
On 2013 Feb 9, at 12:25, Peter Dyballa <Peter_Dyballa at Web.DE> wrote:
> Am 09.02.2013 um 04:22 schrieb Trevor Davies:
>
>> Yes, every time I, example, 'emacs test.r' on the command line it would
>> open a new emacs process.
>
> In Mac OS X it's not recommended to create more than one process with the same application. It's a waste of resources (and has some more subtle disadvantages). If you really want to launch every time a new process you can try that from the command line:
>
> /Applications/AquaEmacs.app/Contents/MacOS/Emacs <file> &
I can't remember if this was ruled out further back in the thread, but it's pretty easy to use Aquamacs' emacsclient from the command line, and this is what I habitually do.
% echo $aquamacsbin
/Data/LocalApplications/Aquamacs 2.4/Aquamacs.app/Contents/MacOS/bin
% which aq
aq () {
if test -z "$1"
then
echo "Usage: aq file"
else
if ! test -f "$1"
then
touch "$1"
fi
$aquamacsbin/emacsclient -n "$1" > /dev/null 2>&1 || echo "Starting Aquamacs..." && open -b org.gnu.Aquamacs "$1"
fi
}
%
Then 'aq foo.txt' opens up the given file in Aquamacs, creating it if necessary. For this to work, you have to have '(server-start)' in your ~/.emacs/init.el file.
(There's a _very_ similar invocation to do the same thing for Cocoa Emacs.)
All the best,
Norman
--
Norman Gray : http://nxg.me.uk
SUPA School of Physics and Astronomy, University of Glasgow, UK
More information about the MacOSX-Emacs
mailing list