Next: , Previous: Updating a tree-buffer, Up: tree-buffer


11.3.5 Default and customizable keybindings of a tree-buffer

When creating a tree-buffer with tree-buffer-create the following keys will automatically being bound:

delete
backspace
home
end
a (and each other key bound to self-insert-command)
All of these keys are bound to the command tree-buffer-incremental-node-search if the argument INCR-SEARCH-P of tree-buffer-create was set to not nil. See the documentation of tree-buffer-incremental-node-search for all details.
RET
C-RET
S-RET
M-RET
C-S-RET
mouse-1
C-mouse-1
S-mouse-1
M-mouse-1
mouse-2
C-mouse-2
S-mouse-2
M-mouse-2
All these keys are bound to an action-dispatcher which works as follows:

If the callback-function in slot IS-CLICK-VALID-FN of the tree-buffer (see A new tree-buffer) returns nil then nothing is done.

If either RET has been hitted or point is as the node-name (i.e. the user has clicked with the mouse-1/2 at the node-name) then the callback-function in slot NODE-SELECTED-FN is called with the needed arguments (see A new tree-buffer).

If point is at the expand/collape-button then depending on the expansion-state of the node either the callback in slot NODE-EXPANDED-FN or NODE-COLLAPSED-FN is called (for parameters see again A new tree-buffer).

IMPORTANT: None of these callbacks must modify the slot EXPANDED of the passed node because this is done automatically by the action-dispatcher!

At the end the dispatcher updates the tree-buffer-display with optimized display of the clicked/selected node - see Updating a tree-buffer. This means tree-buffer-update is called with that node as argument.

TAB
Depending on the expansion-state of the node either the callback in slot NODE-EXPANDED-FN or NODE-COLLAPSED-FN is called (for parameters see again A new tree-buffer).

IMPORTANT: None of these callbacks must modify the slot EXPANDED of the passed node because this is done automatically by the action-dispatcher!

At the end the the tree-buffer-display is updated with optimized display of the clicked/selected node - see Updating a tree-buffer. This means tree-buffer-update is called with that node as argument.

mouse-3
Activates the popup-menu for the current tree-buffer for current node-type (if defined). See A new tree-buffer at argument MENU-CREATOR and MENU-TITLES. These callbacks are called for getting the menu and the menu-title.
modeline-mouse-3
Activates the popup-menu for the modeline of the current tree-buffer (if defined). See A new tree-buffer at argument MODELINE-MENU-CREATOR. This callback is called for getting the modeline-menu.
M-m
This key is bound to the command tree-buffer-show-node-menu-keyboard: Activates the popup-menu of current tree-buffer for current node-type via keyboard. If called with a prefix-arg then the library tmm.el is used for displaying the popup-menu - ignored with XEmacs.
<up>
<down>
<left>
<right>
These keys are bound to the command tree-buffer-arrow-pressed which implements the smart arrow-key-navigation described in A new tree-buffer at argument ARROW-NAVIGATION.

In addition to these automatically bound keys you can add further keybindings to the local-keymap of the tree-buffer with the parameter AFTER-CREATE-HOOK of tree-buffer-create. See A new tree-buffer for an example which binds C-t in this hook.