File: eieio-speedbar.el.html
This provides some classes that can be used as a parent which will automatically provide SPEEDBAR support for any list of objects of that type.
This file requires speedbar version 0.10 or later.
; Creating a new speedbar mode based on a pre-existing object hierarchy
To create a new speedbar mode based on lists of objects is easier than creating a whole new speedbar mode from scratch.
1) Objects that will have lists of items that can be expanded
should also inherit from the classes:
* eieio-speedbar(var)/eieio-speedbar(fun) - specify your own button behavior
* eieio-speedbar-directory-button(var)/eieio-speedbar-directory-button(fun) - objects that behave like directories
* eieio-speedbar-file-button(var)/eieio-speedbar-file-button(fun) - objects that behave like files
2) Objects that have lists of children should implement the method
eieio-speedbar-object-children which returns a list of more
objects, or a list of strings.
3) Objects that return a list of strings should also implement these
methods:
* eieio-speedbar-child-make-tag-lines - make tag lines for a child.
* eieio-speedbar-child-description - describe non-object children
4) Objects which have expanded information should implement the method
eieio-speedbar-description to produce more information.
5) Objects that are associated with a directory should implement
the method eieio-speedbar-derive-line-path which returns a
path.
6) Objects that have a specialized behavior when clicked should
define the method eieio-speedbar-handle-click.
To initialize a new eieio based speedbar display, do the following.
1) Create a keymap variable foo-speedbar-key-map.
This keymap variable should be initialized in a function.
If you have no special needs, use eieio-speedbar-key-map
2) Create a variable containing an easymenu definition compatible
with speedbar. if you have no special needs, use
eieio-speedbar-menu.
3) Create a function which returns the top-level list of children
objects to be displayed in speedbar.
4) Call eieio-speedbar-create as specified in it's documentation
string. This will automatically handle cases when speedbar is
not already loaded, and specifying all overload functions.
5) Create an initializer function which looks like this:
(defun my-speedbar-mode-initialize ()
"documentation"
(interactive)
(speedbar-frame-mode 1)
(speedbar-change-initial-expansion-list mymodename)
(speedbar-get-focus))
where mymodename is the same value as passed to eieio-speedbar-create
as the MODENAME parameter.
@todo - Can we make this ECB friendly?
Defined variables (2)
eieio-speedbar-key-map | A generic object based speedbar display keymap. |
eieio-speedbar-menu | Menu part in easymenu format used in speedbar while browsing objects. |