SML syntax coloring and indentation with Aquamacs

Figuring out how to get SML syntax coloring and indentation to work with Aquamacs was a little bit of a challenge. Assuming you have Aquamacs and sml already installed:

  1. Get sml-mode, available here. You’ll want the latest version.
  2. Open up the file ‘Makefile’. You want the directory ‘site-lisp’ to end up in ~/Library/Application Support/Aquamacs Emacs/ instead of /usr/local/share/emacs/ where it would install otherwise, so change the ‘prefix’,'datadir’, and ‘lispdir’ variables accordingly.
  3. The info doc will need to end up in /Applications/Aquamacs.app/Contents/Resources/info/ instead of /usr/local/info, so change the ‘infodir’ variable accordingly.
  4. Open up terminal and cd to the folder where the sml-mode files are located. Run the command ‘sudo make file’. You will need to enter your administrator’s password.
  5. The files should have installed correctly, and Aquamacs should now have syntax coloring and indentation for SML!

For the lazy man who doesn’t want to muck with the Makefile, you can also just run the ‘sudo make file’ command and copy over the ‘site-lisp’ directory and ‘sml-mode.info’ from their default install locations to the bolded locations above.