Commit graph

530 commits

Author SHA1 Message Date
Eric Ludlam 2de21e3a1e toolbox/ebstack.m:
New wrapper for dbstack, using emacs.Stack to send data to Emacs.
2019-12-08 22:07:56 -05:00
Eric Ludlam 9ba9c66032 toolbox/+emacs/@EmacsServer/EmacsServer.m:
(breakpoints): Remove unused property.
2019-12-08 22:06:24 -05:00
Eric Ludlam 003e54ef5b toolbox/+emacs/@Stack/Stack.m:
New class for managing the sending of stacks to Emacs.
2019-12-08 22:05:50 -05:00
Eric Ludlam 30bbf55ef5 tests/dbtester.m
Add a deeper set of local functions to test stack reporting.
2019-12-08 22:04:45 -05:00
Eric Ludlam c5ebe3267d matlab-maint.el:
(easy-menu-define): Add "Display Logger frame" menu item.
(matlab-maint-logger-frame): New variable
(matlab-maint-toggle-logger-frame): New command.
2019-12-08 14:03:46 -05:00
Eric Ludlam 9bca22a465 matlab-compat.el:
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
2019-12-08 13:08:43 -05:00
Eric Ludlam bff15251f2 matlab-shell-gud.el:
Enable debug commands via netshell.
(matlab-at-fcn): New macro, dispatch to netshell if active.
(matlab-gud-fcn): Revise doc, it was wrong.
Use matlab-at-fcn internally.
(matlab-shell-mode-gud-enable-bindings): Use matlab-at-fcn for
dbstop/dbclear.
(gud-matlab-tooltip-tips): Fix bug for events from the shell
buffer, which seem to generate events with a window that has no
buffer.
2019-12-08 12:33:37 -05:00
Eric Ludlam aa0fa8e268 toolbox/emacsinit.m:
If netshell is being requested, capture it's object.
Initialize breakpoints with the netshell obj so it can
update via netshell if needed.
2019-12-08 12:31:21 -05:00
Eric Ludlam 59b326edd6 matlab-shell.el:
(matlab-shell-render-errors-as-anchor): Use `matlab-string-trim' instead
of `string-trim' for compat w/ older emacsen.
2019-12-08 12:30:17 -05:00
Eric Ludlam 885eae827a matlab-compat.el:
(matlab-string-trim): New compatability shim.
`string-trim' introduced in newer emacsen.  This impl provides what is
needed for matlab-shell.
2019-12-08 12:29:40 -05:00
Eric Ludlam 42ecb1942d toolbox/+emacs/@EmacsServer/EmacsServer.m
(breakpoints): New property
(SendEval): New method to send an eval command.

(ExecuteRemoteCommand): Use evalin, not eval.
2019-12-08 12:17:33 -05:00
Eric Ludlam 4613f761ad toolbox/+emacs/@Breakpoints/Breakpoints.m
Support a netshell input.
When netshell is active, send breakpoints via the netshell connection.
Convert all disp commands to instead create a string
that can be sent via netshell.
2019-12-08 12:05:12 -05:00
Eric Ludlam 7b5cab6bee toolbox/emacsnetshell.m:
Fix so commands get sent as intended.
Enable output argument if provided.
2019-12-08 11:57:17 -05:00
Eric Ludlam 28f0116169 toolbox/ebclear., ebstop.m:
Fix function names to match file name.
2019-12-08 11:56:15 -05:00
Eric Ludlam e2b6dbe997 matlab-shell.el:
(matlab-shell-error-anchor-expressions): Update to also deal with
output from dbup/down "workspace belonging to" flavor text.
(matlab-shell-render-errors-as-anchor): Trim file name string.
(matlab-shell-capture-text): Protect when running forms from MATLAB.
2019-12-08 11:55:24 -05:00
Eric Ludlam 154c4cab8b matlab-netshell.el:
(matlab-netshell-execute-command):
Support 'eval' command from MATLAB.
2019-12-08 11:49:26 -05:00
Eric Ludlam a6bcf575fa matlab-shell-gud.el:
Add support for visible breakpoints.
(matlab-shell-mode-gud-enable-bindings): Use ebstop,ebclear instead
of dbstop,dbclear.
(mlg-breakpoint): New class.
(matlab-gud-visible-breakpoints): New variable.
(mlg-reset-breakpoints, mlg-add-breakpoints, mlg-del-breakpoint): New.
Manage list of breakpoints.
On first add, add matlab-mode-hook to activate breakpoints when a
new ML buffer is pulled into a buffer.
(mlg-breakpoint-face): New face.
(mlg-breakpoint::mlg-activate): New method.
Creates an overlay at the loction of the breakpoint.
(mlg-breakpoint::mlg-deactivate)
(mlg-breakpoint-activate-buffer-opened-hook): New
(mlg-breakpoint-flush-and-reactivate): New command for debugging.

(matlab-shell-gud-minor-mode): Fix bug - want to make-local-variable,
not make it buffer local.
2019-12-07 19:41:49 -05:00
Eric Ludlam d14991310b toolbox/+emacs/@Breakpoints/Breakpoints.m:
New breakpoint tracking object.  Keep track of breakpoints
and send Emacs only the deltas.

toolbox/emacsinit.m:
Initialize breakpoint tracker.

toolbox/ebstop.m, toolbox/ebclear.m, toolbox/ebstatus.m:
New wrappers for dbstop, dbclear, and dbstatus.
Calls the built-in, and then calls the breakpoint tracker
to tell emacs about any changes in breakpoints.
2019-12-07 19:37:29 -05:00
Eric Ludlam 34b192db4c matlab-shell.el:
(matlab-shell-error-face): Give this face a customization group.
2019-12-07 19:33:07 -05:00
Eric Ludlam d4dc0cce54 matlab-shell-gud.el:
Refine some of the debugging environment.
(matlab-shell-mode-gud-enable-bindings): Remove extra /
from stop/clear commands.
Don't provide a print.
(matlab-shell-gud-minor-mode-map): Add C-xC-q binding
to disable the minor mode.  (like e)
(matlab-shell-gud-menu): Change text for exiting the minor mode.
Add show symbol value option.
(define-minor-mode): Replace the gud toolbar with our own.
Disable toolbar with our mode.

matlab.el:
Re-enable debug mode if it is available.
(matlab-mode-map): Replace `toggle-read-only' with
a matlab version.
(matlab-toggle-read-only): New command.
If the debugger is active, turn on matlab-shell-gud-minor-mode.
Otherwise do read-only-mode.
2019-12-07 13:17:57 -05:00
Eric Ludlam 19a0d5fc59 matlab-shell.el:
Allow spaces in front of Error text.
Needed for Errors that are captured, and posted later indented.
(matlab-shell-error-anchor-expression):
Allow spaces in front of error anchor.
2019-12-07 12:18:11 -05:00
Eric Ludlam b7dfa161f6 matlab.el:
More electric block comment behaviors.
(matlab-mode-map): Bind { to electric block comment.
(matlab-electric-block-comment): Auto-reindent block
comment start.  Useful when typing block comment after help
comments.
Add messages and highlighting for nested %{ and lonely %}.
2019-12-07 10:54:33 -05:00
Eric Ludlam 73dff40bfa tests/indents.el
Added more block comment patterns.
2019-12-07 10:24:31 -05:00
Eric Ludlam 6df971b0d2 matlab.el:
Electric block comment behaviors.
(matlab-mode-map): Bind } to electric block comment.
(matlab-mode): Add setting to after-change-functions
to `matlab-change-function' for clearing parsing caches.
(matlab-backward-sexp): Add special block-comment handler.
Convert to use (cond ...) instead of if.
(matlab-forward-sexp): Add block-comment handler
(matlab-change-function): New after-change-function which
flushes the block-comment cache.
(matlab-ltype-block-comm-bounds, -lastcompute): Moved.
(matlab-indent-line): Deleted a line of dead code.
(matlab-calculate-indentation-1): block comment body
lines that start with % now line up with the % in the
block comment start %{.
Replace uses of (current-column) with (current-indentation)
where appropriate.
(matlab-electric-block-comment): Auto-reindent block
comment end.
2019-12-07 10:19:37 -05:00
Eric Ludlam 1e6a2bbd38 indents.m:
Add wide range of additional tests.
This should have a mostly complete set of features
from matlab.el's indentation engine now.
2019-12-06 22:58:34 -05:00
Eric Ludlam d7fe4c5200 matlab.el:
Fany block comment indentation & performance changes.

When looking @ block comment indentation, discovered that
the block comment detector was called ALOT for indent of 1 line,
and then discovered beginning of command was also called a lot.

Added caching for block comment detection, and cut back on calls
to beginning of command.

(matlab-in-command-restriction): New
(matlab-with-current-command): New, uses above.
Create restriction by using matlab-beginning-of-command,
and be aware there is no need to re-restrict if we
detect we have recursed.
(matlab-valid-end-construct-p)
(matlab-lattr-block-close): Use above

(matlab-prev-line-cont): Extracted from matlab-beginning-of-command.
(matlab-beginning-of-command): Use above.
Call matlab-ltype-block-comm, if in block comment, go to
start of block comment. (new feature)

(matlab-ltype-comm-noblock): New, extracted from `matlab-ltype-comm'.
(matlab-ltype-comm): Use above.
Move block comments first, since sometimes they detect
as reg comments.
(matlab-ltype-help-comm): Change to return location of
function the help is for.
Use new ltype-comm-noblock to be faster.
(matlab-ltype-block-comm-bounds)
(matlab-ltype-block-comm-lastcompute): New caches.
(matlab-ltype-block-comm): Move body to matlab-ltype-block-comm-1.
This now handles caching, recycling old computations if
called more than once in same region.
Handles 'linebounds' input.
(matlab-ltype-block-comm-1): Fix bug where end of block comm
was always point-max.
Set bounds cache.
(matlab-ltype-block-comm-at-start): New
Use block comment cache.
(matlab-ltype-block-comm-at-end): New
Use block comment cache.
(matlab-ltype-continued-comm): Use ltype-comm-noblock.
(matlab-lattr-cont): Don't require % for comment after ...

