Seems to be a couple ways of doing this:
Configuring a imenu-generic-expression regex's.
Redifining imenu-create-index ala python.el.
In [1]:
def func():
pass
class my_class(object):
def __init__(self):
pass
def funcme(arg1):
pass
In [2]:
1/0
In [4]:
import inspect
In [4]:
In [5]:
1+1
Out[5]:
In [6]:
inspect
Out[6]:
In [ ]: