> Sorry for jumping into the discussion (and almost knowing nothing about
> xref), I do use org mode to execute matlab code via babel and I am sure
> other users as well. 

Me too, that's why I put it there while I was testing the patch. 

> Does this in  anyway influence the part
>
>>   (and (member major-mode '(matlab-mode matlab-shell-mode org-mode))
>
> You were just talking about?

That is indeed the line I suggested removing. However it's unnecessary,
since just including it doesn't let us use xref in org-mode either. For
that we need something like this in `org-mode-hook' instead:

(add-hook 'org-mode-hook
          (lambda ()
           (add-hook 'xref-backend-functions 'matlab-local-xref-activate nil t)
           (add-hook 'xref-backend-functions 'matlab-shell-xref-activate nil 
t)))

The matlab-shell based xref backend will fail to jump to definitions in
org-babel code blocks, though it will still work on built-ins and
functions defined in dedicated m-files. The local xref-backend should
fill in the gaps there, although I haven't tested it yet.

Karthik
       


_______________________________________________
Matlab-emacs-discuss mailing list
Matlab-emacs-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matlab-emacs-discuss

Reply via email to