|
From: Karthik C. <kar...@gm...> - 2020-11-29 07:56:13
|
Hi Jonathan and Eric,
Jon, to get help on the function at point you can do something like this:
(defun matlab-shell-help-at-point ()
(interactive)
(let ((fcn (matlab-read-word-at-point)))
(if (and fcn (not (equal fcn "")))
(matlab-shell-describe-command fcn))))
(define-key matlab-mode-map (kbd "C-h .") #'matlab-shell-help-at-point)
Matlab-mode works with company out of the box for me. Can you describe the error(s) you are getting?
For jump-to-function you have two options (three including Eric's suggestion):
1. Install dumb-jump from MELPA. Then hitting 'M-.' on a function name should take you to the definition. Note that this only works for functions that are defined in m files in the same directory or project.
2. Patch matlab-shell.el with the attached patch, then put
(add-hook 'xref-backend-functions #'matlab-shell-xref-activate)
In your init file somewhere. This should enable xref support for Matlab shell. This should work for all functions that MATLAB shell knows about, including built-in ones.
Eric, I'm working on better completion in matlab-mode buffers using matlab-shell with your patch as a starting point. I should have something decent in a few days. Could you take a look at the xref integration? I tested it on matlab built-ins, user functions and variables, and tried to make sure it failed gracefully when it couldn't find a definition. More testing is probably required.
Thanks,
Karthik
|