matlab-mode and tlc-mode provides imenu support which lets you jump quickly to functions in the
current *.m file you are visiting. Typing M-g i (or M-x imenu) will prompt you in the
mini-buffer:
Index item:
You can type TAB to complete MATLAB function names and after selecting one, the point is moved to that function. For example, given test1.m
function test1
a = test2(2);
b = test3(a);
test4(b);
end
function out = test2(in)
out = in * 2;
end
function [out] = test3(in)
out = in * 3;
end
function test4(in)
disp(num2str(in))
endTyping M-g i followed by a TAB at the prompt:
Index item: <TAB>
gives:
5 Possible completions: *Rescan* myFunc1 myFunc2 myFunc3 myFunc4
and you can select the one you’d like by clicking on it or by typing the name with tab completion.
- If you are using
matlab-ts-modeIn your
~/.emacs, add(add-hook 'matlab-ts-mode-hook (lambda () (imenu-add-to-menubar "Imenu")))
- If you are using
matlab-modeM-x customize-variable RET matlab-mode-hook RETand add:
(lambda () (imenu-add-to-menubar "Imenu"))
- If you are using
tlc-modeM-x customize-variable RET tlc-mode-hook RETand add:
(lambda () (imenu-add-to-menubar "Imenu"))