4

I am writing a .hs (haskell) file through emacs and loading it with 'load file' (C-c C-l).

For testing the functions, I switchover to Main Prompt Window (C-x o), where I need to type complete function name. I am sure there must be a way to get the function names through auto-completion, but I don't know how to do it and could not find?

Please guide.

dave4420
  • 46,404
  • 6
  • 118
  • 152
Optimight
  • 2,989
  • 6
  • 30
  • 48
  • 2
    Of course you tried Meta-/ and it doesn't find what you want ? – Jedai Jul 19 '12 at 15:53
  • What do you mean "nothing worked" ? It should at least propose some completions. Does it just do nothing or are you unsatisfied by the suggestions ? – Jedai Jul 19 '12 at 16:00
  • Jedai: Your suggestion is correct. I implemented it in correct manner now. It worked absolutely fine. Thanks a lot. – Optimight Jul 19 '12 at 16:06

2 Answers2

1

This answer found in Jedai's comment on the question.

When in Main prompt window, if you require, say function "doubleMe" , just type initial 2-3 letters like "dou" and then press Meta-/ (the meta key or Alt key and slash together); you will find the auto-completed function name. In this case - "doubleMe".

If you have multiple function names or other words in the buffer and around; which starts with "dou" then keep on pressing Meta-/ , till you find the desired name.

Note that this feature works in all windows.

Optimight
  • 2,989
  • 6
  • 30
  • 48
  • Are these function-names only or every word in that buffer and around ? I see the latter as possibility. – aartist Jul 19 '12 at 17:37
  • aartist: It is every word in that buffer and around. If we can achieve every word in the .hs code buffer only or more preferably only function names of the same buffer and imported functions, will be most suitable for the purpose. – Optimight Jul 19 '12 at 17:45
0

Yes. I use imenu.el

For C language there are many possibilities.

It is expected that imenu shoud work for all possible languages.

alinsoar
  • 15,386
  • 4
  • 57
  • 74
  • alinsoar: How to attach/install or from where imenu.el to get for emacs? – Optimight Jul 19 '12 at 00:30
  • Gone through the suggested link but as of now it seems difficult to me. Afraid that I may disturb my current system, if I can't follow the suggested procedure in correct manner. – Optimight Jul 19 '12 at 16:01
  • Try this: (define-key global-map [(control shift mouse-3)] 'imenu) (setq imenu-sort-function (quote imenu--sort-by-name) imenu-max-items 250 ) – alinsoar Jul 19 '12 at 19:55