Commit graph

391 commits

Author SHA1 Message Date
Eric Ludlam 83accf0601 toolbox/emacscd.m
Example of how to make a MATLAB command that tells Emacs something useful.
2019-12-01 20:12:21 -05:00
Eric Ludlam d16934c6a0 matlab-shell.el:
Allow MATLAB to tell Emacs what to do.
(matlab-shell-capture-text): After capture, if buffername has special value 'eval'
then read the forms, and evaluate them instead of pushing into a buffer.
2019-12-01 20:11:52 -05:00
Eric Ludlam ecaa583b8f matlab-topic.el:
Fix bugs calling matlab-shell-help-mode twice in the same buffer.
(view): Require this.
(matlab-shell-help-mode-map): Set parent keymap for this one.
(matlab-shell-help-mode-syntax-table): New
(matlab-shell-help-mode): Set our empty syntax table.
2019-12-01 18:32:59 -05:00
Eric Ludlam 2741389eaf matlab.el:
Fix bugs with block comments.
(matlab-font-lock-extend-region): After choosing new beg/end,
check if we changed anything.  If not, return nil.
(matlab-find-block-comments): Fix bug if block comment starts @ beg of line.
If end wasn't found, return region that goes to point-max to show
how user needs to add an end.
(matlab-debug-block-comm): Debugging tool.
2019-12-01 14:48:57 -05:00
Eric Ludlam cb744da33e matlab-shell-gud.el:
(matlab-shell-gud-minor-mode): Make buffers in this mode read only.
Restore read only state by asking file if it is writable.
Do not change read only state for buffers w/out files.
2019-11-30 20:41:13 -05:00
Eric Ludlam e83947829f matlab-shell-gud.el;
(matlab-shell-debug-tooltips-p): New config variable.
(define-minor-mode): Only enable tooltips if new flag
is non-nil.
2019-11-30 20:15:45 -05:00
Eric Ludlam 1ced00ab39 toolbox/help.m:
Change strategy for calling ML version of help to remove emacs
shadow directory from the path.
2019-11-30 20:04:03 -05:00
Eric Ludlam 39914dba77 matlab-topic.el:
(matlab-shell-help-mode-map, matlab-shell-help-mode-menu):
Move these around to be more like other modes.
2019-11-30 20:02:53 -05:00
Eric Ludlam 5eca9d83a0 matlab-shell.el:
(matlab-shell-version-scrape): Support 18b version numbers too.
2019-11-29 22:24:36 -05:00
Eric Ludlam ab7a262f47 tests/mtest.el:
(mstest-run-all-tests): Also turn on debugging w/ TESTDEBUG environment.
2019-11-29 15:50:28 -05:00
Eric Ludlam 8c4edbb52a matlab.el:
(matlab-help-map, matlab-frame-init):
Remove references to topic browsers.

matlab-shell.el:
(easy-menu-define, matlab-shell-mode):
Remove references to topic browsers.
(matlab-shell): Add capture text to prompt-appears hook.
(matlab-shell-capturetext-*-text): New regexp
(matlab-shell-capture-text): New filter fcn that captures
anything between start/end and shows in a buffer.
(matlab-shell-describe-command): Add -emacs flag when calling help.

matlab-topic.el:
Remove topic browsing mode.
(matlab-shell-topic-mode-hook, matlab-shell-topic-current-topic)
(matlab-shell-topic-browser, matlab-shell-topic-mode-menu)
(matlab-shell-topic-mode, matlab-shell-topic-mode-menu)
(matlab-shell-topic-browser-create-contents):
Delete
(matlab-shell-topic-click -> matlab-shell-help-click): rename
(matlab-shell-topic-choose -> matlab-shell-help-choose): rename
(matlab-shell-topic-mouse-highlight-subtopics ->
 matlab-shell-help-mouse-highlight-subtopics): Rename
 (matlab-shell-help-choose): downcase found text, always
 use *-describe-command.

toolbox/help.m:
New function to shadow system help.
Wrap output of system help in capture text cookies.
2019-11-29 15:49:38 -05:00
Eric Ludlam 9ec7dd33cb matlab-maint.el:
Add support for toggling io logging.
2019-11-29 15:42:03 -05:00
Eric Ludlam 786ff47e8b tests/mstest.el:
(mstest-start): Add check that matlab-shell-running-matlab-version was
successfully set during startup.
2019-11-29 11:49:30 -05:00
Eric Ludlam 5eadc5155a matlab-shell.el:
(matlab-shell-version-scrape): Add 2nd attempt to find versions.
Leave old regex there for older MATLABS.
Print something when we succeed.
2019-11-29 11:48:52 -05:00
Eric Ludlam 65444dfa8a matlab-shell-gud.el:
(matlab-gud-fcn): New macro for controlling when gud commands are active.
(matlab-shell-mode-gud-enable-bindings): change gud commands to use
above macro.
Set gud-minor-mode to 'matlab
2019-11-29 11:21:56 -05:00
Eric Ludlam 90e0c7dcf7 matlab-shell-gud.el:
(gud-matlab-tool-bar-map): New.
(matlab-shell-mode-gud-enable-bindings): Disable gud toolbar.
(gud-matlab-debug-tracker): enable and disable gud toolbar only when K>> prompt is around.
2019-11-29 09:55:42 -05:00
Eric Ludlam 7a5bc522d7 tlc.el:
(tlc-calc-next-indentation): indentation improvements.
2019-11-29 09:10:55 -05:00
Eric Ludlam 4fd9bdac9d tests/+eltest/@EmacsTest/EmacsTest.m:
Add new method for debugger interface testing.
Make be a handle so we have something interesting to look at.
2019-11-29 08:53:41 -05:00
Eric Ludlam 28e8d240f2 matlab-shell-gud.el:
Add debugging tooltips.
(matlab-shell-gud-startup): Remove `gud-overload-functions' code.
It doesn't seem to exist anymore.
(matlab-shell-gud-show-symbol-value): Use improved region query.
Don't show help if there was an error.  Instead note the
error in minibuffer.
(gud-matlab-tooltip-tips): Use new fcn below to compute tip.
Use emacstipstring ML command to compute text to show.
(matlab-shell-gud-find-tooltip-expression): New.
Compute the expression to send to ML to display.
2019-11-29 08:52:24 -05:00
Eric Ludlam d4c648e906 emacstipstring.m:
New function for generating a string to show in a tooltip.
Currently a placeholder implementation.
2019-11-29 08:48:50 -05:00
Eric Ludlam afce4c2d56 dbtester.m:
Add more exampes code using eltest.EmacsTest.
2019-11-29 08:48:10 -05:00
Eric Ludlam 5babf99f26 matlab-shell.el:
(matlab-shell): Fixup TODO comment
2019-11-29 08:47:33 -05:00
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
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
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