|
From: Eric L. <eri...@gm...> - 2021-05-05 00:24:18
|
Hi all,
John C and I had been working on a revised indentation engine for
matlab-mode back in March. After a month of testing (which John has been
working on) we think is ready for more general testing and integration into
the mainline.
The new engine fixes a wide range of bugs and includes massive performance
improvements enabling large M files that used to take multiple hours to
indent to now fully indent in less than a minute.
You can access the new version on the 'hairyblocks' branch on sourceforge;
named for some rather challenging block indentation problems we solved.
Here are a few highlights of what is in the new branch:
* Comments and strings are now handled via syntax tables. This means:
* Faster font lock & indentation
* Standard navigation & edit commands now works w/ strings & comments
* Standard tools that operate on strings & comments now work w/ matlab
mode
* More font lock color options for various types of strings and comments
* List navigation (via (), [], or {}) via std commands now works.
* Argument, Properties, Methods, Events blocks now detect and indent
correctly. This means:
* matlab-mode detects 'arguments' and other keywords as a variable or
keyword depending on context
* faster forward/backward block navigation.
* electric indent for block keywords.
* Tested the indentation engine against a huge corpus of M code. This
means:
* Lots of indentation bug fixes for random edge cases.
* Focused performance improvements for large files and classes.
* Improved local test suite to keep things working.
* Mode overrides for sexp & defun detection. This means:
* special keybindings for forward/back sexp no longer needed
* special keybindings for begin/end defun no longer needed
* tools that use sexp navigation (kill, mark, etc) now work.
* tools that use defun navigation (mark, narrow, etc) now work.
* Improved file end-type detection. This means:
* shows end-type of the file in mode line
* auto-detects on save w/ fewer questions.
* mlint will add 'end' in the correct place if an end is missing.
* Removed keybindings for 'return'. This means:
* global settings for behavior of RET now also apply to matlab-mode.
* blank lines will have no trailing spaces after RET or during indent
region.
* Modernized font-lock by using newer font lock faces
* Update the version #
There are some downsides, however. Several chunks of compatibility code
for Emacs version 19, 20, and probably XEmacs were removed along the way,
mostly because I don't have any versions of Emacs that old so had no way to
verify it continued to work as I updated the code.
For anyone who has the interest, give it a try and let us know how it
goes. If all goes well, I propose this be merged into the master branch.
Thanks
Eric & John
|