Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 474
Bob Cross Avatar asked Sep 02 '09 13:09

Bob Cross


3 Answers

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))
like image 114
rplevy Avatar answered Nov 17 '22 23:11

rplevy


You'll be wanting http://matlab-emacs.sourceforge.net/ , I would imagine? Read the instructions there.

I used an ancestor of this years ago in XEmacs, so it certainly used to have support for it, but I believe the author is an GNUEmacs user. The guy who wrote it (Eric Ludlam) is a Mathworks employee, so it has vague official credentials.

like image 7
ijw Avatar answered Nov 17 '22 23:11

ijw


Not built in in GNU Emacs 22. I found a matlab mode on the web (elisp), but it dates from circa 2000, so I don't know what kind of support you have.

To install you must get emacs to load it, then invoke the mode. You can interactively issue a load-file (With M-x load-file) to test it.

like image 1
dmckee --- ex-moderator kitten Avatar answered Nov 17 '22 23:11

dmckee --- ex-moderator kitten