#+startup: showall
#+options: toc:nil

# Copyright (C) 2025-2026 Free Software Foundation, Inc.

* Release 8.0.1 Jan-30-2026

Minor /electric indent/ fix to correct comma placement in struct field alignment and also to fix
non-positional name = value arguments and attributes.

* Release 8.0.0 Jan-29-2026

This release updates matlab-ts-mode indent to /electric indent code/. This is sometimes called
pretty printing code or formatting code.

To indent a MATLAB ~*.m~ file,

: C-x h           or  M-: (mark-whole-buffer)
: C-M-\           or  M-x indent-region

See [[file:doc/matlab-code-indent.org][doc/matlab-code-indent.org - MATLAB Indent (Code Format)]]

* Release 7.4.2 Dec 29, 2025

Fix bug in tramp (remote) matlab-shell when matlab is installed in a custom location.

* Release 7.4.1 Nov 26, 2025

1. Fix indent bug. In following typing RET after the argument end statement, the indent now goes to
   the 4th column and not the 8th column:

   #+begin_src matlab
     function test(A)
         arguments
             A
         end
     end
   #+end_src

* Release 7.4.0 Nov 26, 2025

1. Place the =matlab-*-face= definitions in customize matlab-ts-faces group.

2. Add =M-x matlab-ts-describe-faces= along with menu item

   : MATLAB -> Describe faces

   that will bring up a help buffer containing the faces used by matlab-ts-mode.  From there you can
   customize them. This differs from viewing the matlab-ts-faces group in that it contains both
   matlab-*-faces plus other built-in faces such as font-lock-type-face. This help buffer also
   contain more information on when the faces are used.

* Release 7.3.4 Nov 25, 2025

1. Add the source and build instructions for the libtree-sitter-matlab.SLIB_EXT binaries
   found in [[file:matlab-ts-bin][./matlab-ts-bin]] and used by =M-x matlab-ts-grammar-install=.

* Release 7.3.3 Nov 23, 2025

1. Update to latest https://github.com/acristoffers/tree-sitter-matlab which improves
   matlab-ts-mode: matlab-ts-abi14-20251122-90ce9da

* Release 7.3.2 Nov 21, 2025

1. Update to latest https://github.com/acristoffers/tree-sitter-matlab which improves
   matlab-ts-mode.  The changes fix parsing errors up through issues 141 in matlab tree-sitter.

* Release 7.3.1 Nov 14, 2025

1. Fixed M-q (fill-paragraph) in comments when there no space after the '%' character.

2. Improved t-utils-view-parse-tree

3. Made matlab-ts-mode show-paren-mode robust to extra =\n= nodes

* Release 7.3.0 Nov 12, 2025

1. Updated matlab-ts-mode to work with tree-sitter-matlab commit 9d16fcf. This fixes many known
   issues in matlab-ts-mode.

2. Simplified the install of the matlab tree-sitter grammar shared libraries. To enable *matlab-ts-mode*
   you install =matlab-mode= and then =M-x matlab-ts-grammar-install=.

* Release 7.2.1 Oct 30, 2025

1. In matlab-ts-mode, fix indent involving catch clause with a comment.

* Release 7.2.0 Oct 29, 2025

