Ads by Google

Showing posts with label ffap. Show all posts
Showing posts with label ffap. Show all posts

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.

Wednesday, June 11, 2008

A quick way to open files in Emacs

Emacs users when interacting with the shell have a faster method to open files compared to other editors. Most editors will provide a shell escape through which a listing of a directory can be got; or a find command executed.

That's it.

You still need to highlight the interested file, copy into your "open file" dialog and then open the file. Well, Emacs offers the same feature too and more.

If your point is positioned at the start of the file name /tmp/foo, then M-x ffap which stands "find file at point" opens the file. As usual the excellent documentation of ffap gives you other options. Apart from the name, the way the file is opened is simply intuitive without any fuss. In fact, the documentation lists other options to ffap that might useful for mouse users.