(matlab-lattr-block-close):
Stop decrementing for else type keywords.
(matlab-calculate-indentation-1):
Allow block comments to be help comments.
tests/continuations.m:
Add suite of previously failing tests.
tests/indents.m:
Block comments can now be help.
(matlab-scan-block-start-context): New
matlab.el:
(matlab-lattr-block-cont): Rename to
(matlab-lattr-block-open): New name, return 0 not nil.
(matlab--calc-indent, matlab-show-line-info): Call matlab-next-line-indent w/ new inputs.
(matlab-calculate-indentation-1):
Replace old END indent logic with call to `matlab-scan-block-start-context'
and then stabilize dedent to match block start.
(matlab-next-line-indentation): Better inputs based on what's used.
Delete dead code and commented out code.
tests/continuations.m:
Enabled test that now 'works'.
(matlab--buffer-block-tree): Delete
(matlab--scan-block-forward):
Handle case when `matlab-functions-have-end' is false.
(matlab-re-search-keyword-forward,matlab-re-search-keyword-backward):
Handle bounds correctly before restarting a scan.
(matlab-scan-before-change-fcn):
Only clear cached items AFTER the change.
matlab.el:
(matlab-in-command-restriction, matlab-with-current-command)
(matlab-lattr-local-end): DELETE
(matlab-backward-sexp, matlab-forward-sexp):
Reimplement using matlab--scan-block-forward/backward.
(matlab-lattr-block-cont, matlab-lattr-block-close):
Remove narrowing to current command, and use new search utils with bounds.
(matlab-lattr-middle-block-cont): Comment out
tests/metest.m:
(metest-sexp-traversal-test variable): better name.
(metest-sexp-traversal-test): Use new `matlab--scan-block-forward' / backward
instead of orig fcns.
tests/blocks.m:
Tweak a few test points to make them more challenging.
tests/continuations.m:
Added test with continuation, but disabled the problem.
tests/indents.m:
Brought in problem lines that break array sexp w/ ' in continuation
tests/mfuncnoend.m:
Fix whitespace.
tests/mfuncnoendblock.m:
Fix mlint warnings.
(matlab-compute-line-context): Don't change the match data.
(matlab-scan-end-of-command): New
matlab-syntax.el:
Doc string fixes.
matalb.el:
(matlab-find-prev-code-line): Now uses matlab-scan-beginning-of-command
instead of old version.
(matlab-with-current-command): Now uses matlab-scan-beginning-of-command AND
matlab-scan-end-of-command to build the narrowed region.
(matlab-cursor-on-valid-block-start): Make this immune to changes in
match-data from various conditions in the cond statement.
Use new matlab-scan-beginning-of-command instead of old version.
(matlab-beginning-of-command): Now use matlab-scan-beginning-of-command
as default impl. Delete this fcn later.
(matlab-lattr-block-close):
Track original starting pos better, grab line context after moving to start.
tests/metest.el:
Include new continuations.m test file.
tests/continuations.m:
New test file
tests/indents.m:
Move a couple tests into continuations.m
(matlab-syntax-support-command-dual): New way to control
handling command dual syntax in the syntax table.
(matlab--syntax-propertize): Obey above config by
skipping command dual scanning if nil.
tests/stringtest.m:
Add local variables to enable matlab-syntax-support-command-dual for
this file
(matlab-block-keyword-list): Add more keywords.
(matlab-compute-line-context-lvl-1): improve keyword detection
to handle the new types of keywords that don't start blocks.
Improve end of line detection to distinguish command dual from ellipsis.
(matlab-line-commanddual-p): New
(matlab-scan-previous-line-ellipsis-p): Improve how ellipsis is found
to be more explicit.
(matlab-describe-line-indent-context): Show command dual in output.
matlab.el:
(matlab-lattr-cont): Improve how ellipsis is found to be more
explicit.
indents.el:
Add more keyword styles around to deal with command dual problems.
Make accessing keywords easier.
(matlab-keyword-p): New
(matlab-compute-line-context-lvl-1): Use above.
matlab-syntax.el:
Support command dual as a string in the syntax tabe.
(matlab--command-dual-syntax): New syntax type
(matlab--syntax-propertize): Call scanner for command-dual.
(matlab--scan-line-for-command-dual): New.
(matlab--font-lock-syntactic-face):
Detect command dual and provide that face.
Detect cellbreak comments and provide that face.
(matlab-cursor-comment-string-context):
Also detect commanddual strings, and return that status.
matlab.el:
Revamp font lock keywords to take advantage of updates in
`matlab--font-lock-syntactic-face' updates, and to just
lean into use of defface.
(matlab-show-mlint-warnings, matlab-highlight-cross-function-variables):
Make safe local variables.
(matlab-commanddual-string-face): New variable.
(matlab-font-lock-adjustments): Delete as a function and hook setup.
Replace with just the classic defface calls, but cleaned up to
also :inherit from base faces.
(matlab-file-basic-font-lock-keywords): Remove cell break code.
tests/metest.el:
Add tests for commanddual strings.
(metest-comment-string-syntax-test):
Add ability to test for commanddual strings.
tests/stringtest.m:
Add some command dual examples.
(metest-indents-randomize-files):
Force matlab-mode to re-run so script type is recomputed after
extra indent added.
mfunspacey.m:
New file for script type detection tests.
(matlab-calculate-indentation-1):
when inside parentheticals; capture indentation
of start as our previous indentation.
Later, ignore all that and just use paren column.
Left notes about what else to fix.
tests/indents.m:
Updated to match new indentation logic.
(metest-all-syntax-tests): Force files used for intenting to be
pre-spaced incorrectly.
(metest-condition-case-error-msg): Fix how caught errors are thrown.
(met-indents-files): Add mfuncnoendblock.m
(metest-indents-randomize-files): New
Not really random.
(metest-error): Add a buffer excerpt before throwing an error.
tests/indents.m, tests/mfuncends:
Added more indent tests.
tests/mfuncnoendblock.m:
Add more content.
Enable for use in indentation test.
(matlab-all-syntax-tests):
Reset the scanner cache hit stats and print when done.
(metest-test-error): Var flag.
(mecondition-case-error-msg):
When test flag set, forward the error along.
(metest-error): Set metest-test-error flag to pass errors through.
(metest-indent-counts): New
(metest-indents-test): Remove core test into new fcn.
Now set matlab--change-indentation-override to our fcn for tracking.
Now call matlab-indent-region with flags for testing.
(metest-indents-test-hook-fcn): New fcn that does the test
on each line from indent-region after indentation is compuated.
Improve control of debugging output by enabling for test script code,
but disabling while running individual tests.
Tests will catch the error, and show the line in the file where
the test failed.
Revise to move all message output outside what is being timed.
Move looping over files outside the test functions.
Combine timings from one test point to one number to be recorded.
Reduce # of lines output during test running.
(matlab-calculate-indentation-1):
Replace old -ltype- API calls with new API from matlab-scan.el.
Delete chunks of block comment handlers, replaced with simpler
code using matlab-scan stuff.
matlab-scan.el:
(matlab-compute-line-context-lvl-1):
Rename block comment stype values.
When a keyword is found, only enable iff not in parens.
Trailing comment section, if line starts with a comment,
assume it ends with a comment, and compute key values.
(matlab-line-comment-style, matlab-line-end-comment-column)
(matlab-line-ellipsis-p):
New
(matlab-line-end-p, matlab-line-block-middle-p)
(matlab-line-block-case-p):
New
(matlab-line-close-paren-p, matlab-line-close-paren-char)
(matlab-line-close-paren-col):
New
(matlab-describe-line-indent-context):
Fixup for various changes.
(matlab-calc-indent):
If current line detects we are in an array continuation, then
it is not necessary to compute next-line indentation from it's context
since you can't have if/end type code in there.
Also, array continuation detection is now very fast.
tests/indents.m:
Added a bunch of misc indenttion tests around nested arrays, cell arrays, etc.
(matlab-ltype-comm): Make robust to block comment start,
where bounds returns false when on start. Need to also check
for the start of a block comment.
(matlab--maybe-yes-or-no-p): New
(matlab-calcuate-indentation-1):
Use above instead of yes-or-no-p.
metest.el:
(met-end-detect-files): Add mfuncnoendblock.m
mfuncends.m:
Fix expected indentation numbers for continued arrays.
mfuncnoendblock.m:
New.
(metest-error): New function
Adds file / lineno to test errors so you can jump to the right location quickly.
(metest-*-test): Update all functions to use `metest-error'.
(matlab-lattr-block-close): After narrowing buffer,
got to eol, not max - as we had to expand the narrowed region
to handle special syntax chars on eol.
metest.el:
(metest-all-syntax-tests): Add ...
(metest-end-detect-test): New test
(met-end-dect-files): New Var
(metest-comment-string-syntax-test)
(metest-sexp-counting-test, metest-sexp-traversal-test)
(metest-indents-test, metest-parse-test):
Use new `metest-find-file' for loading in files.
(met-indents-files): Add mfuncends.m
tests/empty.m:
tests/mfuncends.m:
tests/mfuncnoend.m:
New test files
tests/stringtest.m:
tests/mclass.m:
Add end-detect expected value cookies.
Delete large swaths of code related to syntax tables which
has moved to matlab-syntax.el.
(matlab-syntax): New require.
(matlab-mode-syntax-table, matlab-mode-special-syntax-table):
Moved to matlab-syntax.el
(matlab-font-lock-string-start-regexp)
(matlab-font-lock-string-and-comment-start-regexp)
(matlab-test-allstring-comment-match)
(matlab-font-lock-allstring-comment-match-normal):
No longer needed. Deleted.
(matlab-font-lock-extend-region):
Switch to use matlab-block-comment-bounds.
(matlab-block-comment-*-re, matlab-ltype-block-comment-*):
Moved to matlab-syntax.el
(matlab-basic-font-lock-keywords):
Delete comment and string highlighting.
(matlab-basic-file-font-lock-keywords):
Delete block comment highlighting.
(matlab-mode): Delete all code related to syntax stuff.
Add call to `matlab-syntax-setup'.
Remove `after-change-functions' - no longer needed to handle block comments.
Enable syntax table font-locking comments/strings.
Remove special forward-sexp-function.
(matlab-navigation-syntax, matlab-up-list):
Moved to matlab-syntax.el
(matlab-with-current-command): Extend restricted region 1 char
past eol to include newline - needed for end-of-comment.
(matlab-backward-up-string-or-comment): Fix ellipsis spelling.
Only backup 1 char, reverse scan goes to beginning, not end of ...
(matlab-move-list-sexp-internal)
(matlab-move-simple-sexp-backward-internal)
(matlab-move-simple-sexp-internal)
Deleted.
(matlab-backward-sexp, matlab-forward-sexp)
(matlab-beginning-of-command, matlab-ltype-comm)
(matlab-debug-block-comm)
(matlab-electric-block-comment)
(matlab-show-paren-or-block)
(matlab-mode-vf-block-matches-forward):
Rename matlab-ltype-block-comm to matlab-block-comment-bounds.
(matlab-ltype-block-comm-bounds, matlab-ltype-block-comm-lastcompute)
(matlab-change-funtion, matlab-ltype-block-comm, matlab-ltype-block-comm-1):
Deleted.
(matlab-ltype-block-comm-at-*)
(matlab-cursor-comment-string-context)
(matlab-cursor-in-string-or-comment)
(matlab-cursor-in-comment)
(matlab-cursor-in-string):
Moved to matlab-syntax.el
(matlab-calculate-indentation-1):
Replace old block comment stuff with new `matlab-block-comment-bounds'.
Stop using old cache, just compute bounds once and use it.
tests/mtest.el:
Rename matlab-ltype-block-comm to matlab-block-comment-bounds.
Fix spelling of ellipsis
Add a little more debugging output.
Makefile, Project.ede:
Add matlab-syntax.el
tests/stringtest.m:
Add some blank lines to protect against indentation.
Fix indentation.
(matlab-lattr-block-close): Account for commend imediately after
the end keyword.
tests/blocks.m:
(tightcomments): Add sample with comments tight to end
of every statement with indentation test cookies.
(matlab-valid-end-construct-p): an 'end' after a . is a field,
and not a valid block end.
(matlab-cursor-on-valid-block-start): any block after a . is a field,
and not a valid block start.
mlint.el:
(mlint-lm-missing-end::mlint-fix-entry): Fix too many close )
tests/blocks.m:
Add struct_stuff method to verify not indenting anything after a .
tests/stringtest.m:
Add an invalid block comment (all on one line) with test markers in it.
(matlab-block-end-pre): Reverse choice of regex used if functions have end.
This appears to have been backwards for a very long time.
(tests/blocks.m, tests/indents/m, tests/mclass.m):
Save with correct indentation for blank lines.
Add tests with function ... end on the same line.
(matlab-file-basic-font-lock-keywords)
(matlab-file-lass-font-lock-keywords):
first-on-line keywords must be followed by specific charts to be highlighted.
(matlab-find-prev-lie): Add optional input to ignore all comments.
(matlab-prev-line): fix doc to note it will stop on comments.
(matlab-cursor-on-vlaid-block-start):
When finding context for 'arguments', use `matlab-find-prev-line' instead
since arguments must be first actual code in the function.
(matlab-beginning-of-command): Wrap impl in save-match-data.
tests/Makefile:
Only run "shelltests" if not on windows.
tests/metest.el:
(met-sexp-test-files, metest-indents-files): Add blocks.m
tests/blocks.m:
Add more cases abusing keywords as variables.
Instrument for testing with metest.el.
(matlab-block-comment-start-re, matlab-block-comment-end-re):
New regular expressions used to find the start/end of a block comment.
(matlab-ltype-block-comment-start, matlab-ltype-block-comment-end):
New predicates to check for block comment features.
(matlab-find-block-comments, matlab-ltype-block-comm-1):
Use new block comment expressions instead of hand-written regexps.
(matlab-ltype-block-comm-at-start, matlab-ltype-block-comm-at-end)
(matlab-electric-block-comment):
Use new block comment predicates.
indents.m:
Add some block comment indentation tests with valid and invalid block
comment starts.
(matlab-keyword-list, matlab-class-font-lock-keywords)
(matlab-mcos-regexp): Add 'events' keyword to be
supported the way 'properties' keyword is.
tests/mclass.m:
Add 'events' block with 2 events in it.
Add additional debugging tests, including for breakpoints buffer, and stack display.
(mstest-debugger): Add extra debugging testss.
(mstest-debugger-stacklist, mstest-debugger-breakpointlist):
New test helpers.
(mstest-debugger-breakpoint): Allow to test for multiple breakpoints by
looping over extended inputs list.
(metest-comment-string-syntax-test):
Add block comment testing.
(met-sexptest-files): Remove indents.m, it had
not test points for sexp tests.
tests/stringtest.m:
Add a block comment and tests for detecting contents.
New compat macros for cl-defmethod, pulse, and font-lock stuff.
linemark.el, mlint.el, matlab-shell-gud.el, semanticdb-matlab.el:
Replace defmethod with cl-defmethod.
Replace call-next-method with cl-call-next-method.
linemark.el:
Also require matlab-compat.el
tests/Makefile:
Allow EMACS to be overridable
Add tests for <EMACSCAP> tokens.
(mstest-run-all-tests): Add mstest-capture.
(mstest-completion): Fix expected value now that 'emacscd' is in toolbox.
(mstest-capture): New. Tests help and custom testeeval.m.
tests/testeeval.m
New. Test Emacs EVAL.
Uses <EMACSCAP> token with (eval) buffer to tell Emacs to set
a variable that mstest can check.