(matlab-calculate-indentation-1):
Optimize finding beginning of defun by caching output
of matlab-ltype-help-comm.
Add new indentation parts for block comment start,end, and body.
For code lines don't use beginning-of-command, instead check
that prev line isn't a continuation.
For continuations, compute beginning of command, and use
for both sides of the condition-case.

(matlab-next-line-indentation):
Use `matlab-with-current-restriction' instead of using
beginning-of-command by itself.
2019-12-06 22:57:32 -05:00
Eric Ludlam 351bfbb62d matlab-shell.el:
Improve performance of processing massive error stacks.
(matlab-shell-in-process-filter): New state variable.
(matlab-shell-wrapper-filter): Bind above to t inside body of filter.
(matlab-shell-mref-which-fcn): Do not process file names if in a process filter.
2019-12-03 13:24:13 -05:00
Eric Ludlam 30b8450c02 matlab-shell-gud.el:
(gud-matlab-marker-filter): For any output not terminated by \n,
check for any special prefixes, and dump the rest if those aren't there.
2019-12-02 21:53:48 -05:00
Eric Ludlam 49338f8979 toolbox/emacscd.m
Add example code for identifying if you're inside Emacs for this ML session
and sending the <EMACSCAP> cookie only if we are in Emacs.
2019-12-01 21:15:57 -05:00
Eric Ludlam f0139a5000 toolbox/help.m
Fix cases where you can't get help on functions in matlab-emacs/toolbox,
or case where cwd is matlab-emacs/toolbox.
2019-12-01 20:52:12 -05:00
Eric Ludlam bff6d627fd tests/mstest.el:
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.
2019-12-01 20:36:49 -05:00
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
Uwe Brauer 37eccb857a Merge modernize into documentation
--HG--
branch : documentation
2019-11-29 15:27:38 +01: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