Search code examples
emacsmatlaboctavexemacs

How do I install a MATLAB mode in GNU Emacs?


Is there an Emacs major mode for MATLAB and / or Octave files? For those who don't know, MATLAB files generally have a ".m" file extension.

My primary interest is GNU Emacs but XEmacs tips would also be appreciated.


Solution

  • Have you tried the octave-mode that is part of the standard emacs distribution? I have found that this works well.

    If you're finding it doesn't associate the .m extension, add this to your .emacs:

    (setq auto-mode-alist
          (cons
           '("\\.m$" . octave-mode)
           auto-mode-alist))