(matlab-mode) Change default value for `add-log-current-defun-function'
to be `matlab-add-log-current-defun'.
(matlab-current-cell): New
(matlab-add-log-current-defun): New. Use `matlab-current-defun' or above.
matlab-syntax.el:
(matlab-syntax-setup): Remove extra setting of page-delimiter.
(matlab--valid-arguments-keyword-point):
If previous code is 'end', make sure it matches a valid arguments block.
(matlab-re-search-keyword-forward,matlab-re-search-keyword-backward):
When checking if in string/comment, don't pass in 'all comments' as t.
Do that only if in a comment.
matlab-syntax.el:
(matlab-beginning-of-string-or-comment):
Make doc accurate.
(matlab-end-of-string-or-comment):
Fix logic for case when not in a comment to only skip all comments if
looking at a comment. Avoid moving pt if just looking at whitespace.
matlab.el:
(matlab-do-functions-have-end-p):
Improve scanning for end to not do condition-case.
This was hiding an error that was causing incorrect answer.
(matlab-beginning-of-string-or-comment):
If 'all-comments' is passed in, always skip those comments even if
not in a comment right now.
(matlab-end-of-string-or-comment):
If 'all-comments' is passed in, always skip those comments even if not
in a comment right now.
Make a defun, not defsubst since it is getting pretty big.
matlab.el:
(matlab-mode-menu): Remove navigate menu. No special navigation anymore.
(matlab-mode): Setup beginning-of-defun-function and end-of-defun-function.
(matlab-beginning-of-defun, matlab-end-of-defun):
Update to have input arg like built-in version.
Be more robust about skipping over comments between defuns.
(matlab-beginning-of-defun-raw): New - from above.
(matlab-skip-over-defun): New.
(matlab-current-defun): Use raw version.
(matlab-show-line-info): Fix bug.
Also print name of current defun.
(matlab-move-simple-sexp-backward-internal,matlab-move-simple-sexp-internal):
Set `forward-sexp-function' to nil so the next call doesn't route to
`matlab-forward-sexp' by accident.
matlab.el:
Disable custom stuff related to navigating sexp, and instead depend on `forward-sexp-function'
to enable built-in Emacs behavior in all cases, not just the special ones we added.
(matlab-mode-map): Remove all bindings that do navigation.
(matlab-mode): Remove comments about custom nav commands.
Set `forward-sexp-function' to `matlab-forward-sexp-function'.
(matlab-forward-sexp-fcn): NEW
(matlab-backward-sexp, matlab-forward-sexp): Remove interactive key.
(matlab-block-comment-start-re, matlab-block-comment-end-re)
(matlab-ltype-block-comment-start, matlab-ltype-block-comment-end)
(matlab-block-comment-bounds):
DELETED - no longer used.
matlab.el:
(matlab-mode-map): Re-arrange the map.
Delete bindings for return and c-j (use default)
Add comments and build sections.
(matlab-mode): Update comments.
Add electric-indent-functions setting.
Remove matlab-comment-indent as a setting (use nil)
(matlab-return-function, matlab-return, matlab-plain-ret)
(matlab-indent-after-ret, matlab-indent-end-before-ret)
(matlab-semicolon-on-return, matlab-indent-before-ret)
(matlab-linefeed):
DELETED - use default 'newline' and electric indents instead.
(matlab-electric-indent-function):
NEW - auto-reindent when finishing typing end,
else, case, and a few other things.
(matlab-electric-comment):
Re-write to use new APIs from matlab-scan.el.
This enabled deletion of block comment stuff from matlab-syntax.el.
(matlab-comment-line-break-function):
Remove use of 'matlab-indent-line'.
(matlab-comment-indent): Delete (see change in matlab-mode)
tests/metest.el:
Stop using `matlab-block-comment-bounds'. Replace with new API call.
(matlab-syntax-commanddual-functions): Add cd and colormap.
(matlab--scan-line-for-command-dual): Make sure case-fold-search set
so we don't match cmd dual if user messes w/ capitalization.
(matlab--font-lock-syntactic-face): Add support for ignored comment face.
(matlab-cursor-comment-string-context): Improve help.
matlab.el:
(matlab-ignored-comment-face): New
tests/metest.el:
(metest-comment-string-syntax-test):
Add ignored comment support.
Add 'regular' code support (ie - not string or comment)
(met-kw-font-alist):
Add ignored comment support.
tests/fontlock.m:
Add tests for ignored comment face.
tests/stringtest.m:
Add ignored cmd dual cases.
Add ignored comment detection and tests.
(matlab-syntax-support-command-dual): Default to t
(matlab-syntax-commanddual-functions): List of functions
commonly used with command line dual.
(matlab--scan-line-for-command-dual): Use above lists
instead of anti-keyword detection.
tests/fontlock.m, tests/indents.m:
Add tests for command dual.
tests/stringtest.m:
Command dual test updated to use 'disp'
(matlab--font-lock-syntactic-face): Add pragma face support.
matlab.el:
(matlab-string-start-regexp): Delete (unused)
(matlab-font-lock-extend-region): Delete.
block comments now supported natively.
(matlab-pragma-face): New
(matlab-basic-font-lock-keywords):
Delete pragma face support
end & ref keyword regex tweak to use \\_>
(matlab-mode): Don't setup font-lock-extend-region
tests/metest.el:
(met-kw-font-alist):
Add some new face keys to test.
(met-fontlock-files): Add fontlock.m
(metest-fontlock-test): Tweak how multi-fonts on one spot test.
tests/fontlock.m:
New suite of tests.
tests/mclass.m:
Add some more font lock tests.
(matlab-end-of-string-or-comment, matlab-block-comment-bounds):
If the 'end of thing' ends up before the starting point,
throw an error about the syntax in the buffer being messed up.
(matlab-re-search-keyword-forward): If bad list found, jump to end of buffer.
matlab-syntax.el:
(matlab--scan-line-for-unterminated-string)
(matlab--scan-line-comment-disable-strings): Minor optimization
computing where to drop character category.
(matlab-end-of-outer-list): Error if going to end of list
leaves pt before starting location.
(matlab-re-search-keyword-forward): No longer error if inside an unterminated list.
Just fail to find the next keyword.
matlab-syntax.el:
(matlab-in-list-p): New
(matlab-beginning-of-outer-list, matlab-end-of-outer-list):
Change from let* to simplify.
(matlab--mk-keyword-node): Include end pt of found node.
(matlab--valid-keyword-node): New
matlab-syntax.el:
(matlab-move-simple-sexp-backward-internal)
(matlab-move-simple-sexp-internal):
Make defsubst.
matlab.el:
(matlab-show-paren-or-block):
Re-write how blocks like if ... end are highlighted to use new utils
in matlab-scan.el.
(matlab--scan-line-for-unterminated-string): When comment found,
disable all quote chars in the comment.
(matlab--scan-line-comment-disable-strings):
Find all syntax " chars and disable as whitespace.
tests/indents.m:
Add tests with ' in comments that impact indent.
Add support for block navigation.
(matlab-on-keyword-p): New
(matlab-kwt-indent, mtlab-kwt-blocks): New regex caches
(matlab-keyword-regex): Update interface to be simpler.
Support more caches for regex.
(matlab-compute-line-context-lvl-1):
Update to use new `matlab-on-keyword-p' feature.
(matlab--buffer-block-tree): New (but not yet used)
(matlab--mk-keyword-node, matlab--known-parent-block): New
(matlab--valid-keyword-point, matlab--valid-arguments-keyword-point): New
(matlab--scan-derive-block-state): New
(matlab--scan-block-forward, matlab--scan-block-forward-up): New
(matlab--scan-block-backward, matlab--scan-block-backward-up): New
(matlab--re-search-keyword-forward, -backward): Moved.
matlab-syntax.el:
(matlab-beginning-of-string-or-comment): Add all-comments optional input.
(matlab-end-of-string-or-comment): Add all-comments optional input.
(matlab-syntax-keyword-as-variable-p): New
(matlab-valid-keyword-syntax): New
(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
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.
(matlab-cursor-in-string-or-comment)
(matlab-cursor-in-comment matlab-cursor-in-string)
(matlab-beginning-of-string-or-comment):
Convert to a single line impl.
Convert to defsubst.
(matlab-end-of-string-or-comment)
(matlab-beginning-of-outer-list)
(matlab-end-of-outer-list): New
(matlab--scan-line-bad-blockcomment)
(matlab--scan-line-for-ellipsis):
Remove narrowing to region and use search bound instead.
This should be faster.
(matlab--font-lock-syntactic-face):
Quote in all the faces to avoid compiler warning.
(matlab-beginning-of-command): Remove searching for function/block to
restrict motion to. The search and restrict just slowed down ppss.
(matlab-end-of-command): Remove optional input.
Stop restriting array-cont query.
(matlab-semicolon-on-return, matlab-mode-vf-quiesce-buffer):
Don't pass input to `matlab-end-of-command'.
matlab-syntax.el:
(matlab-up-list): Use `matlab-beginning-of-string-or-comment'
instead of asking for the string or commment bounds.
The beginning is part of ppss, but full bounds includes the end.
(matlab-uniquify-list): Move to matlab-complete.el
matlab-syntax.el:
(matlb-beginning-of-string-or-comment): New nav function
matlab-complete.el:
(matlab-uniquify-list): Moved here from matlab.el
(matlab-find-block-comments): Delete
(matlab-file-basic-font-lock-keywords): Remove ref to above.
(matlab-up-string-or-comment, matlab-backward-up-string-or-comment):
Delete.
(matlab-lattr-block-close):
Replace use of matlab-backward-up-string-or-comment with
matlab-beginning-of-string-or-comment.
(matlab-up-list):
Replaced use of `up-list' when travelling backward.
Instead use `syntax-ppss' and the list of paren positions
to navigate upward while ignoring comments.
When travelling forward, use plain up-list with no
looping.