Ads by Google

Saturday, April 19, 2008

The closest to text intellisense in Emacs

Emacs users know that M-/ is used to the expand the text at point for possible completions. One good thing is that it searches all the buffers for possible completions. While this is not the same as programming language intellisense stuff you find in programming editors from Microsoft, Sun and Eclipse, it's still a better choice than a language specific offering.

Why? Because it gives the same consistent behaviour in whatever buffer you're in. You can be sure that if you had typed it before, it can be plugged into the current buffer in whatever mode it is in with a minimal of keystrokes. This is in contrast to other specialised editors which can offer the feature for Java, C or C++, say.

OK, the choice of M-/ is not exactly great for those who are not good typists.

But this is Emacs; there is a way to use TAB as the more natural keystroke to expand the text at point. Plugging in the code given at this link will make text expansion or completion a lot more natural. Having done that, I've pretty much stopped using M-/ for text expansion.

One other way to do text completion is to use Predictive mode which learns from your typing style; Having used it before, I could see the benefits but I ran into some resource usage errors with the dictionary and hence stopped using it.

I'd encourage people to try predictive mode if only to see the possibilities that might arise for you. A typing session that is customised to the way you write. It might be very useful for people who are in some specialised fields with limited but large words usage.