Ads by Google

Tuesday, November 1, 2011

It's these little things....in Emacs

You know why I continue to use emacs?  It's those little things that DTRT.  So, here I am looking at some octave code and trying to look at a function definition in another file.

% Randomly select 100 data points to display
rand_indices = randperm(m);
sel = X(rand_indices(1:100), :);

displayData(sel);
^Point is here
fprintf('Program paused. Press enter to continue.\n');
pause;


Any other editor, I'd have to do one or the other; Go to File-->Open.... or switch to Explorer view and open the file by double clicking on it.

In Emacs, I just do M-x ffap at point and it simply prompts me with the completed file name and waits for me to hit RET.

Awesome.

5 comments:

Anonymous said...

You can do this in vim as well with 'gf' for 'goto file under cursor'.

GMc said...

Good tip. But Vim would fall under your "any other editor" category and it does the same thing with fewer keystrokes.

sivaram said...

Right, it's nice to know vim does it too. Don't use vim much, so didn't know this at all.

itsjeyd said...

Someone is doing the Stanford course on machine learning... :D

sivaram said...

Too many guys watching everything I do. :-)