4

Is there a way to get an occur-style summary that contains all of the function definitions of the current file? Perhaps using semantic-mode?

I'm particularly concerned about C. Emacs Lisp, Caml (tuareg-mode) and Haskell would be welcome additions, but not required.

jch
  • 5,680
  • 22
  • 39

1 Answers1

5

If you use Helm, then yes, there's helm-semantic-or-imenu command.

Demo with C:

c

Demo with Emacs Lisp:

elisp

For Caml and Haskell, you can use this command but there's probably only Imenu support (so you won't get full function interface like the above 2 demos).

Tu Do
  • 6,772
  • 20
  • 39
  • I am not using Helm, I found it distracting (too flashy). Perhaps I should give it another chance. – jch Nov 09 '14 at 18:22
  • If you don't want to enable Helm for everything, don't put in `(helm-mode 1)`. You can pick and use individual commands. If you use `helm-mode`, see [Use Helm with Ido in Helm Wiki](https://github.com/emacs-helm/helm/wiki#use-helm-mode-and-ido-mode). – Tu Do Nov 09 '14 at 18:32
  • I've now tried that. Unlike the occur buffer, which is just an ordinary Emacs buffer with some special commands, the Helm buffer has very different behaviour. I'd much prefer working with an ordinary Emacs buffer. – jch Nov 09 '14 at 18:45
  • 1
    It is used for quick look up and jump around and is quite fast. If you want to always have visible buffer that lists definitions, how about [sr-speedbar as an outline tree](http://tuhdo.github.io/static/c-ide/sr-speedbar.gif)? If you want exactly occur-style buffer, then there's none exist. – Tu Do Nov 09 '14 at 18:49
  • 1
    @jch, you can use the standard `M-x imenu`, I guess or ido-imenu if you're an ido user. http://wikemacs.org/wiki/Imenu – rimero Nov 10 '14 at 04:22