Fix conflict between matlab-shell debugging and C++ (or other language) debugging.
- matlab-shell debugging previously leveraged gud.el for debugging of *.m files.
- C++ debugging also leverages gud.el for debugging.
- Only one instance of a gud.el debugger can be active. If you run two, say
*.m debugging and C++ debugging. Then you get odd errors such as the
ebbreak not being recognized by gdb.
To fix these issue, I copied gud.el and made a new namespace "mlgud". I also
removed a lot of unused code from mlgud.el, though there's still more that can
be removed. Now one can debug *.m files and *.cpp files in one Emacs session.
(matlab-netshell-execute-command): Whe enabling gud bindings, do
so in the netshell process buffer. Protects local keybindings in
whatever the default buffer was from gud's calls to set-local-key.
(matlab-netshell-server-name): Renamed from matlab-netshell-name.
(matlab-netshell-server-active-p): New, use above.
(matlab-netshell-server-start): Use new servername variable for both buffer
and process.
(matlab-netshell-server-stop): Use new servername variable.
Improve command parsing / error handling.
(matlab-netshell-client): New helper.
(matlab-netshell-execute-command): Handle new commands
output, and error.
(matlab-netshell-eval): Designed for sending an eval command
(matlab-netshell-evalc): Designed for sending an evalc command
matlab-shell.el:
Integrate netshell support.
(matlab-shell-autostart-netshell): New option.
(matlab-netshell-active-p, matlab-any-shell-active-p): New
(matlab-shell-send-command): New wrapper around send-string
or netshell command send.
(matlab-shell-save-and-go): Integrate matlab-netshell.
Improve finding if we need to CD somewhere.
Use 'run' to run things not on the path.
Select between netshell or regular shell.
(matlab-shell-run-region): If netshell is available, use it
to send region to MATLAB.
matlab.el:
Fix menus that need a shell.
(matlab-frame-init): For commands that need a shell, now use
`matlab-any-shell-active-p'.
matlab-netshell.el:
(matlab-netshell-acc, matlab-netshell-filter):
Keep an accumulator for input from the tcp process.
Packets are seperated by \0.
Commands start, end with newline, then data follows.
Call below with found commands.
(matlab-netshell-execute-command):
Log commands recieved.
Evaluate different commands. Implement ACK.
(matlab-netshell-sentinel):
Create buffer for newly formed network processes.
(matlab-netshell-send): Fix to send CMD,DATA, not just msg.
(matlab-netshell-eval): Send request to eval something in ML.
(matlab-netshell-ack): Send ACK request.
+emacs/@EmacsServer/EmacsServer.m
NEW. Object to handle MATLAB state for connecting over tcp
with Emacs.
Implementation started in emacsnetshell.m
Added command parsing (same as Emacs) and command execution.
Implement ACK
emacsnetshell.m:
Remove old impl. Use EmacsServer for core behavior.
Act as interface to object so user can send commands
via this function.
New utilities that allow MATLAB to connect to an emacs server.
Emacs can send MATLAB requests, and MATLAB will respond with the output
of executing those commands.