Commit graph

391 commits

Author SHA1 Message Date
Eric Ludlam fb19726ed5 matlab.el:
(matlab-mode-vf-functionname)
(matlab-mode-vf-classname):
When asking, specify function of class
name will be fixed.
2019-11-18 08:56:56 -05:00
Eric Ludlam 059b520930 semantic-matlab.el:
(semantic-matlab-dependency-system-include-path):
Fix logic computing the include path to use root dir, but not
put things on the path that don't exist.
semanticdb-matlab.el:
require matlab-shell.
(semanticdb-matlab-cache-files):
Stop using old style classes fcn.
2019-11-17 16:34:17 -05:00
Eric Ludlam cb10deea2c matlab-shell.el:
Autoload cookie for `matlab-mode-determine-matlabroot'.
mlint.el:
More robust finding of mlint program.
(mlint-reset-program): If other tricks fail,
use matlabroot and find mlint that way.
2019-11-17 16:19:42 -05:00
Eric Ludlam 59f7a234ce tests/buggy.m
tests/syntaxerr.m
tests/errexamples.shell.m:
New files with errors in them for testing MATLAB error parsing.
2019-11-17 16:04:52 -05:00
Eric Ludlam a1dd9078f2 matlab-shell.el
Fix error and warning scraping and jumping.
Delete some obsolete text formatters.
(matlab-shell-mode): Re-enable comint filter function
`matlab-shell-render-errors-as-anchor'.
(matlab-txt-format-beg, matlab-txt-format-end): Delete.
(matlab-shell-render-html-txt-format): Delete
(gud-matlab-error-regexp): Deleted.  Expressions are now in the below:
(matlab-shell-error-anchor-expression): New
(matlab-shell-error-location-expression): New
(matlab-shell-scan-for-error): New, uses above to find
errors, and return file and line number info.
(matlab-shell-render-errors-as-anchor): Use above.
Make input optional to simplify testing.
(matlab-shell-which-fcn): Fix preceeding comments.
This is now used by below.
(matlab-shell-mref-converters): New
(matlab-shell-mref-to-filename): New, use above.
Converts a file name (as scraped from MATLAB output)
into a file name emacs can use.
Will now ask MATLAB to get a file name if it can't figure it
out on it's own.
(matlab-find-other-window-file-line-column): Use above
instead of ad-hoc soln.
(matlab-shell-last-error): Use new `matlab-shell-scan-for-error'.
2019-11-17 16:01:07 -05:00
Eric Ludlam e8560db539 matlab-shell.el:
Revamp basic completion in the shell.
(company-mode,company-idle-delay): Quiet compiler.
(matlab-shell-mode-map): Remove random checks about `company-mode'.
Always provide the same bindings and control how to complete elsewhere.
Add comments and group keybindings.
Remove extras - only provide one complete.
(matlab-shell-tab): Convert to a switchyard.
Use `cond' to break up function into clear sections for each type of
completion we can do.
(matlab-shell-do-completion-light): New.
Uses `completion-in-region' to do all the work.
(matlab-shell-do-completion) New, all code that used to be in
`matlab-shell-tab'.  To be used by older versions of Emacs.
2019-11-17 10:30:43 -05:00
Eric Ludlam 4e5639658b matlab-compat.el:
(matlab-display-completion-list): New,
copied form matlab-shell.el.
2019-11-17 08:41:33 -05:00
Eric Ludlam 5c67bdb31b matlab-shell.el:
Trim out old XEmacs logo thing.
Cleanup some completion stuff.
(matlab-shell-logo): Delete.
(matlab-shell-mode): Don't setup xemacs logo hack.
(matlab-shell-hack-logo): Delete

(matlab-shell-ask-MATLAB-for-completions): Move.
(matlab-shell-tab-company-available): Compute
default value inline.
(matlab-shell): Set companyidle delay to nil
to prevent random popups from appearing as you type.
(matlab-shell-window-exists-for-display-completion-flag): Delete.
(matlab-shell-get-completion-info): Update the doc
to conform to standards.
(matlab-display-completion-list): Moved to matlab-compat.el
(matlab-shell-tab): Cleanup old window display code to
use `display-buffer' instead.
(matlab-tab-hide-completions): Replace complexity with
`quit-buffer'.
2019-11-17 08:41:02 -05:00
Eric Ludlam 0edda7ad1f matlab-compat.el:
(matlab-set-keymap-parent): New shim fcn.
(matlab-find-executible-directory): New fcn.
matlab-shell.el:
Use matlab-compat.el.
Always require comint, as this file won't load unless someone
is trying to create a shell.
(matlab-shell-font-lock-keywords): Refresh
to highlight startup text again.
(matlab-mode-determine-matlabroot): New.
(matlab-mode-install-path): Use above.
(matlab-mode-determine-mfile-path): Delete.
(matlab-shell-mode-map): Create during declaration,
including the menus.
(matlab-shell-mode): Don't make menu (see above)
(matlab-shell): Don't make keymap (see above)
semantic-matlab.el:
(semantic-matlab-root-directory): delete
(semantic-matlab-root-directory): Use
matlab-mode-determine-matlabroot instead of above.
2019-11-16 15:59:56 -05:00
Eric Ludlam 097842df83 Makefile, Project.ede:
Add matlab-compat.el.
2019-11-16 15:52:57 -05:00
Eric Ludlam ef57387366 matlab-compat.el:
New file, has all the compatibility shims from matlab.el.
matlab.el:
Remove compatibility shims, add to matlab-compat.el.
(matlab-functions-have-end-minor-mode): Get rid of wierd
fontified string and misc infrastructure.  It's not being shown anyway.
2019-11-16 14:50:08 -05:00
Eric Ludlam c832121648 matlab.el:
(matlab-mode-vf-block-matches-forward):
If in ADDEND mode, then only ask to add an end if needed.
If user says no, then set this buffer to not needing
function ends, and exit.
2019-11-16 12:22:26 -05:00
Eric Ludlam 1e6ef84e7c Merge branch 'modernize' of ssh://git.code.sf.net/p/matlab-emacs/src into modernize 2019-11-16 09:29:29 -05:00
Eric Ludlam 4482a04241 matlab.el:
(matlab-font-lock-extend-region):
If we extend, extend for whole lines.
(matlab-find-block-comments):
On fail or success, explicitly move to end
of what we have found so far.
(matlab-ltype-block-comm): Reject block
comment starts in strings or other comments.
Track if we found a comment successfully
during search loops, and don't continue if that
failed, but we had a success on an earlier loop that
was in a string or comment.
Support new input to extend to line bounds.
2019-11-16 09:28:41 -05:00
Eric Ludlam 4ed7821a04 matlab.el:
(matlab-mode-vf-add-end-to-this-block):
when adding end to end of buffer, be sure
to add CR @ beginning in case of no CR at end of last line
of code.
2019-11-15 18:20:06 -05:00
Eric Ludlam a2d6f97b68 matlab-topic.el:
Add autoload cookie
2019-11-15 12:56:54 -05:00
Eric Ludlam 55f8b11132 matlab-shell.el:
(matlab-shell-region-command):
If the region we are going to run is only 1 line long, use the old
mechanism of just pasting the line onto the commandline.
2019-11-14 21:33:41 -05:00
Eric Ludlam d06598d24d matlab.el:
(matlab-mode-map): Add ctrl-ret to be matlab-shell-run-region-or-line.
2019-11-14 21:32:35 -05:00
Eric Ludlam 5f7dc852cf toolbox/emacsinit.m:
Now that we simulate hotlink generation, we no longer need
the complex version check and related code.  Just turn off
graphical debugging by default.
2019-11-14 21:31:46 -05:00
Eric Ludlam 339b9673cf Add .#* matcher to ignore some new tmp file. 2019-11-14 19:58:46 -05:00
Eric Ludlam 1db3f203be mlint.el:
Fix to work w/ newer eieio.
(initialize-instance, initialize-instance):
Use oref-default to get class values.
(mlint-clear-cross-function-variable-highlighting):
Use font-lock-flush to fix compiler warnings.
2019-11-14 19:58:06 -05:00
Eric Ludlam 8fd24cc16a matlab-shell.el:
Fix compiler warning around company-mode.
(matlab-shell): If company is requested and available, turn it on.
2019-11-14 19:56:06 -05:00
Eric Ludlam 5ce3ad95db Merge branch 'modernize' of ssh://git.code.sf.net/p/matlab-emacs/src into modernize 2019-11-13 22:20:22 -05:00
Eric Ludlam 36c17d9e57 matlab-semantic.el:
New fcns needed by matlab-shell.el
(matlab-semantic-get-local-functions-for-script):
New.  Returns fcns from a buffer.  Works if semantic isn't enabled.
(matlab-semantic-tag-text): get text part of input TAG.
(semantic-default-matlab-setup): Add 'type tag class to list
of misc things, since we support them now.
matlab-shell.el:
(matlab-shell-extract-region-to-tmp-file): Use new fcns above.
Fix compiler warnings.
2019-11-13 22:15:08 -05:00
Eric Ludlam 78c412586b matlab-shell.el:
(matlab-shell-extract-region-to-tmp-file):
Fetch tags before doing the search for functions tags.
Give emacs a chance to flush MATLAB's output queue
before setting up prompt hook.
2019-11-13 20:28:13 -05:00
Eric Ludlam 94748c221c semantic-matlab.el:
(semantic-matlab-parse-oldstyle-class)
(semantic-matlab-find-oldstyle-classes): Comment out.
Need to delete later.
(semantic-matlab-parse-region): Stop using above.
2019-11-13 09:15:00 -05:00
Eric Ludlam 1ff16e4ade Support running a cell from script w/ local functions.
matlab-shell.el:
(gud-matlab-marker-regexp-plain-prompt): New regexp.
(matlab-shell-prompt-appears-hook): New hook (used below)
(gud-matlab-marker-filter): When returning output, if a prompt is
included, call the matlab-shell-prompt-appears-hook.
(matlab-shell-run-cell, matlab-shell-run-region-or-line): Move
(matlab-shell-run-region): Extract inline code to find 'command' to new fcn.
(matlab-shell-region-command): Function to extract code to run as cmd.
(matlab-shell-region->commandline): Copy from run-region as new fcn.
Fix up to better clean up blank lines, and excessive whitespace.
(matlab-shell-extract-region-to-tmp-file): NEW.
This is like region->commandline but puts content into a speicially named
m file.  If any functions are needed from the script, pull those along.
(matlab-shell-cleanup-extracted-region): Delete files created by above.
Called from the new hook.
2019-11-12 23:14:52 -05:00
Eric Ludlam 1734085cbc Fix bug in semantic-matlab-parse-functions - it needs to take limit input. 2019-11-12 23:09:28 -05:00
Eric Ludlam af8e183cdf Remove all code gen / insertion stuff into matlab-cgen.el.
Move tempo tags var into matlab-cgen, along with all related keymaps.
In matlab-cgen, define the keymap as autoload so things load and
run seamlessly.
On cgen load, run hook on all matlab buffers.
2019-11-10 08:43:26 -05:00
Eric Ludlam 3fe52b0915 Makefile, */Makefile: Update version numbers.
toolbox/Makefile, toolbox/Project.ede: Add dbhotlink.m.
matlab.el: Clean up compiler warnings.
2019-11-09 22:07:52 -05:00
Eric Ludlam c29e72a9f4 matlab-shell.el: Fix debugging in matlab-shell.
(matlab-shell-mode): Remove calls to dbhotlink from all gud-* commands.
(gud-matlab-dbhotlink): New state variable for when we are waiting
for output from hotlink command.
(gud-matlab-marker-filter): Stop checking for frames so much.
If no frame was found, and if we haven't asked for a frame, then
ask ML to run dbhotlink (from our local toolbox.)
If we are waiting for a hotlink, then search output for the
hotlink command, and strip it out of the process output.
Where we try to hold back output, restrict it to new state variable.
Where we always dump our output, restrict to prompts only.
(matlab-shell-tab): Don't use company mode if not active.

Fix misc compiler warnings.

dbhotlink.m:
If no input, determine current stack position and show that.
Also don't print stack # if in auto mode.
2019-11-09 22:05:50 -05:00
Eric Ludlam 21402281fd matlab.el: Improve block comment handling.
(matlab-font-lock-extend-region): is now added to font-lok-extend-region-functions
and handles block comment bounds.
(matlab-ltype-block-comm): now returns the bounds of the block comment
the cursor is in.  (It had to find them anyway, so now it returns them.)
(matlab-show-paren-or-block): Now does nothing if in a block comment.
(matlab-mode-vf-block-matches-forward): Also ignores hits in block comments.
tests/mpclass.m: Minor tweaks from testing.
2019-11-09 19:23:02 -05:00
Eric Ludlam 58fa0d27fe Automatically add ends to functions:
Add `matlab-mode-vf-add-ends' to `matlab-mode-verify-fux-functions'.
New fix function calls `matlab-mode-vf-block-matches-forward' with ADDEND input.
When an unterminated block appears, if functions have ends, offer to
add an END at a reasonable spot.

Remove "Highlight matching blocks" menu customizations as it isn't used anymore
due to parens mode support.
2019-11-09 14:02:18 -05:00
Eric Ludlam 1a6a3f6a42 Update font-lock keywords for functions so that
scanning for inputs works across multiple lines.
Add fontlock.m test file.
2019-11-09 12:01:34 -05:00
Eric Ludlam bfbd689d2f Fix previosu fix to `matlab-indent-line' to take into account
the starting indentation when deciding if to move the cursor after
indentation has been done.
2019-11-09 11:10:28 -05:00
Eric Ludlam 5754f52919 Fix matlab-comment' to have features of comment-dwim' when
the region is active.
Fix `matlab-indent-line' to better preserve cursor location in text.  This
has the side-effect of making matlab-comment place the cursor in a better spot
when inserting a new trailing comment.
2019-11-09 10:59:41 -05:00
Eric Ludlam 18a2314b2f semantic-matlab.el:
Add support for parsing superclasses and storing in tag.
Add a test for that.
2019-11-09 10:24:43 -05:00
Eric Ludlam abaadab8a7 semantic-matlab.el:
Add support for method attributes (protection).
Add test.
2019-11-09 10:16:18 -05:00
Eric Ludlam bc26e2f978 semantic-matlab.el:
Class parsing - add support for property blocks and creating tags
for the properties, including analysis of 'access' attribute.
Add tests for this.
2019-11-09 08:57:23 -05:00
Eric Ludlam 64f2249b1e Add support for parsing MATLAB Classes to semantic-matlab.el
Add test file (mplass.m) and add parsing testing to metest.el.
2019-11-08 23:34:40 -05:00
Eric Ludlam 9eaf9e7752 Overview:
Move large chunks of matlab.el to matlab-complete.el,
matlab-shell.el, and matlab-topic.el.
Update existing .el files to require new files as needed.
Update Makefiles to no longer have Makefile check.

matlab.el: Settings updates:
(matlab-mode-version): Update to 4.0 (based on expectations of this change.)
(matlab-functions-have-end): set to t.  Fix doc.
(matlab-functions-have-end-p): If guess, then guess, otherwise
base it on matlab-functions-have-end.
(matlab-fill-code): set to nil.
(matlab-keyword-list, matlab-block-end-pre-if): remove endfunction
(matlab-calculate-indentation): remove matlab-ltype-endfunction-comm.

matlab.el: code moving
(matlab-frame-init): moved earlier near keymaps.
2019-11-08 20:49:50 -05:00
Uwe Brauer e8d02b83ee Merge string into master 2019-10-10 09:53:17 +03:00
Eric Ludlam 4e57525557 Fix a suite of compiler warnings:
matlab-arg1-max-indent-length, matlab-elipsis-string, matlab-fill-count-ellipsis-flag,
matlab-shell-history-file - add defcustom opts.
Remove matlab-ispell-comments
Rename matlab-ispell-strings to be matlab-ispell-strings-and-comments.
2019-10-09 21:16:06 -04:00
Eric Ludlam f9ed0ef055 In matlab-show-paren-or-block - fix usage of condition-case. 2019-10-09 21:04:55 -04:00
Uwe Brauer 87c49fdbde Merge remote-tracking branch 'origin/strings' 2019-10-09 16:29:37 +03:00
Eric Ludlam f0781d1f2c Fix spurious character inseted. 2019-10-06 21:41:11 -04:00
Eric Ludlam b3c06728ef In matlab-mode, setup `forward-sexp-function' so any random tools using it (like blink-paren-mode) will
get the benefits of our fancy matlab specific sexp navigation.
2019-10-06 21:40:06 -04:00
Eric Ludlam a58df74bf1 metest.el - add metest-indents-test and support functions.
Tweak how all the test status msgs are printed to be better seperated.
Add indentation tokens to mclass.
Add new indents.m
2019-10-03 21:15:41 -04:00
Eric Ludlam 43568c6b89 matlab-backward-up-string-or-comment - Fix paren missmatch, return t always when ctxt is non-nil.
matlab-show-paren-or-block - Do all searches with matlab-navigation-syntax.
2019-10-03 21:13:54 -04:00
Eric Ludlam d4fb714506 More updates to changelog. 2019-10-02 23:03:45 -04:00