2016-03-12 20:04:27 +01:00
|
|
|
* Matlab-emacs Project:
|
2005-12-01 14:12:18 +01:00
|
|
|
|
2017-12-06 02:52:11 +01:00
|
|
|
MATLAB and Emacs integration:
|
|
|
|
|
|
|
|
1. matlab-mode for editing *.m files.
|
|
|
|
2. matlab-shell for running MATLAB -nodesktop within Emacs (Unix-only).
|
|
|
|
- matlab-shell will use company-mode for completions.
|
|
|
|
3. tlc-mode for editing *.tlc files (part of Simulink Coder).
|
|
|
|
4. Integration with CEDET.
|
2005-12-01 19:53:01 +01:00
|
|
|
|
2016-03-12 20:04:27 +01:00
|
|
|
** INSTALL
|
2005-12-01 19:53:01 +01:00
|
|
|
|
2017-12-06 02:52:11 +01:00
|
|
|
To install directly from the repository,
|
|
|
|
|
|
|
|
: cd /path/to/matlab-emacs
|
|
|
|
: make
|
|
|
|
|
|
|
|
Next, add the following to your ~/.emacs file:
|
2008-09-05 14:33:18 +02:00
|
|
|
|
2016-03-19 00:24:09 +01:00
|
|
|
#+BEGIN_SRC elisp
|
2009-09-15 22:42:25 +02:00
|
|
|
;; Replace path below to be where your matlab.el file is.
|
2017-12-06 02:52:11 +01:00
|
|
|
(add-to-list 'load-path "/path/to/matlab-emacs")
|
2009-07-06 22:07:30 +02:00
|
|
|
(load-library "matlab-load")
|
|
|
|
|
|
|
|
;; Enable CEDET feature support for MATLAB code. (Optional)
|
|
|
|
;; (matlab-cedet-setup)
|
2016-03-19 00:24:09 +01:00
|
|
|
#+END_SRC
|
2009-07-06 22:07:30 +02:00
|
|
|
|
2016-03-12 20:04:27 +01:00
|
|
|
** MELPA
|
|
|
|
|
2016-03-19 00:24:09 +01:00
|
|
|
GNU emacs (sorry Xemacs folks) users (version >=24) can use the
|
|
|
|
package as provided by MELPA.
|
|
|
|
Set
|
|
|
|
|
|
|
|
#+BEGIN_SRC elisp
|
2017-12-06 02:52:11 +01:00
|
|
|
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t)
|
2016-03-19 00:24:09 +01:00
|
|
|
#+END_SRC
|
|
|
|
And then run
|
|
|
|
M-x
|
|
|
|
package-list-packages
|
2016-03-12 20:04:27 +01:00
|
|
|
|
2005-12-01 19:53:01 +01:00
|
|
|
** Releases
|
|
|
|
|
2017-12-06 02:52:11 +01:00
|
|
|
The most recent version of matlab.el is in SourceForge GIT.
|
2005-12-01 19:53:01 +01:00
|
|
|
|
|
|
|
Homepage:
|
|
|
|
http://matlab-emacs.sf.net
|
|
|
|
|
|
|
|
Project Page:
|
|
|
|
http://sourceforge.net/projects/matlab-emacs
|
|
|
|
|
2016-03-12 20:04:27 +01:00
|
|
|
GIT Repository:
|
|
|
|
https://sourceforge.net/p/matlab-emacs/src/ci/master/tree/
|
2005-12-01 19:53:01 +01:00
|
|
|
|
2017-12-06 02:52:11 +01:00
|
|
|
You can get a zip file using the "Download snapshot" button or use git to create a local
|
|
|
|
repository:
|
2016-03-12 20:04:27 +01:00
|
|
|
|
2016-03-19 00:24:09 +01:00
|
|
|
#+BEGIN_SRC shell
|
2016-03-12 20:04:27 +01:00
|
|
|
git clone git://git.code.sf.net/p/matlab-emacs/src matlab-emacs-src
|
2016-03-19 00:24:09 +01:00
|
|
|
#+END_SRC
|
2016-03-12 20:04:27 +01:00
|
|
|
|
|
|
|
If you do not have a GIT client on your machine, you can use the
|
2009-07-06 22:07:30 +02:00
|
|
|
MATLAB script dl_emacs_support.m to download a fresh copy of the
|
|
|
|
matlab.el sources.
|
2016-03-12 20:04:27 +01:00
|
|
|
https://sourceforge.net/p/matlab-emacs/src/ci/master/tree/dl_emacs_support.m
|
2009-07-06 22:07:30 +02:00
|
|
|
|
2017-12-06 02:52:11 +01:00
|
|
|
Older versions in the SourceForge CVS repository are *no* longer updated.
|
2014-11-13 22:31:56 +01:00
|
|
|
|
2016-03-12 20:04:27 +01:00
|
|
|
** Dependencies
|
2005-12-02 19:37:19 +01:00
|
|
|
|
2013-04-02 03:01:33 +02:00
|
|
|
MATLAB-Emacs can use the CEDET suite for the following items:
|
2016-03-19 00:24:09 +01:00
|
|
|
- Modifying the build system (Makefiles, etc)
|
|
|
|
- mlint (uses EIEIO object system)
|
|
|
|
- parsing/completion (uses semantic parsing system)
|
|
|
|
- some template insertion features
|
2013-04-02 03:01:33 +02:00
|
|
|
|
2016-03-19 00:24:09 +01:00
|
|
|
As of Emacs 23.2, CEDET is included in Emacs, and nothing extra
|
|
|
|
is needed to satisfy that dependency.
|
2013-04-02 03:01:33 +02:00
|
|
|
|
2016-03-19 00:24:09 +01:00
|
|
|
For older versions of Emacs:
|
2008-09-05 14:33:18 +02:00
|
|
|
|
2016-03-19 00:24:09 +01:00
|
|
|
See http://cedet.sf.net for downloading CEDET.
|
2009-07-06 22:07:30 +02:00
|
|
|
|
2016-03-19 00:24:09 +01:00
|
|
|
If you only want to use matlab.el for editing code or running the
|
|
|
|
MATLAB shell, you DO NOT need to install CEDET.
|
2009-07-06 22:07:30 +02:00
|
|
|
|
2016-03-19 00:24:09 +01:00
|
|
|
If you do want to use CEDET, add the following to your .emacs file:
|
|
|
|
#+BEGIN_SRC elisp
|
|
|
|
(matlab-cedet-setup)
|
|
|
|
#+END_SRC
|
2005-12-02 19:37:19 +01:00
|
|
|
|
2017-12-06 02:52:11 +01:00
|
|
|
** Mailing List
|
2005-12-01 19:53:01 +01:00
|
|
|
|
2017-12-06 02:52:11 +01:00
|
|
|
Subscribe to matlab-emacs-discuss mailing list get updates on new releases
|
|
|
|
and discuss topics relevant to the matlab-emacs project.
|
2005-12-01 19:53:01 +01:00
|
|
|
|
|
|
|
http://lists.sourceforge.net/mailman/listinfo/matlab-emacs-discuss
|
|
|
|
|
2017-12-06 02:52:11 +01:00
|
|
|
*Old mailing list*: The original mailing list where beta versions of matlab.el
|
|
|
|
were posted, and where comments, questions, bug reports, and answers to
|
|
|
|
questions could be sent. If you were subscribed to this list, please
|
|
|
|
unsubscribe, and subscribe to the new list above. To unsubscribe, send email
|
|
|
|
with the body of: "unsubscribe matlab-emacs"
|
|
|
|
|
|
|
|
** FAQ
|
|
|
|
|
|
|
|
*** How Do I Customize matlab-emacs?
|
|
|
|
|
|
|
|
You can configure matlab-emacs using the "matlab" or "matlab-shell"
|
|
|
|
customization groups:
|
2005-12-01 19:53:01 +01:00
|
|
|
|
2017-12-06 02:52:11 +01:00
|
|
|
: Emacs -> Options -> Customize Emacs -> Specific Group
|
2005-12-01 19:53:01 +01:00
|
|
|
|
2017-12-06 02:52:11 +01:00
|
|
|
*** How do I customize "edit file.m" behavior?
|
2016-03-16 14:50:17 +01:00
|
|
|
|
2017-12-06 02:52:11 +01:00
|
|
|
By default when you run
|
2016-03-16 14:50:17 +01:00
|
|
|
|
2017-12-06 02:52:11 +01:00
|
|
|
: M-x matlab-shell
|
|
|
|
:
|
|
|
|
: >> edit file.m
|
2016-03-16 14:50:17 +01:00
|
|
|
|
2017-12-06 02:52:11 +01:00
|
|
|
file.m will open in emacs using 'emacsclient -n'. matlab-shell achieve this
|
|
|
|
behavior by instructing MATLAB to use 'emacsclient -n' as the external text
|
|
|
|
editor.
|
2016-03-16 14:50:17 +01:00
|
|
|
|
2017-12-06 02:52:11 +01:00
|
|
|
You can customize this by setting `matlab-shell-emacsclient-command' (Matlab
|
|
|
|
Shell Emacsclient Command) of the matlab-shell customization group. You can
|
|
|
|
change this command to what's appropriate. If you set it to the empty string,
|
|
|
|
'edit file.m' will use the default MATLAB editor setting.
|
2016-03-16 14:50:17 +01:00
|
|
|
|
2017-12-06 02:52:11 +01:00
|
|
|
The default MATLAB editor setting is controlled in the MATLAB preferences,
|
|
|
|
(e.g. R2018a Home tab, Environment section, Preferences) where you can select
|
|
|
|
which editor you want to edit a text file. MATLAB Editor or an external text
|
|
|
|
editor. If you always want to use Emacs as your matlab editor even when
|
|
|
|
running MATLAB outside of emacs, select Text editor and set it to the
|
|
|
|
appropriate 'emacsclient -n' command.
|
2016-03-16 14:50:17 +01:00
|
|
|
|
2017-12-06 02:52:11 +01:00
|
|
|
*** Can I debug *.m files using Emacs as a debugger?
|
2016-03-16 14:50:17 +01:00
|
|
|
|
2017-12-06 02:52:11 +01:00
|
|
|
Starting with MATLAB 8.5 (R2015b), Emacs can no longer be used as a debugger
|
|
|
|
for debugging MATLAB code. With R2015b, MATLAB no longer provides
|
|
|
|
necessary file and line number information for external debuggers. Therefore,
|
|
|
|
in matlab-shell:
|
2016-03-16 14:50:17 +01:00
|
|
|
|
2017-12-06 02:52:11 +01:00
|
|
|
: >> dbstop in foo
|
2016-03-16 14:50:17 +01:00
|
|
|
|
2017-12-06 02:52:11 +01:00
|
|
|
will open foo in the MATLAB editor for debugging.
|
2016-03-16 14:50:17 +01:00
|
|
|
|
2017-12-06 03:09:03 +01:00
|
|
|
#+STARTUP: showall
|
2016-03-16 14:50:17 +01:00
|
|
|
|