Commit graph

526 commits

Author SHA1 Message Date
Eric Ludlam
7e2b44d613 matlab-shell-gud.el:
Add support for data tooltips when debugging.
(matlab-shell-gud-startup): Add matlab-mode to list of gud tooltip supported modes.
(matlab-shell-gud-minor-mode): Add enable/disable of gud-toolti-mode,
and our special hook.
(gud-matlab-tooltip-tips): New.  Fcn for displaying a tooltip via the help of
gud-tooltip-mode, and tooltip-mode.
2019-11-28 23:31:00 -05:00
Eric Ludlam
843f05b112 matlab-shell-gud.el:
(matlab-shell-gud-minor-mode-map): Add 'p' to print.
(matlab-shell-gud-show-symbol-value): New.
2019-11-28 21:19:37 -05:00
Eric Ludlam
54dcd8a8e5 matlab-shell-gud.el:
Add fancy debugging mode for MATLAB buffers.
(matlab-shell-gud-startup): Add a debug tracker hook.
(gud-matlab-marker-regexp-k>>): Rename from borig -1
(gud-matlab-marker-regexp->>): New
(gud-matlab-marker-regexp-2): Delete
(gud-matlab-marker-filter): Use renamed or new vars from above.
(gud-matlab-debug-active): New
(gud-matlab-debug-activate-hook, *-deactivate-hook): New
(gud-matlab-debug-tracker): New fcn to activate and deactivate
our special debug features.
(matlab-shell-gud-minor-mode-map)
(matlab-shell-god-menu)
(matlab-shell-gud-minor-mode)
(global-matlab-shell-gud-minor-mode)
(matlab-shell-gud-mode-edit)
(matlab-shell-gud-mode-help-notice)
(matlab-shell-gud-mode-help): New minor mode that provides
direct access to gud comands w/out prefix keys.
2019-11-28 20:31:30 -05:00
Eric Ludlam
2f3f3fe9e5 matlab-shell.el:
(matlab-shell-second-prompt-fcn): Fix to remove the correct hook.
2019-11-28 20:26:35 -05:00
Eric Ludlam
bcae0c69e1 mstest.el:
(mstest-debugger-navto): When looking @text after nav command,
be more flexible about whitespace.
2019-11-28 20:25:53 -05:00
Eric Ludlam
4184aec9f4 matlab-shell.el:
Factor out matlab-shell-gud.el -> gud support is seperate.
Move stuff around so things make a little more sense.
(matlab-shell-enable-gud-flag): Remove. Always enable.
(matlab-shell-mode, matlab-shell): Move content between these
two functions.  Keep settings and keybindings in the mode,
move filters and such in matlab-shell.
Delete gud content, call to matlab-shell-gud-* fcns instead.
Stop asking to use gud, just do it.
(matlab-shell-wrapper-filter): Adopt the garbage filter from
the gud filter.
Always call gud-filter.
(matlab-shell-wrapper-sentinel): Always call gud-sentinel.
Make sure buffer is set correctly.
(gud-matlab-*): Move to matlab-shell-gud.el
2019-11-28 18:19:10 -05:00
Eric Ludlam
7ff56a8246 matlab-shell-gud.el:
New, content copied from matlab-shell, includes
all the GUD specific support, including the process filter.

Makefile, Project.ede:
Include matlab-shell-gud.el
2019-11-28 18:14:25 -05:00
Eric Ludlam
c29f20a97b metest.el, metest.el:
Require matlab-load to get all the auto-loads in.
2019-11-28 18:13:25 -05:00
Eric Ludlam
ca9701adf9 matlab-cgen.el matlab-complete.el matlab-netshell.el
matlab-shell.el matlab-topic.el srecode-matlab.el:
Fix email @ top of files to be real.
2019-11-28 15:56:59 -05:00
Eric Ludlam
2bcf58eb31 matlab.el, matlab-compat.el, matlab-complete.el, matlab-shell.el:
Fix matlab-shell-locate-fcn and fix spelling errors.

matlab-shell.el:
(matlab-shell-mode-map): Change C-c. keybinding to do matlab-shell-locate-fcn.
(matlab-shell-locate-fcn): New.

(matlab-find-file-under-path, matlab-find-file-on-path):
Deleted.

