I can find several Emacs libraries for Mathematica, but I'm not aware of a clear favourite, a definitive list, or of a library which is actively maintained and developed. None of these appear to be in the Emacs Lisp Package Archive or Milkypostman’s Emacs Lisp Package Archive.

I have been using the first one on the list for a while, but the indentation engine is not ideal. What do people use for editing Mathematica source code in Emacs? I'm just talking about editing source code; I don't need to evaluate Mathematica expressions in a subsidiary kernel process, etc. The important features for me are

  • indentation,
  • syntax-highlighting,
  • forward/backward/up/down in Mathematica bracketed expressions.

Additional "IDE" features would be very welcome, especially imenu support.


1 Answer 1


You want all the basic stuff, the same stuff I do, but unfortunately it seems support here is pretty thin on the ground. Some others I've found:

  • https://github.com/melton1968/math - seems to be a full attempt at a parser, which is amazing, but it doesn't appear to be functioning properly right now. As much as I'd like to deep dive on that, I don't have the bandwidth. Perhaps someone here does?

  • https://github.com/kawabata/wolfram-mode - is a derivative of math++, I think, and the current revision uses a standard emacs smie parser to do basic syntax highlighting and indentation. Unfortunately this one also seems buggy, but this one stands some chance of being fixed given its fairly modest goals and use of a standard parser. The main problem I have is that it is confused about Association syntax in Mathematica 10, and using basic parens to group statements inside a function definition seems to freak out the indentation.

The approach I might take is to start from scratch with a new smie parser, and add functionality to it as I need it, so that I can understand the indenting rules. Sorry this isn't a complete answer, but I hope it's inspirational to someone or useful as a starting point.

  • 1
    $\begingroup$ I forked the wolfram-mode and added support for associations github.com/lecopivo/wolfram-mode . Unfortunately I do not know how to deal with expressions like \[theta]. $\endgroup$
    – tom
    May 15, 2016 at 12:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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