Skip to content

Latest commit

 

History

History
91 lines (66 loc) · 3.19 KB

File metadata and controls

91 lines (66 loc) · 3.19 KB

How to install Emacs MATLAB from Git

When contributing or trying out newer changes, you’ll need to install the Emacs-MATLAB-Mode package from git. The install below uses ~/emacs-projects as a work area. You can change that as desired.

Consider creating a temporary home

You can create a temporary home by setting the environment variable, HOME set to a temporary location. This lets you develop Emacs MATLAB Mode in a clean environment. See DEBUGGING.org.

Install MATLAB tree-sitter grammar

If using Emacs 30 or later you need to install the MATLAB tree-sitter grammar. This is needed for the tests.

Build Emacs-MATLAB-Mode

cd ~/emacs-projects

git clone https://github.com/mathworks/Emacs-MATLAB-Mode.git

cd Emacs-MATLAB-Mode

# Build lisp and run tests (requires MATLAB executable on your system PATH)
make

# Alternatively, build lisp and run tests using a specific MATLAB executable
make MATLAB_EXE=/path/to/matlab

# If desired, you can separate the building of lisp and running tests using:
make lisp
make tests
make tests MATLAB_EXE=/path/to/matlab # if using a specific MATLAB executable

Update ~/.emacs

Add the following to your ~/.emacs file:

(add-to-list 'load-path "~/work-area/Emacs-MATLAB-mode")
(load-library "matlab-autoload")

Install lsp-mode

Install lsp-mode and related packages. See doc/matlab-language-server-lsp-mode.org

Check setup

If you are using matlab-ts-mode, visit a *.m MATLAB file and select the menu item:

MATLAB -> Check setup