I installed Aquamacs in a fresh OS X desktop, and wanted to be able to call the program from the commandline.

Calling the file inside the app seems to work just fine:

Amoss-iMac:bin amosjyng$ /Applications/Aquamacs.app/Contents/MacOS/Aquamacs

But of course, the Emacs when called from the Terminal is still version 22. So I log in as root and try

sh-3.2# rm emacs
sh-3.2# ln -s /Applications/Aquamacs.app/Contents/MacOS/Aquamacs emacs

Using the symbolic link now, however, generates a bunch of problems:

Amoss-iMac:bin amosjyng$ emacs
Warning: arch-dependent data dir (/Users/dr/Nightly/Cocoa23ub/aquamacs-emacs.git/nextstep/Aquamacs.app/Contents/MacOS/libexec/emacs/23.3.50/i386-apple-darwin9.8.0/) does not exist.
Warning: arch-independent data dir (/Users/dr/Nightly/Cocoa23ub/aquamacs-emacs.git/nextstep/Aquamacs.app/Contents/Resources/share/emacs/23.3.50/etc/) does not exist.
Error: charsets directory (/Users/dr/Nightly/Cocoa23ub/aquamacs-emacs.git/nextstep/Aquamacs.app/Contents/Resources/share/emacs/23.3.50/etc/charsets) does not exist.
Emacs will not function correctly without the character map files.
Please check your installation!
Warning: Could not find simple.el nor simple.elc

What could I do to fix this?


So I removed the link to Aquamacs, and instead wrote a script file named emacs consisting entirely of


And now calling emacs from the Terminal works.

Does anybody have any other ways to do this?

  • You may want to add "$@" to the end /Applications/Aquamacs.app/Contents/MacOS/Aquamacs in your shell script, so that the script's command-line arguments are passed on to Emacs itself. – mernst Oct 2 '14 at 12:10

If you only want to be able to call it from the command line, an alias would work pretty well.

Add something like:

alias emacs='/Applications/Aquamacs.app/Contents/MacOS/Aquamacs'

to your shell's startup file (~/.bash_profile or similar). (Doesn't gain you much though.)

  • Note that "alias" is also a word for a smart redirecting file in Mac Filesystems, so you should specify that you mean a shell alias. Mac aliases (which you can get from the contextual-menu::Make alias in the finder) are rather more than symbolic links. – dmckee --- ex-moderator kitten Jan 16 '12 at 13:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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