0

The documentation to Imenu states:

Imenu provides the information to guide Which Function mode (see Which Function Mode). The Speedbar can also use it

My questions is: How do I add imenu entries to the speedbar?

1 Answer 1

2

To add support for Markdown, eval:

(require 'speedbar)
(speedbar-add-supported-extension ".md")

Usually, you don't have to worry about this:
Speedbar (smartly) handles this automatically.

For example, there's a Python file a.py on my ~/Desktop:

def f():
    pass
class C:
    def m1(self):
        pass
    def m2(self):
        pass
def g():
    pass

Simply launch Emacs by emacs -Q and type M-x speedbar. You can see there is a + sign before the filename:

Click at the + sign and you'll see the declaration list as shown in the imenu:

2
  • This seems to work for python files. I want that for markdown files though. markdown-mode populates imenu entries with heading entries, but these entries are not available in speedbar, neither on the files display nor on the buffers display for already opened markdown files.
    – JohnDoe
    Commented Jun 13 at 6:52
  • 1
    @JohnDoe: See edit
    – shynur
    Commented Jun 13 at 9:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.