Version 8.1.2 of package Matlab-Mode has just been released in GNU ELPA. You can now find it in M-x list-packages RET.
Matlab-Mode describes itself as: ==================================== Major mode for MATLAB(R) dot-m files ==================================== More at https://elpa.gnu.org/packages/matlab-mode.html ## Summary: 1 Emacs MATLAB-mode ═══════════════════ [MathWorks] MATLAB® and [GNU Emacs] integration: 1. MATLAB mode, *matlab-ts-mode* or *matlab-mode*, for editing `*.m' files. • Edit MATLAB code with syntax highlighting, indentation (code formatting), and semantic movement. • Lint MATLAB code with fix-it's using the MATLAB Code Analyzer. The *matlab-ts-mode* is a more capable, performant, and accurate than *matlab-mode*. 2. *Code navigation and more* • The [MATLAB Language Server with Emacs], matlabls, provides code navigation, code completion, go to definition, find references, and more. • Imenu support for quickly jumping to function declarations in the current `*.m' or `*.tlc' file. See [doc/matlab-imenu.org]. ## Recent NEWS: 1 Release 8.1.2 Mar-15-2026 ═══════════════════════════ 1. matlab-ts-mode: improved performance of electric indent. Previously we were using (treesit-node-at (point)) to obtain the language elements to indent. Now we use treesit-capture-query which is faster. This is the first step in speeding up electric indent. Future possible optimizations include using symbols from the treesit-capture for language element identification rather than treesit-node-type, simplification of matrix alignment and the other alignments, additional removal of treesit-node-at, etc. 2. matlab-ts-mode: fixed trailing comment alignment problems. Now we only align consecutive statements when in same scope. For example, first comment below is in a different scope so not aligned with the last two comments: ┌──── │ fooBarGooToo = [something, ... │ [otherThing(wIndex) : theEndIndex(wIndex) - 1, ... │ otherThing(wIndex) + 1 : theEndIndex(wIndex); ... │ otherThing(wIndex) + 1 : theEndIndex(wIndex), ... │ otherThing(wIndex) : theEndIndex(wIndex) - 1]]; %#ok<AGROW> │ P0 = [P0, foo.blah{wIndex}.foobarGooOrig(:, 1 : end - 1)]; %#ok<AGROW> │ P1 = [P1, foo.blah{wIndex}.foobarGooOrig(:, 2 : end)]; %#ok<AGROW> └──── 3. matlab-ts-mode: when using keywords (end, arguments, etc.) as variables or functions, they now indent correctly. Note, MATLAB allows end.m, arguments = 10, etc. 4. matlab-ts-mode: An ellipsis at start of file no longer causes a hang 5. matlab-shell: add matlab-shell-before-start-hook 6. matlab-shell: hyperlink syntax error 2 Release 8.1.1 Feb-22-2026 ═══════════════════════════ 1. Enable matlab-ts-mode with Emacs 30.2 which is using tree-sitter ABI 15 (or 14). Note, Emacs 30.1 is using tree-sitter ABI 14 which continues to work. 2. Update installation instructions for the MATLAB Language Server 3. Fix mlint.el issue ("Do not permit multiple groups with the same name") 3 Release 8.1.0 Feb-16-2026 ═══════════════════════════ 1. The behavior of TAB and RET in matlab-ts-mode to electric indent/code-format adjacent lines of code. There is no change in the indent/code-format rules. The goal of this change is to improve editing interactions with the MATLAB indent/code-format engine. • TAB behavior example. Given ┌──── │ a = 1; │ foo = 2; │ foobar = 3; └──── A TAB on any these code lines results in: ┌──── │ a = 1; │ foo = 2; │ foobar = 3; └──── • RET behavior example. Given ┌──── │ v1=1; │ var2= [1,1]; └──── Typing the 4 characters, `x=3;', on the 3rd line (without typing RET) gives us: ┌──── │ v1=1; │ var2= [1,1]; │ x=3; └──── When we type the RET, we get: ┌──── │ v1 = 1; │ var2 = [1, 1]; │ x = 3; │ └──── Now, if we type a RET at the end of the 2nd line, we get the following. Notice that the alignment of x assignment has changed. ┌──── │ v1 = 1; │ var2 = [1, 1]; │ │ x = 3; │ └──── 1. An "electric ends" edge case issues in matlab-ts-mode has been fixed. When typing a statement that is terminated by an end, e.g. "if", "function", "classdef", etc. the "end" keyword is automatically added for you. For example, given: ┌──── │ if a └──── typing RET at the end of the "if a" line results in: ┌──── │ if a │ │ end └──── where the point is left on the 2nd line, indented to 4 spaces. There were some edge cases where an end-statement was being incorrectly inserted. This primarily occurred with continued (ellipsis) conditions following the "if" and similar statements. For example, given the following, typing RET at the end of the first line will not add an end-statement … …
