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.
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.
If using Emacs 30 or later you need to install the MATLAB tree-sitter grammar. This is needed for the tests.
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 executableAdd the following to your ~/.emacs file:
(add-to-list 'load-path "~/work-area/Emacs-MATLAB-mode")
(load-library "matlab-autoload")Install lsp-mode and related packages. See doc/matlab-language-server-lsp-mode.org
If you are using matlab-ts-mode, visit a *.m MATLAB file and select the menu item:
MATLAB -> Check setup