matlab.el:
(matlab-mode-map): Change binding of C-c. to do matlab-shell-locate-fcn
(matlab-frame-init): Change menu binding as with keybinding above.
2019-11-28 11:06:04 -05:00
Eric Ludlam
f9f7e62367 matlab-shell.el:
(matlab-shell-run-region-internal): Reduce end by 1 char to match
how MATLAB does indexing of regions.
Check for DOS encoded files.  If it is, add charts to start & end to match
the number of CRs.  (DOS files have CRLF endings, not just LF endings.)
2019-11-28 10:41:17 -05:00
Eric Ludlam
c597c705eb matlab-shell.el:
(matlab-shell-which-fcn): Use disp to show output of which
so we avoid helpful comments in command use of which.
2019-11-27 16:35:17 -05:00
Eric Ludlam
13e7709a96 tests/mstest.el:
Add additional debugger tests.
((mstest-run-all-tests): Enable additional debug output
if environment says so.
(mstest-error-parse): The buggy cmderr line no check is -1
so we work with diff versions of MATLAB src.
(mstest-error-command-check): If input line is negative,
don't check the line number.  (It may move.)
(mstest-debugger): Add additional debugger test points.
Test dbclear.
Test functions gud-break & gud-next, & gud-cont.
(mstest-debugger-navto):
New helper.  Test gud functions like next and continue.
Support emacs commands as debugger commands.
(mstest-cap-context): New, for debugging tests.
(mstest-debugger): Add additional test debugging features.
Add support for elisp fcns that are commands.
Make sure current buffere is the *MATLAB* buffer in more cases.
Verify what is at START location when caping output to decide if we
need to skip over echoed output or not.
2019-11-27 16:20:51 -05:00
Uwe Brauer
7937c018e3 Actualize the NEWS file
* NEWS.org (News in 4.0): 290 Merge, documentation concerning new
features, provided by John Ciolfi <ciolfi@mathworks.com>, thanks John.

--HG--
branch : documentation
2019-11-27 22:01:15 +01:00
Uwe Brauer
3e6ea77e6a Merge modernize into documentation
--HG--
branch : documentation
2019-11-27 21:51:08 +01:00
Eric Ludlam
cd69c0f07c tests/dbtester.el
Add more stuff to debug.
2019-11-27 14:33:49 -05:00
Eric Ludlam
794b6439b5 matlab-shell.el:
Add support for debugging & the test harness.
(matlab-shell-io-testing): New.
(gud-matlab-marker-filter): When sending dbhotlink
command, force an echo if the subprocess isn't echoeing.
Print IO state if io testing is on.
(matlab-on-empty-prompt-p): Force to shell buffer before test.
(matlab-on-debug-prompt-p): New (used in tests.)
(matlab-shell-send-string): message io if iotesting is on.
2019-11-27 14:33:24 -05:00
Eric Ludlam
7ae6b90f11 Makefile, Project.ede:
Add matlab-maint.el
2019-11-27 14:30:31 -05:00
Eric Ludlam
01e99648c2 matlab-maint.el:
Minor mode for maintainers of matlab-emacs.
2019-11-27 14:30:14 -05:00
Eric Ludlam
eda8603130 tests/mstest.el:
Add debugger tests.
(mstest-run-all-tests): Add mstest-debugger.
(mstest-error-parse): Fix comments, simplify some testing output.
(mstest-debugger): New test fcn for debugger commands and state.
(mstest-debugger-breakpoint): New util for testing state of various
breakpoint setting functions.

tests/dbtester.m
New file with interesting places to debug.
2019-11-26 16:09:48 -05:00
Eric Ludlam
7a16edc405 matlab-shell.el:
(matlab-shell-class-mref-to-file): First split input on >
to strip off local functions, then continue as before.
(matlab-shell-mref-to-filename): Operate only in the MATLAB shell buffer.
Convenience for debugging.

tests/mstest.el:
Add point for testme(true) - error in local fcn.
Fix some line numbers.

tests/+eltest/+utils/testme.m:
Add error in local fcn option.
2019-11-26 14:55:19 -05:00
Eric Ludlam
391f075113 matlab-shell.el:
(gud-matlab-marker-filter): Clean out some old cruft supporting antique MATLABs.
Streamline finding our debug pattern, and setting the frame.
2019-11-26 12:50:01 -05:00
Eric Ludlam
03b2213809 matlab-shell.el:
(matlab-shell-error-face): Face used to colorize errors in MATLAB shell.
(matlab-shell-mode): Add prompt hook to colorize errors.
(matlab-shell-errortext-start-text, matlab-shell-errortext-end-text): New.
(matlab-shell-colorize-errors): New.
Scans for errortext start/end tokens, and drops an overlay on them.
(gud-matlab-marker-filter): Scan for {^H and }^H tokens, and convert
to errotext tokens.  Comint finds these and erases them, but they
really indicate text distinct from other output text.
2019-11-26 11:47:05 -05:00
Eric Ludlam
68a56a486e matlab-shell.el:
(matlab-shell-wrapper-filter): Make sure we are in the *MATLAB* buffer
when checking and running prompt hooks.
(matlab-shell-run-region): Change how display-buffer is called
to better re-use frames and windows if they are showing.
2019-11-26 10:49:29 -05:00
Eric Ludlam
caaa6599f5 toolbox/emacsrunregion.m:
When extracting the text, don't overrun the array if the caller got it wrong.
2019-11-26 08:41:06 -05:00
Eric Ludlam
b24f77d9d5 toolbox/opentoline.m:
Use `which' internally to find the FILE reference and turn it into
something an external editor can find.
2019-11-26 08:36:04 -05:00
Eric Ludlam
48b43d2f5c toolbox/emacsrunregion.m
Cleanup cruft from various experiments.
Use onCleanup to restore old default directory.
Use evalin to run the region in base workspace.
2019-11-26 08:33:44 -05:00
Uwe Brauer
42d29c06d7 Merged commits from the modernize into the documentation branch.
--HG--
branch : documentation
2019-11-26 09:30:56 +01:00
Eric Ludlam
5c1d04df2a tests/Makefile:
Add -q flag for Emacs calls.
2019-11-25 23:34:43 -05:00
Eric Ludlam
6d6e390473 tests/mstest.el:
Improve output and debugging on failures.
Add syntax error test.
(matlab-run-all-tests): If interactive, turn on debugging features.
(mtest-start): Add timeouts to accept-process-output.
Add BEEP test, mostly to turn off beeping with the errors.
(mstest-error-parse): Add syntaxerr call to test this error type.
2019-11-25 23:34:17 -05:00
Eric Ludlam
023f653c4a matlab-shell.el:
Update how filters are setup and run, and move where prompt-appears-hook is created.
Setup several new prompt-appears hook fcns for initializing the process instead of comint filter fcns.
Improve how errors are scanned.
(matlab-shell-errorscanning-syntx-table): New syntax table where \n is whitespace.
(matlab-shell-prompt-hook-cookie): New, used to pass prompt appear status.
(matlab-shell-suppress-prompt-hooks): New
(matlab-shell-cco-testing): New
(matlab-shell-mode): Move our comint hooks to be local.
Add new prompt-appear-hook to a first-prompt-fcn, and also for render-errors-as-anchor.
(matlab-shell): Remove GUD process filter and sentinel.
Add our own matlab-shell-wrapper-* filter and sentinel.
(matlab-shell-wrpper-filter): New.
Calls out to GUD, and calls matlab-shell-prompt-appears-hook when
matlab-shell-prompt-hook-cookie is true.
(matlab-shell-wrapper-sentinel): New.
(matlab-shell-render-html-anchor):
Use matlab-shell-errorscanning-syntax-table.
(matlab-shell-error-anchor-expression, matlab-shell-error-location-expression):
Update spaces to be \s- to overcome newlines.
(matlab-shell-scan-for-error): Use errorscanning syntax table.
(matlab-shell-render-errors-as-anchor): Minor comment/doc cleanup.
Put full file in help-echo.
(matlab-shell-first-prompt-fcn, matlab-shell-user-startup-fcn): NEW
Contents was from `gud-matlab-marker-filter'.  Setup matlab for first
time by running emacsinit, and user's init code.
(matlab-shell-second-prompt-fcn): New.  Set's prompt-seen.
(gud-matlab-marker-filter): Remove emacsinit setup for MATLAB, and other content
that moved to matlab-shell-first-prompt-fcn.
Turn off beeps.
Stop running matlab-shell-prompt-appears-hook, and instead just set the cookie.
(matlab-shell-collect-command-output): suppress prompt hooks.
Enable timeouts if we wait too long.
(matlab-shell-mref-which-fcn): Disable when cco testing.
(matlab-find-other-window-file-line-column): Stop using goto-line (as per doc)
and use forward line isntead.  Cleans up spurious 'set mark' text during test.
2019-11-25 23:31:59 -05:00
Uwe Brauer
8f8d1a5921 Start to add documentation concerning the new features in 4
* NEWS.org (Changes and New Features in matlab-emacs): New file,
add News for 4.0

--HG--
branch : documentation
2019-11-25 18:28:23 +01:00
Eric Ludlam
a392653963 tests/mstest.el:
(mtest-error-command-check): Add second block that CDs up
so error file refs are no longer on the path.  Then re-check
that we get to the right place with last error.
2019-11-25 09:32:49 -05:00
Eric Ludlam
aed29240f9 tests/mstest.el:
Add more tests needed for error parsing.
(mstest-run-all-tests): Leave in debug flag commented out.
(mstest-start): Add tests for valid MATLABROOT,
and 'which' utility test.
(mstest-error-parse): Build utility around first test. (see below)
Use utility for 3 buggy.m tests, package fcn error test,
and class method error tests.
(mstest-error-command-check): New, copied from above.
Plus minor improvements to messages.
2019-11-24 23:24:16 -05:00
Eric Ludlam
1bf1229a46 matlab-shell.el:
Enable testing harness, and MATLAB running under a pipe insted of pty.
(matlab-shell-render-errors-as-anchor): Make sure that the
full file (from the mref expander) succeeds before using it.
(matlab-shell-matlabroot-run): New variable.
(matlab-shell-matlabroot): Use cache
(matlab-shell-collect-command-output): Enable when using pipe
instead of pty.  In this case the process doesn't echo, so
we compute bounds of result differently.
Use computations instead of movement to id bounds of captured output.
(matlab-shell-mref-which-fcn): Wrapper around `matlab-shell-mref-which-fcn'
to prevent errors.  (ie - allow it to just return nil).
(matlab-shell-mref-converters): Use above.
2019-11-24 23:20:42 -05:00
Eric Ludlam
21039bea58 matlab-shell.el:
(matlab-shell-which-fcn): Force point to end-of-buffer
before testing the prompt and running commands.
2019-11-24 20:36:15 -05:00
Eric Ludlam
99e3838302 Makefile:
New file, replace bash scripts for running tests.
2019-11-24 20:31:40 -05:00
Eric Ludlam
d1e9748db6 tests/mstest.el:
New set of tests to exercise matlab-shell.
Several starter tests included for startup, completion, and parsing errors.
2019-11-24 20:31:12 -05:00
Eric Ludlam
ebd7ba8637 toolbox/emacsinit.m:
Turn off 'wraplines' option.
2019-11-24 20:30:14 -05:00
Eric Ludlam
a99727d462 toolbox/emacsnetshell.m:
Don't send 'init' twice if user calls this the first time with 'init'
as an input.
2019-11-24 20:29:49 -05:00
Eric Ludlam
aca50341e0 tests/buggy.m:
Add more types of bugs, including a stack of bugs.
2019-11-24 20:28:47 -05:00
Eric Ludlam
39e2480009 matlab-shell.el:
Minor improvements that enable testing.
(matlab-shell-send-command): Make sure to run in the matlab-shell
buffer.
2019-11-24 20:28:08 -05:00
Eric Ludlam
e703abcdcb matlab-shell.el:
Make finding errors more robust.
(matlab-shell-render-errors-as-anchor):
Compute actual full file here, and store on the URL instead of using
the matlab reference name.
2019-11-24 15:54:34 -05:00
Eric Ludlam
9b04e0b359 matlab-shell.el:
Improve behavior of return key in this preceeding history text of the shell.
(matlab-shell-mode):
Set comint-get-old-input to below.
(matlab-comint-get-old-input): New.
Only return text to evauate if it was on a prompt before.
2019-11-23 22:04:04 -05:00
Eric Ludlam
c200c243b4 matlab-shell.el:
(matlab-find-other-window-file-line-column):
If input file fails to translate into a file name, issue a descriptive
error instead of passing nil to find-file-other-window.
2019-11-23 21:10:40 -05:00
Eric Ludlam
260d811f03 matlab-shell.el:
Improve error highlighting.
(matlab-shell-render-errors-as-anchor): Fix scanning for the first error
in a session.
(matlab-shell-class-mref-to-file): Add fcn-p flag.
When t, convert to a function name in a package.
(matlab-shell-mref-converters): Add expression to
match functions in a package.

tests/+eltest/+utils/testme.m:
New function in a package that throws an error.
2019-11-23 20:23:32 -05:00
Eric Ludlam
3bda113d33 matlab-topic.el:
Fix to work w/ newer versions of Emacs.
(matlab-shell-help-mode): Add mouse-1 keybinding for clicking on things.
(mtlab-shell-topic-browser-create-contents): Replace toggling
read-only-mode with `inhibit-read-only' feature.
Add bit @ end to force font-lock to activate for this buffer.
In E27 it seems to not colorize.
(matlab-shell-topic-choose): Don't error if not clicking on a topic now
that mouse-1 also clicks in addition to moving point.
(matlab-shell-topic-mouse-highlight-subtopics):
Use `inhibit-read-only' when adding text properties.
2019-11-23 20:03:01 -05:00
Eric Ludlam
df1d0adf53 emacsrunregion.m:
Fix comments.
2019-11-23 17:40:16 -05:00
Eric Ludlam
76a5415dee matlab-shell.el:
Turn off netshell integration by default until it is more stable.
2019-11-23 17:34:25 -05:00
Eric Ludlam
9749479662 toolbox/Makefile, toolboxProject.ede:
Account for new files in this directory.
2019-11-23 17:25:51 -05:00