1. Updated matlab-ts-mode to use latest matlab tree-sitter v1.2.3 branch [[https://github.com/acristoffers/tree-sitter-matlab/tree/abi/14][abi/14]] at [[https://github.com/acristoffers/tree-sitter-matlab/tree/9a4e65df4bb08e2b019ca2ef16b2d8f3d95ce978][9a4e65d]]. This
   fixes parse on a number of MATLAB language constructs, which is visible behavior improvements,
   so bumping revision to 7.2.0.

2. In matlab-ts-mode, don't offer to fix function/classdef names when there are syntax errors
   because this can lead to changing the name of other identifiers and not the function/classdef
   name.

* Release 7.1.2 Oct 16, 2025

1. matlab-is-matlab-file: This function identifies when the content of a *.m file
   is MATLAB code, if it's not MATLAB code, Emacs defaults to Objective-C. This fixes
   a case where a *.m contains MATLAB code and the first line is a @function_handle.

* Release 7.1.1 Oct 1, 2025

1. matlab-ts-mode: fix semantic movement in strings. Now C-M-f, C-M-b, C-M-SPC work when point is
   within strings.

* Release 7.1.0 Sep 29, 2025

1. Improved matlab-ts-mode imenu. The imenu index now creates indices for code sections defined by
   "%% heading comments". In addition, the menu was updated to have structure:

   - Class
   - Function
   - Section

   Previously, imenu was a flat list without code sections index entries.

* Release 7.0.1 Sep 13, 2025

1. emacsrunregion fix, https://github.com/mathworks/Emacs-MATLAB-Mode/pull/55

* Release 7.0.0 Sep 12, 2025

1. New matlab-ts-mode.

   matlab-ts-mode is a [[https://tree-sitter.github.io/tree-sitter][tree-sitter]], based MATLAB mode using
   https://github.com/acristoffers/tree-sitter-matlab. This new MATLAB mode is a replacement
   for the matlab-mode.

   + Improved font-lock (semantic coloring) performance, making editing even more smooth.

     - More accurate fontification, we now identify language elements accurately and use
       more faces to color them.

     - Fixes edge-case fontification issues when compared with matlab-mode

       Create issue for this:
         #+begin_src matlab-ts
         x = [1 2; 3 4];
         y = x''               % this is valid double transpose where matlab-mode gets it wrong
         #+end_src

       Function identification, see https://github.com/mathworks/Emacs-MATLAB-Mode/issues/48

     - In comments, we now highlight =FIXME=, =TODO=, and =XXX= markers.

     - Fixed fontification of "%% section" to require that the be the start of a comment and
       on their own line.

     - Variable creation/assignment will be semantically colored.

     - Now fontify all MATLAB/Simulink factory builtin provided functions, class
       methods/properties, enums, etc. Note, if you override a builtin function with a variable,
       the variable creation/assignment will be colored as a variable, but the use will continue to
       be a function.  To avoid this confusing state, use variable names that collide with builtin
       items.

   + Improved indent

     - Simplified the semantics for indent. The indent rules are described in matlab-ts-mode.el
       for completeness.

     - Improved indent performance, making editing very smooth.

     - Fixes various edge-case indent issues, some are

       + Fixed indent of function definition when ellipsis continuations are used.

       + Auto-indentation of end, see https://github.com/mathworks/Emacs-MATLAB-Mode/issues/33

       + Fixed cell and matrices indent alignment problems

   + There's no longer prompting if you want functions to have end's. This is now computed
     automatically.

   + Improved fill-paragraph, =M-q=, which will now fill comments and when not in a comment, indent
     the current function or statement.

   + Accurate type of m-file detection, which improves matlab-sections-minor-mode.

   + Change Log command now work with MATLAB *.m files.

     Running =C-x 4 a= (add-change-log-entry-other-window) will now insert the name of the function
     or classdef for the current point.

   + Added support for =M-x outline-minor-mode=. Outline headings are =function='s, =classdef='s,
     and "%% heading" comments.

   + On save fix of function/classdef name now handles buffer names that aren't valid MATLAB
     identifiers.  On save fix of function/classdef name handles buffers not associated with files
     on disk.  Also fixed cases where detection of scripts failed.

   + Improved handling of single quotes for =M-x electric-pair-mode=. These will automatically
     pair
     - Single quote when used to create a single-quoted string, but not when used elsewhere,
       e.g. a matrix transpose.
     - Double quotes for a double-quoted string.
     - Parenthesis =()=, Vectors, =[]=, and Cells ={}=.

   + We now highlight starting and ending string quote when the point is on the start or end single
     or double quote.

   + Improved (more predictable) s-expression commands

     #+begin_example
       C-M-f   Move forward by s-expression, forward-sexp
               - If point is on the start of an s-expression, move to the end.
               - If point is on the end of an s-expression, move to the start of the next s-expression
                 at the same level. If there is no next s-expression, no movement occurs.
       C-M-b   Move backward by s-expression, backward-sexp
               - If point is on the end of an s-expression, move to the start.
               - If point is on the start of an s-expression, move to the start of the prior s-expression
                 at the same level. If there is no prior s-expression, no movement occurs.
       C-M-SPC Mark s-expression, place point at beginning of sexp and mark at the end, mark-sexp
       C-M-@   Same as C-M-SPC.
       C-M-k   Kill s-expression, kill-sexp
       C-M-t   Transpose s-expressions, transpose-sexp
     #+end_example

   + Improved sentence commands. Also fixes bugs, e.g. M-a in old matlab-mode can result in error
     "Wrong number of arguments: (0 . 0), 1" and now works in matlab-ts-mode.

     #+begin_example
       M-e      Move forward to next end of sentence, forward-sentence
       M-a      Move backward to start of sentence, backward-sentence
       M-k      Kill from point to end of sentence, kill-sentence
       C-x DEL  Kill back from point to start of sentence, backward-kill-sentence
     #+end_example

   + Some older matlab-mode menu items and keybindings have been removed because there are
     standard replacements. Examples:

     - To comment or uncomment code use select the code and type =M-;= which is the standard
       way to do this in Emacs. The older =C-c ;= and =C-c :" matlab only comment and uncomment
       commands no longer exist.

     - Completion - we used to have =M-TAB= to complete symbol and this has been replaced by
       using LSP mode.

   + matlab-shell now has one correct ways of running code sections, via menu =MATLAB -> Code
     Sections -> Run Section (C-c C-<return>)= or and the older =MATLAB -> Run Code Section=
     (matlab-shell-run-code-section) because it was duplication and wasn't correctly handling all
     cases.

   + Builtin items such as namespaces, functions, classes, enumerations, etc. provided by the
     MATLAB/Simulink products are shown in =font-lock-builtin-face=. Using a different face for
     builtins vs items you created improves readability. It also helps to avoid mistakes where you
     override a builtin with a variable. The number of builtin items in the MATLAB/Simulink
     R2025a.update1 product family is 153,627.

   + When creating a variable that matches a builtin item
     matlab-ts-mode-variable-override-builtin-face. This makes it easy to see when you are
     accidently shadowing a builtin function, class, etc. For example, in the following
     we create a lines variable that shadows the MATLAB built-in lines function:

      #+begin_src matlab
        lines = ['line1', 'line2']
      #+end_src

    Using a non-builtin name for a variable results in the standard =font-lock-variable-name-face=
    being used:

      #+begin_src matlab
        myLines = ['line1', 'line2']
      #+end_src

   + MLint MATLAB code analyzer integration via flycheck. Flycheck is an improved on-the-fly
     error reporting system when compared with the mlint integration in the older matlab-mode.

   + New "MATLAB -> View mlint code analyzer messages" menu item.

   + New "MATLAB -> View tree-sitter parse errors" menu item that lets one inspect
     the parse errors found by the MATLAB tree-sitter backing the new matlab-ts-mode.

   + New "MATLAB -> Jump to function" menu item.

   + New "MATLAB -> Check setup" menu item that helps validate flycheck and lsp-mode are
     setup correctly.

   + New "MATLAB -> Editing -> ..." submenu that contains helpful editing commands.

2. Added [[file:doc/matlab-netshell-for-windows.org][doc/matlab-netshell-for-windows.org]]. Commit [[https://github.com/mathworks/Emacs-MATLAB-Mode/commit/b0222ac2c067292b43fba91a60b39a262c6149d3][b0222ac]].

   #+begin_example

    +--------------- Emacs ----------------+         +------------  MATLAB  ------------+
    |                                      |         |                                  |
    | (1) M-x matlab-netshell-server-start |         | (2) connect to Emacs             |
    |                                      |<=======>| >> addpath <matlab-mode>/toolbox |
    | (3) Visit script *.m files and use   |         | >> emacsinit                     |
    |     "MATLAB -> Code Sections" menu   |         | >>                               |
    |     or the key bindings              |         |                                  |
    +--------------------------------------+         +----------------------------------+

   #+end_example

3. Setup imenu for *.tlc files. Commit [[https://github.com/mathworks/Emacs-MATLAB-Mode/commit/7d0d26a0312cf3a7b0cb07ff982f1b5274f96424][7d0d26a]] and [[https://github.com/mathworks/Emacs-MATLAB-Mode/commit/e3e6952d57955764d48e9f9432247903672297dc][e3e6952]].

4. Fix imenu for ~*.m~ files and added [[file:doc/matlab-imenu.org][doc/matlab-imenu.org]] on using it. Commit [[https://github.com/mathworks/Emacs-MATLAB-Mode/commit/a54d2061bd31c9cba32fc5e0e0ecf34b900e26d1][a54d206]].

   Now typing ~M-g i~ (or ~M-x imenu~) when visiting a ~*.m~ file will let you quickly jump to
   function declarations.

5. Indent first non-help comment. Commit [[https://github.com/mathworks/Emacs-MATLAB-Mode/commit/a63e0fe398fa0e49ef0ca71eb1371a0b45ce62cd][a63e0fe]].

   #+begin_src matlab
     function b = foo
     % This is the help for function foo
     % which can span multiple lines.

         % This is a non-help comment for the following code
         b = 1;
     end
   #+end_src

6. [[https://github.com/mathworks/MATLAB-language-server][MATLAB Language Server]], matlabls, for code navigation, code completion, go to definition,
   find references, and more. See [[file:doc/matlab-language-server-lsp-mode.org][doc/matlab-language-server-lsp-mode.org]]. Commit [[https://github.com/mathworks/Emacs-MATLAB-Mode/commit/e9ab4fb8b0fedc0e769f4c7e0d86bd26a08567f8][e9ab4fb]].

7. Improved Emacs tramp remote *M-x matlab-shell*. Commit [[https://github.com/mathworks/Emacs-MATLAB-Mode/commit/64e1805d36a362111ac3518a4fd7428c60483079][64e1805]].

   Prior to this commit, matlab-shell running through Emacs tramp partially.  This commit enables
   remote matlab-shell and enables remote debugging, hyperlinks, etc.  See [[https://github.com/mathworks/Emacs-MATLAB-Mode/blob/default/doc/remote-matlab-shell.org][remote-matlab-shell.org]]
   documentation.

8. Remove font-lock-constant-face from help comments. Commit [[https://github.com/mathworks/Emacs-MATLAB-Mode/commit/1d935b364dd90449a9dfa9a8743e275359096289][1d935b3]].

   A general guideline for help comments is to capitalize functions such as PLOT as references and
   matlab-mode used to make these a font-lock-constant-face inside of comments. However, often capital items are
   not references and make comments look bad, so removed these. Likewise, there were other uses of
   font-lock-constant-face that look odd, so removed these.

9. Revamped MATLAB code sections script support issues. Commit [[https://github.com/mathworks/Emacs-MATLAB-Mode/commit/e75ebf5a88b02833d700bcf9ee4419c5888caf12][e75ebf5]] and others.

   - Added [[file:doc/matlab-code-sections.org][doc/matlab-code-sections.org]].

   - MATLAB code sections is now a minor mode, *matlab-sections-minor-mode* which is automatically
     enabled when in a MATLAB script. A MATLAB script contains one or more MATLAB commands or
     function calls.

   - When visiting a MATLAB *.m script, you now have *MATLAB -> Code Sections* menu which includes
     all command and there's a help entry explaining how to use the code sections capabilities.

   - The default key bindings for MATLAB code section functions are now ~C-c C-<KEY>~ and
     ~C-c M-<KEY>~, which means code sections key bindings work on system without the super
     (aka Windows) key.  Super key bindings can be added by customizing
     ~matlab-sections-use-super-key~.

     : C-c C-SPC        matlab-sections-mark-section

     : C-c C-<up>       matlab-sections-backward-section
     : C-c C-<down>     matlab-sections-forward-section
     : C-c C-<left>     matlab-sections-beginning-of-section
     : C-c C-<right>    matlab-sections-end-of-section

     : C-c M-<up>       matlab-sections-move-section-up
     : C-c M-<down>     matlab-sections-move-section-down

     : C-c C-<return>   matlab-sections-run-section
     : C-c M-<return>   matlab-sections-run-prior-sections

   - Improved performance in detecting MATLAB *.m file type, which gives a small speedup to
     matlab-mode.

   - MATLAB code sections are now identified by header comments of form "%% description" and no
     longer get confused with "%%%%%" comment blocks.

   - Fixed [[https://github.com/mathworks/Emacs-MATLAB-Mode/issues/14][issue #14]] and many other fixes.

   - Added tests, [[https://github.com/mathworks/Emacs-MATLAB-Mode/issues/8][issue 8]].

10. Enhanced *M-x matlab-shell* to search for MATLAB in standard installation locations if it is not
    on the path. If we are unable to find MATLAB, we now generate an error explaining how to setup
    your system to make matlab-shell work. Commit [[https://github.com/mathworks/Emacs-MATLAB-Mode/commit/9773232626919a6319e3ac36bc7e0cdd99c46585][9773232]].

11. Improved fill-paragraph to work when point is before a comment. Commit [[https://github.com/mathworks/Emacs-MATLAB-Mode/commit/8686c85cf376f90549d3aaf8478ed381f22282aa][8686c85]].

12. Add TAB completion in matlab-shell for MATLAB R2025a. Commit [[https://github.com/mathworks/Emacs-MATLAB-Mode/commit/e92fe818acd71c4bead7bdf837e791b5aa456d11][e92fe81]] and several followup
    commits.

13. Fixed Emacs 30 lisp compiler warnings. Commit [[https://github.com/mathworks/Emacs-MATLAB-Mode/commit/89b585e6d935fd36176791caa66d4dad0405407b][89b585e]].

14. Fixed [[https://github.com/mathworks/Emacs-MATLAB-Mode/issues/56][issue #56]], *.m files within archives, e.g. foo.zip containing bar.m

* Release 6.3 Dec 8, 2024

This is the first [[https://elpa.gnu.org/packages//matlab-mode.html][ELPA matlab-mode]] release (commit [[https://github.com/mathworks/Emacs-MATLAB-Mode/tree/935137844e16551a5369f928d2591556be7fb9c2][9351378]]).  This release provides:

1. *matlab-mode*  for editing *.m MATLAB files

2. *M-x matlab-shell* for running and debugging MATLAB within Emacs (Unix-only)

3. *M-x matlab-netsell* for interacting with a separate MATLAB from Emacs on Microsoft Windows.

4. *Code sections* for working with MATLAB script code files.

5. *Org-mode* support for creating scientific papers using MATLAB and org babel.

6. *tlc-mode* for editing ~*.tlc~ files

* Older releases

matlab-mode was created in 1991.  Change history from 2005 till now
can be found in https://github.com/mathworks/Emacs-MATLAB-Mode.

The prior location for matlab-mode was [[https://sourceforge.net/projects/matlab-emacs/][https://sourceforge.net/projects/matlab-emacs/]].  Locations
prior to sourceforge no longer exist.

See older history [[https://github.com/mathworks/Emacs-MATLAB-Mode/blob/2ff6f96294353f3f17757a2522a64c427929ff01/ChangeLog][ChangeLog]], [[https://github.com/mathworks/Emacs-MATLAB-Mode/blob/528a4fc79426adc7cf9a484d231dec7defd9c5f4/ChangeLog.old1][ChangeLog.old1]], [[https://github.com/mathworks/Emacs-MATLAB-Mode/blob/528a4fc79426adc7cf9a484d231dec7defd9c5f4/ChangeLog.old2][ChangeLog.old2]], and older [[https://github.com/mathworks/Emacs-MATLAB-Mode/blob/b7e170ee37a23b6852e461772de1c4e986bb6833/NEWS.org][NEWS.org]].

# LocalWords:  showall ELPA MELPA fontification fontify sexp SPC LSP builtins MLint flycheck lsp
# LocalWords:  netshell emacsinit imenu matlabls netsell sourceforge MMM YYYY emacsrunregion libtree
# LocalWords:  SLIB abi ce da utils fcf Untabify
