larsbrinkhoff / forth-mode

Wants to be the SLIME of Forth
GNU General Public License v3.0
61 stars 17 forks source link

Add imenu support #2

Closed lokedhs closed 8 years ago

lokedhs commented 8 years ago

In order to add imenu support, all that needs to be done is to set imenu-generic-expression to a set of matchers that are able to detect the form of a function definition.

Once that has been written, adding the following will use this to provide speedbar support:

(with-eval-after-load 'speedbar
  (speedbar-add-supported-extension ".fs"))
larsbrinkhoff commented 8 years ago

Thanks! I already set imenu-generic-expression.

larsbrinkhoff commented 8 years ago

Elisp ref: https://www.gnu.org/software/emacs/manual/html_node/elisp/Imenu.html

How do I get information out of imenu?

lokedhs commented 8 years ago

You can use (imenu--make-index-alist t) to get imenu entries for the file.

larsbrinkhoff commented 8 years ago

Thanks!

larsbrinkhoff commented 8 years ago

I added the speedbar thing, but I'm not sure it works.