~ubuntu-branches/debian/lenny/ecb/lenny

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<html lang="en">
<head>
<title>ECB - the Emacs Code Browser</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name=description content="ECB - the Emacs Code Browser">
<meta name=generator content="makeinfo 4.2">
<link href="http://www.gnu.org/software/texinfo/" rel=generator-home>
</head>
<body>
<p>
Node:<a name="Personal%20keybindings">Personal keybindings</a>,
Next:<a rel=next accesskey=n href="Using-popup-menus.html#Using%20popup-menus">Using popup-menus</a>,
Previous:<a rel=previous accesskey=p href="Incremental-search.html#Incremental%20search">Incremental search</a>,
Up:<a rel=up accesskey=u href="Using-the-keyboard.html#Using%20the%20keyboard">Using the keyboard</a>
<hr><br>

<h4>Adding personal keybindings</h4>

<p>There are five hooks which can be used for adding personal keybindings
to the ECB tree-buffers:

<ul>
<li><code>ecb-common-tree-buffer-after-create-hook</code>
<li><code>ecb-directories-buffer-after-create-hook</code>
<li><code>ecb-sources-buffer-after-create-hook</code>
<li><code>ecb-methods-buffer-after-create-hook</code>
<li><code>ecb-history-buffer-after-create-hook</code>
</ul>

<p>These hooks are called directly after tree-buffer creation so they can
be used to add personal local keybindings<a rel=footnote href="#fn-1"><sup>1</sup></a> either to all tree-buffers
(<code>ecb-common-tree-buffer-after-create-hook</code>) or just to a certain
tree-buffer. Here is a list which keys MUST NOT be rebound:

<ul>
<li><kbd>RET</kbd> and all combinations with <kbd>Shift</kbd> and <kbd>Ctrl</kbd>:
Used for selecting nodes in all tree-buffers. 
<li><kbd>TAB</kbd>:
Used for expanding/collapsing nodes in all tree-buffers. 
<li><kbd>C-t</kbd>:
Used for toggling "jump after selection" in all tree-buffers, see
command <code>ecb-toggle-RET-selects-edit-window</code>. 
<li>All self-inserting characters:
Used for easy and fast navigation in all tree-buffers,
See <a href="Incremental-search.html#Incremental%20search">Incremental search</a>. 
<li><kbd>F2</kbd>, <kbd>F3</kbd>, <kbd>F4</kbd>:
Used for customizing ECB, adding source-path in the directories buffer. 
</ul>

<p>The following example binds <kbd>C-a</kbd> to some useful code in ALL
tree-buffers and <kbd>C-d</kbd> to even more useful code ONLY in the
directories buffer:

<br><pre>(add-hook 'ecb-common-tree-buffer-after-create-hook
          (lambda ()
             (local-set-key (kbd "C-a")
                            (lambda ()
                               (interactive)
                               (message "ECB is great!")))))

(add-hook 'ecb-directories-buffer-after-create-hook
          (lambda ()
             (local-set-key (kbd "C-d")
                            (lambda ()
                               (interactive)
                               (message "ECB is wonderful!")))))
</pre>

<hr><h4>Footnotes</h4>
<ol type="1">
<li><a name="fn-1"></a>
<p>To be more general:
They can be used to run any arbitrary lisp code after a tree-buffer
creation!</p>

</ol><hr>

</body></html>