FYI: I published an updated version of my previous post about treebar on my website: http://www.softmechanics.net/treebar

-matt

On Tue, Apr 21, 2009 at 12:02 PM, Matt Brown <matt@softmechanics.net> wrote:
Hello all,

I've published a small package of tree-based navigation functions for speedbar.  Check it out if you like, and let me know what you think!


Setup:
1) Get the source:
svn co http://svn.softmechanics.net/treebar

2) Load treebar:
(add-to-list 'load-path "/path/to/treebar")
(require 'treebar)

3) Set the speedbar keymap:
(add-hook 'speedbar-reconfigure-keymaps-hook 'treebar-configure-keymap)


Navigation:
The default keymap puts everything right on home row without modifiers.  The bindings are:

(defun treebar-configure-keymap()
  ;; siblings
  (local-set-key "k" 'treebar-prev-sibling-or-parent)
  (local-set-key "j" 'treebar-next-sibling-or-uncle)

  (local-set-key "a" 'treebar-first-sibling)
  (local-set-key ";" 'treebar-last-sibling)

  ;; parent/child
  (local-set-key "f" 'treebar-goto-parent)
  (local-set-key "s" 'treebar-goto-parent-and-contract)

  (local-set-key "d" 'treebar-expand-and-down)

  ;; uncle
  (local-set-key "l" 'treebar-next-uncle)
  )


Notes:
1) You can customize your keymap settings by replacing treebar-configure-keymap in step 3. 
2) I find increasing speedbar's indentation setting makes it easier to see the tree structure:
(custom-set-variables  '(speedbar-indentation-width 3))
3) By default, speedbar displays the directory containing the currently edited file.  I prefer to disable this so I can see my entire project:
(add-hook 'speedbar-load-hook 'speedbar-toggle-updates)

-Matt