Speedbar how to add support for custom source files?

1k views Asked by At

I want Speedbar to display outlines (list of variables, functions and other "interesting" objects") I have in source files it doesn't understand yet. I have code to generate TAGS for the sources in question, where should I look for a hook / configuration to do that?

1

There are 1 answers

0
Praveen Kumar On BEST ANSWER

You can use speedbar-add-supported-extension function to add new files that speedbar doesn't understand by default.

From speedbar.el:

You should use the function 'speedbar-add-supported-extension' to add a new extension at runtime, or use the configuration dialog to set it in your .emacs file. If you add an extension to this list, and it does not appear, you may need to also modify 'completion-ignored-extension' which will also help file completion.

In addition to that, you may want to teach speedbar how to parse the tags for this new file using speedbar-fetch-etags-parse-list. For a C/C++ style language with a file extension .foo you might want to do something like this.

(speedbar-add-supported-extension ".foo")
(add-to-list 'speedbar-fetch-etags-parse-list
    '("\\.foo" . speedbar-parse-c-or-c++tag))