Mercurial > emacs
annotate man/speedbar.texi @ 32765:f11890c9f7df
(byte-compile-file): Bind `byte-compile-last-logged-file' to nil.
author | Miles Bader <miles@gnu.org> |
---|---|
date | Mon, 23 Oct 2000 10:25:59 +0000 |
parents | 788c194fbcd1 |
children | 678eca93205c |
rev | line source |
---|---|
32674 | 1 \input texinfo @c -*-texinfo-*- |
2 @c | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
3 @c $Id: speedbar.texi,v 1.1 2000/10/20 01:53:35 zappo Exp $ |
32674 | 4 @c |
5 | |
6 @c This file is part of GNU Emacs | |
7 | |
8 @c GNU Emacs is free software; you can redistribute it and/or modify it | |
9 @c under the terms of the GNU General Public License as published by the | |
10 @c Free Software Foundation; either version 2 of the License, or (at | |
11 @c your option) any later version. | |
12 | |
13 @c GNU Emacs is distributed in the hope that it will be useful, but | |
14 @c WITHOUT ANY WARRANTY; without even the implied warraonty of | |
15 @c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
16 @c General Public License for more details. | |
17 | |
18 @c You should have received a copy of the GNU General Public License | |
19 @c along with Eshell; see the file COPYING. If not, write to the Free | |
20 @c Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | |
21 | |
22 @setfilename ../info/speedbar | |
23 @settitle Speedbar: File/Tag summarizing utility | |
24 | |
25 @ifinfo | |
26 @format | |
27 START-INFO-DIR-ENTRY | |
28 * Speedbar: (speedbar). File/Tag summarizing utility. | |
29 END-INFO-DIR-ENTRY | |
30 @end format | |
31 @end ifinfo | |
32 | |
33 @titlepage | |
34 @sp 10 | |
35 @center @titlefont{speedbar} | |
36 @vskip 0pt plus 1 fill | |
37 Copyright @copyright{} 1999, 2000 Eric M. Ludlam | |
38 @end titlepage | |
39 | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
40 @syncodeindex fn cp |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
41 |
32674 | 42 @node Top, , , (dir)Top |
43 @comment node-name, next, previous, up | |
44 | |
45 Copyright @copyright{} 1999 Eric M. Ludlam | |
46 | |
47 Speedbar is a program for Emacs which can be used to summarize | |
48 information related to the current buffer. Its original inspiration | |
49 is the "explorer" often used in modern development environments, office | |
50 packages, and web browsers. | |
51 | |
52 Speedbar displays a narrow frame in which a tree view is shown. This | |
53 tree view defaults to containing a list of files and directories. Files | |
54 can be "expanded" to list tags inside. Directories can be expanded to | |
55 list the files within itself. Each file or tag can be jumped to | |
56 immediately. | |
57 | |
58 Speedbar expands upon "explorer" windows by maintaining context with the | |
59 user. For example, when using the file view, the current buffer's file | |
60 is highlighted. Speedbar also mimics the explorer windows by providing | |
61 multiple display modes. These modes come in two flavors. Major display | |
62 modes remain consistent across buffers, and minor display modes appear | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
63 only when a buffer of the applicable type is shown. This allows |
32674 | 64 authors of other packages to provide speedbar summaries customized to |
65 the needs of that mode. | |
66 | |
67 Throughout this manual, activities are defined as "clicking on", or | |
68 "expanding" items. Clicking means using using @kbd{mouse-2} on a | |
69 button. Expanding refers to clicking on an expansion button to display | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
70 an expanded summary of the entry the expansion button is |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
71 on. @xref{Basic Navigation}. |
32674 | 72 |
73 @menu | |
74 * Introduction:: Basics of speedbar. | |
75 * Basic Navigation:: Basics of speedbar common between all modes. | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
76 * File Mode:: Summarizing files. |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
77 * Buffer Mode:: Summarizing buffers. |
32674 | 78 * Minor Modes:: Additional minor modes such as Info and RMAIL. |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
79 * Customizing:: Changing speedbar behavior. |
32674 | 80 * Extending:: Extend speedbar for your own project. |
81 * Index:: | |
82 @end menu | |
83 | |
84 @node Introduction, Basic Navigation, , Top | |
85 @comment node-name, next, previous, up | |
86 @chapter Introduction | |
87 @cindex introduction | |
88 | |
89 To start using speedbar use the command @kbd{M-x speedbar RET} or select | |
90 it from the Tools menu in versions of Emacs with speedbar installed by | |
91 default. This command will open a new frame to summarize the local | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
92 files. On X Window systems or on MS-Windows, speedbar's frame is twenty |
32674 | 93 characters wide, and will mimic the height of the frame from which it |
94 was started. It positions itself to the left or right of the frame you | |
95 started it from. | |
96 | |
97 To use speedbar effectivly, it is important to understand its | |
98 relationship with the frame you started it from. This frame is the | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
99 @dfn{attached frame} which speedbar will use as a reference point. Once |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
100 started, speedbar watches the contents of this frame, and attempts to |
32674 | 101 make it's contents relevant to the buffer loaded into the attached |
102 frame. In addition, all requests made in speedbar that require the | |
103 display of another buffer will display in the attached frame. | |
104 | |
105 When used in terminal mode, the new frame appears the same size as the | |
106 terminal. Since it is not visible while working in the attached frame, | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
107 speedbar will save time by using the @dfn{slowbar mode}, where no tracking is |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
108 done until speedbar is requested to show itself (i.e., the speedbar's |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
109 frame becomes the selected frame). |
32674 | 110 |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
111 @cindex @code{speedbar-get-focus} |
32674 | 112 The function to use when switching between frames using the keyboard is |
113 @code{speedbar-get-focus}. This function will toggle between frames, and | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
114 it's useful to bind it to a key in terminal mode. @xref{Customizing}. |
32674 | 115 |
116 @node Basic Navigation, File Mode, Introduction, Top | |
117 @comment node-name, next, previous, up | |
118 @chapter Basic Navigation | |
119 | |
120 Speedbar can display different types of data, and has several display | |
121 and behavior modes. These modes all have a common behavior, menu | |
122 system, and look. If one mode is learned, then the other modes are easy | |
123 to use. | |
124 | |
125 @menu | |
126 * Basic Keybindings:: | |
127 * Basic Visuals:: | |
128 * Mouse Bindings:: | |
129 * Displays Submenu:: | |
130 @end menu | |
131 | |
132 @node Basic Keybindings, Basic Visuals, Basic Navigation, Basic Navigation | |
133 @comment node-name, next, previous, up | |
134 @section Basic Keybindings | |
135 @cindex keybindings | |
136 | |
137 These keybindings are common across all modes: | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
138 |
32674 | 139 @table @kbd |
140 @item delete, SPC | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
141 @cindex scrolling in speedbar |
32674 | 142 Scroll up and down one page. |
143 @item Q | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
144 @cindex quitting speedbar |
32674 | 145 Quit speedbar, and kill the frame. |
146 @item q | |
147 Quit speedbar, and hide the frame. This makes it faster to restore the | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
148 speedbar frame, than if you press @kbd{Q}. |
32674 | 149 @item g |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
150 @cindex refresh speedbar display |
32674 | 151 Refresh whatever contents are in speedbar. |
152 @item t | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
153 @cindex slowbar mode |
32674 | 154 Toggle speedbar to and from slowbar mode. In slowbar mode, frame |
155 tracking is not done. | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
156 @item n |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
157 @itemx p |
32674 | 158 @cindex navigation |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
159 Move, respectively, to the next or previous item. A summary of that |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
160 item will be displayed in the attached frame's minibuffer. |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
161 @item M-n |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
162 @itemx M-p |
32674 | 163 Move to the next or previous item in a restricted fashion. If a list is |
164 open, the cursor will skip over it. If the cursor is in an open list, | |
165 it will not leave it. | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
166 @item C-M-n |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
167 @itemx C-M-n |
32674 | 168 Move forwards and backwards across extended groups. This lets you |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
169 quickly skip over all files, directories, or other common sub-items at |
32674 | 170 the same current depth. |
171 @item C-x b | |
172 Switch buffers in the attached frame. | |
173 @end table | |
174 | |
175 Speedbar can handle multiple modes. Two are provided by default. | |
176 These modes are File mode, and Buffers mode. There are accelerators to | |
177 switch into these different modes. | |
178 | |
179 @cindex mode switching hotkeys | |
180 @table @kbd | |
181 @item b | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
182 Switch into Quick Buffers mode (@pxref{Buffer Mode}). After one use, the |
32674 | 183 previous display mode is restored. |
184 @item f | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
185 Switch into File mode. |
32674 | 186 @item r |
187 Switch back to the previous mode. | |
188 @end table | |
189 | |
190 Some modes provide groups, lists and tags. @xref{Basic Visuals}. When | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
191 these are available, some additional common bindings are available. |
32674 | 192 |
193 @cindex common keys | |
194 @table @kbd | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
195 @item RET |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
196 @itemx e |
32674 | 197 Edit/Open the current group or tag. This behavior is dependent on the |
198 mode. In general, files or buffers are opened in the attached frame, | |
199 and directories or group nodes are expanded locally. | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
200 @item + |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
201 @itemx = |
32674 | 202 Expand the current group, displaying sub items. |
203 When used with a prefix argument, any data that may have been cached is | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
204 flushed. This is similar to a power click. @xref{Mouse Bindings}. |
32674 | 205 @item - |
206 Contract the current group, hiding sub items. | |
207 @end table | |
208 | |
209 @node Basic Visuals, Mouse Bindings, Basic Keybindings, Basic Navigation | |
210 @comment node-name, next, previous, up | |
211 @section Basic Visuals | |
212 @cindex visuals | |
213 | |
214 Speedbar has visual cues for indicating different types of data. These | |
215 cues are used consistently across the different speedbar modes to make | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
216 them easier to interpret. |
32674 | 217 |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
218 At a high level, in File mode, there are directory buttons, sub |
32674 | 219 directory buttons, file buttons, tag buttons, and expansion buttons. |
220 This makes it easy to use the mouse to navigate a directory tree, and | |
221 quickly view files, or a summary of those files. | |
222 | |
223 The most basic visual effect used to distinguis between these button | |
224 types is color and mouse highlighting. Anything the mouse highlights | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
225 can be clicked on and is called a button (@pxref{Mouse Bindings}). |
32674 | 226 Anything not highlighted by the mouse will not be clickable. |
227 | |
228 Text in speedbar consists of four different types of data. Knowing how | |
229 to read these textual elements will make it easier to navigate by | |
230 identifying the types of data available. | |
231 | |
232 @subsubsection Groups | |
233 @cindex groups | |
234 | |
235 Groups summarize information in a single line, and provide a high level | |
236 view of more complex systems, like a directory tree, or manual chapters. | |
237 | |
238 Groups appear at different indentation levels, and are prefixed with a | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
239 @samp{+} in some sort of "box". The group name will summarize the |
32674 | 240 information within it, and the expansion box will display that |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
241 information inline. In File mode, directories and files are "groups" |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
242 where the @samp{+} is surrounded by brackets like this: |
32674 | 243 |
244 @example | |
245 <+> include | |
246 <-> src | |
247 [+] foo.c | |
248 @end example | |
249 | |
250 In this example, we see both open and closed directories, in addition to | |
251 a file. The directories have a box consisting of angle brackets, and a | |
252 file uses square brackets. | |
253 | |
254 In all modes, a group can be "edited" by pressing @kbd{RET}, meaning a | |
255 file will be opened, or a directory explicitly opened in speedbar. A | |
256 group can be expanded or contracted using @kbd{+} or | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
257 @kbd{-}. @xref{Basic Keybindings}. |
32674 | 258 |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
259 Sometimes groups may have a @samp{?} in it's indicator box. This means |
32674 | 260 that it is a group type, but there are no contents, or no known way of |
261 extracting contents of that group. | |
262 | |
263 When a group has been expanded, the indicator button changes from | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
264 @samp{+} to @samp{-}. This indicates that the contents are being shown. |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
265 Click the @samp{-} button to contract the group, or hide the contents |
32674 | 266 currently displayed. |
267 | |
268 @subsubsection Tags | |
269 @cindex tags | |
270 | |
271 Tags are the leaf nodes of the tree system. Tags are generally prefixed | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
272 with a simple character, such as @samp{>}. Tags can only be jumped to using |
32674 | 273 @kbd{RET} or @kbd{e}. |
274 | |
275 @subsubsection Boolean Flags | |
276 | |
277 Sometimes a group or tag is given a boolean flag. These flags appear as | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
278 extra text characters at the end of the line. File mode uses boolean |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
279 flags, such as a @samp{*} to indicate that a file has been checked out |
32674 | 280 of a versioning system. |
281 | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
282 For additional flags, see |
32674 | 283 @c Note to self, update these to sub-nodes which are more relevant. |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
284 @ref{File Mode}, and @ref{Version Control}. |
32674 | 285 |
286 @subsubsection Unadorned Text | |
287 | |
288 Unadorned text generally starts in column 0, without any special symbols | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
289 prefixing them. In Buffers mode different buffer groups are prefixed |
32674 | 290 with a description of what the following buffers are (Files, scratch |
291 buffers, and invisible buffers.) | |
292 | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
293 Unadorned text will generally be colorless, and not clickable. |
32674 | 294 |
295 @subsubsection Color Cues | |
296 | |
297 Each type of Group, item indicator, and label is given a different | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
298 color. The colors chosen are dependent on whether the background color |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
299 is light or dark. |
32674 | 300 Of important note is that the "current item", which may be a buffer or |
301 file name, is highlighted red, and underlined. | |
302 | |
303 Colors can be customized from the group @code{speedbar-faces}. Some | |
304 modes, such as for Info, will use the Info colors instead of default | |
305 speedbar colors as an indication of what is currently being displayed. | |
306 | |
307 The face naming convention mirrors the File display mode. Modes which | |
308 do not use files will attempt to use the same colors on analogous | |
309 entries. | |
310 | |
311 @node Mouse Bindings, Displays Submenu, Basic Visuals, Basic Navigation | |
312 @comment node-name, next, previous, up | |
313 @section Mouse Bindings | |
314 @cindex mouse bindings | |
315 | |
316 The mouse has become a common information navigation tool. Speedbar | |
317 will use the mouse to navigate file systems, buffer lists, and other | |
318 data. The different textual cues provide buttons which can be clicked | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
319 on (@pxref{Basic Visuals}). Anything that highlights can be clicked on |
32674 | 320 with the mouse, or effected by the menu. |
321 | |
322 The mouse bindings are: | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
323 |
32674 | 324 @table @kbd |
325 @item mouse-1 | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
326 Move cursor to that location. |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
327 @item mouse-2 |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
328 @itemx double-mouse-1 |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
329 Activate the current button. @kbd{double-mouse-1} is called a @dfn{double |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
330 click} on other platforms, and is useful for windows users with two |
32674 | 331 button mice. |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
332 @c Isn't it true that with two-button mice, the right button is mouse-2? |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
333 @item S-mouse-2 |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
334 @itemx S-double-mouse-1 |
32674 | 335 @cindex power click |
336 This has the same effect as @kbd{mouse-2}, except it is called a power | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
337 click. This means that if a group with an expansion button @samp{+} is |
32674 | 338 clicked, any caches are flushed, and subitems re-read. If it is a name, |
339 it will be opened in a new frame. | |
340 @item mouse-3 | |
341 Activate the speedbar menu. The item selected effects the line clicked, | |
342 not the line where the cursor was. | |
343 @item mode-line mouse-1 | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
344 Activate the menu. This affects the item the cursor is on before the |
32674 | 345 click, since the mouse was not clicked on anything. |
346 @item C-mouse-1 | |
347 Buffers sub-menu. The buffer in the attached frame is switched. | |
348 @end table | |
349 | |
350 When the mouse moves over buttons in speedbar, details of that item | |
351 should be displayed in the minibuffer of the attached frame. Sometimes | |
352 this can contain extra information such as file permissions, or tag | |
353 location. | |
354 | |
355 @node Displays Submenu, , Mouse Bindings, Basic Navigation | |
356 @comment node-name, next, previous, up | |
357 @section Displays Submenu | |
358 @cindex displays submenu | |
359 | |
360 You can display different data by using different display modes. These | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
361 specialized modes make it easier to navigate the relevant pieces of |
32674 | 362 information, such as files and directories, or buffers. |
363 | |
364 In the main menu, found by clicking @kbd{mouse-3}, there is a submenu | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
365 labeled ``Displays''. This submenu lets you easily choose between |
32674 | 366 different display modes. |
367 | |
368 The contents are modes currently loaded into emacs. By default, this | |
369 would include Files, Quick Buffers, and Buffers. Other major display | |
370 modes such as Info are loaded separately. | |
371 | |
372 @node File Mode, Buffer Mode, Basic Navigation, Top | |
373 @comment node-name, next, previous, up | |
374 @chapter File Mode | |
375 @cindex file mode | |
376 | |
377 File mode displays a summary of your current directory. You can display | |
378 files in the attached frame, or summarize the tags found in files. You | |
379 can even see if a file is checked out of a version control system, or | |
380 has some associated object file. | |
381 | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
382 Advanced behavior, like copying and renaming files, is also provided. |
32674 | 383 |
384 @menu | |
385 * Directory Display:: What the display means. | |
386 * Hidden Files:: How to display hidden files. | |
387 * File Keybindings:: Performing file operations. | |
388 @end menu | |
389 | |
390 @node Directory Display, Hidden Files, File Mode, File Mode | |
391 @comment node-name, next, previous, up | |
392 @section Directory Display | |
393 @cindex directory display | |
394 | |
395 There are three major sections in the display. The first line or two is | |
396 the root directory speedbar is currently viewing. You can jump to one | |
397 of the parent directories by clicking on the name of the directory you | |
398 wish to jump to. | |
399 | |
400 Next, directories are listed. A directory starts with the group | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
401 indicator button @samp{<+>}. Clicking the directory name makes speedbar |
32674 | 402 load that directory as the root directory for its display. Clicking the |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
403 @samp{<+>} button will list all directories and files beneath. |
32674 | 404 |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
405 Next, files are listed. Files start with the group indicator @samp{[+]} |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
406 or @samp{[?]}. You can jump to a file in the attached frame by clicking |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
407 on the file name. You can expand a file and look at its tags by |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
408 clicking on the @samp{[+]} symbol near the file name. |
32674 | 409 |
410 A typical session might look like this: | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
411 |
32674 | 412 @example |
413 ~/lisp/ | |
414 <+> checkdoc | |
415 <+> eieio | |
416 <-> speedbar | |
417 [+] Makefile | |
418 [+] rpm.el # | |
419 [+] sb-gud.el # | |
420 [+] sb-info.el # | |
421 [+] sb-rmail.el # | |
422 [+] sb-w3.el | |
423 [-] speedbar.el *! | |
424 @{+@} Types | |
425 @{+@} Variables | |
426 @{+@} def (group) | |
427 @{+@} speedbar- | |
428 [+] speedbar.texi * | |
429 <+> testme | |
430 [+] align.el | |
431 [+] autoconf.el | |
432 @end example | |
433 | |
434 In this example, you can see several directories. The directory | |
435 @file{speedbar} has been opened inline. Inside the directory | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
436 @file{speedbar}, the file @file{speedbar.el} has its tags exposed. |
32674 | 437 These tags are extensive, and they are summarized into tag groups. |
438 | |
439 Files get additional boolean flags associated with them. Valid flags are: | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
440 |
32674 | 441 @cindex file flags |
442 @table @code | |
443 @item * | |
444 This file has been checked out of a version control | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
445 system. @xref{Version Control}. |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
446 @cindex @code{speedbar-obj-alist} |
32674 | 447 @item # |
448 This file has an up to date object file associated with it. The | |
449 variable @code{speedbar-obj-alist} defines how speedbar determines this | |
450 value. | |
451 @item ! | |
452 This file has an out of date object file associated with it. | |
453 @end table | |
454 | |
455 A Tag group is prefixed with the symbol @samp{@{+@}}. Clicking this | |
456 symbol will show all symbols that have been organized into that group. | |
457 Different types of files have unique tagging methods as defined by their | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
458 major mode. Tags are generated with either the @code{imenu} package, or |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
459 through the @code{etags} interface. |
32674 | 460 |
461 Tag groups are defined in multiple ways which make it easier to find the | |
462 tag you are looking for. Imenu keywords explicitly create groups, and | |
463 speedbar will automatically create groups if tag lists are too long. | |
464 | |
465 In our example, Imenu created the groups @samp{Types} and | |
466 @samp{Variables}. All remaining top-level symbols are then regrouped | |
467 based on the variable @code{speedbar-tag-hierarchy-method}. The | |
468 subgroups @samp{def} and @samp{speedbar-} are groupings where the first | |
469 few characters of the given symbols are specified in the group name. | |
470 Some group names may say something like @samp{speedbar-t to speedbar-v}, | |
471 indicating that all symbols which alphabetically fall between those | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
472 catagories are included in that sub-group. @xref{Tag Hierarchy Methods}. |
32674 | 473 |
474 @node Hidden Files, File Keybindings, Directory Display, File Mode | |
475 @comment node-name, next, previous, up | |
476 @section Hidden Files | |
477 @cindex hidden files | |
478 | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
479 On Unix, a hidden file is a file whose name starts with a period. They |
32674 | 480 are hidden from a regular directory listing because the user is not |
481 generally interested in them. | |
482 | |
483 In speedbar, a hidden file is a file which isn't very interesting and | |
484 might prove distracting to the user. Any uninteresting files are | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
485 removed from the File display. There are two levels of uninterest in |
32674 | 486 speedbar. The first level of uninterest are files which have no |
487 expansion method, or way of extracting tags. The second level is any | |
488 file that matches the same pattern used for completion in | |
489 @code{find-file}. This is derived from the variable | |
490 @code{completion-ignored-extensions}. | |
491 | |
492 You can toggle the display of uninteresting files from the toggle menu | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
493 item @samp{Show All Files}. This will display all level one hidden files. |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
494 These files will be shown with a @samp{?} indicator. Level 2 hidden |
32674 | 495 files will still not be shown. |
496 | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
497 Object files fall into the category of level 2 hidden files. You can |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
498 determine their presence by the @samp{#} and @samp{!} file indicators. |
32674 | 499 @xref{Directory Display}. |
500 | |
501 @node File Keybindings, , Hidden Files, File Mode | |
502 @comment node-name, next, previous, up | |
503 @section File Keybindings | |
504 @cindex file keybindings | |
505 | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
506 File mode has keybindings permitting different file system operations |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
507 such as copy or rename. These commands all operate on the @dfn{current |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
508 file}. In this case, the current file is the file at point, or clicked |
32674 | 509 on when pulling up the menu. |
510 | |
511 @table @kbd | |
512 @item U | |
513 Move the entire speedbar display up one directory. | |
514 @item I | |
515 Display information in the minibuffer about this line. This is the same | |
516 information shown when navigating with @kbd{n} and @kbd{p}, or moving | |
517 the mouse over an item. | |
518 @item B | |
519 Byte compile the Emacs Lisp file on this line. | |
520 @item L | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
521 Load the Emacs Lisp file on this line. If a @file{.elc} file exists, |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
522 optionally load that. |
32674 | 523 @item C |
524 Copy the current file to some other location. | |
525 @item R | |
526 Rename the current file, possibly moving it to some other location. | |
527 @item D | |
528 Delete the current file. | |
529 @item O | |
530 Delete the current file's object file. Use the symbols @samp{#} and | |
531 @samp{!} to determine if there is an object file available. | |
532 @end table | |
533 | |
534 One menu item toggles the display of all available files. By default, | |
535 only files which Emacs understands, and knows how to convert into a tag | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
536 list, are shown. By showing all files, additional files such as text files are |
32674 | 537 also displayed, but they are prefixed with the @samp{[?]} symbol. This |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
538 means that it is a file, but Emacs doesn't know how to expand it. |
32674 | 539 |
540 @node Buffer Mode, Minor Modes, File Mode, Top | |
541 @comment node-name, next, previous, up | |
542 @chapter Buffer Mode | |
543 @cindex buffer mode | |
544 | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
545 Buffer mode is very similar to File mode, except that instead of |
32674 | 546 tracking the current directory and all files available there, the |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
547 current list of Emacs buffers is shown. |
32674 | 548 |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
549 These buffers can have their tags expanded in the same way as files, |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
550 and uses the same unknown file indicator (@pxref{File Mode}). |
32674 | 551 |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
552 Buffer mode does not have file operation bindings, but the following |
32674 | 553 buffer specific keybindings are available: |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
554 |
32674 | 555 @table @kbd |
556 @item k | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
557 Kill this buffer. Do not touch its file. |
32674 | 558 @item r |
559 Revert this buffer, reloading from disk. | |
560 @end table | |
561 | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
562 In addition to Buffer mode, there is also Quick Buffer mode. In fact, |
32674 | 563 Quick Buffers is bound to the @kbd{b} key. The only difference between |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
564 Buffers and Quick Buffers is that after one operation is performed |
32674 | 565 which effects the attached frame, the display is immediately reverted to |
566 the last displayed mode. | |
567 | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
568 Thus, if you are in File mode, and you need quick access to a buffer, |
32674 | 569 press @kbd{b}, click on the buffer you want, and speedbar will revert |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
570 back to File mode. |
32674 | 571 |
572 @node Minor Modes, Customizing, Buffer Mode, Top | |
573 @comment node-name, next, previous, up | |
574 @chapter Minor Display Modes | |
575 @cindex minor display modes | |
576 | |
577 For some buffers, a list of files and tags makes no sense. This could | |
578 be because files are not currently in reference (such as web pages), or | |
579 that the files you might be interested have special properties (such as | |
580 email folders.) | |
581 | |
582 In these cases, a minor display mode is needed. A minor display mode | |
583 will override any major display mode currently being displayed for the | |
584 duration of the specialized buffer's use. Minor display modes | |
585 will follow the general rules of their major counterparts in terms of | |
586 keybindings and visuals, but will have specialized behaviors. | |
587 | |
588 @menu | |
589 * RMAIL:: Managing folders in speedbar | |
590 * Info:: Browsing topics in speedbar | |
591 * GDB:: Managing the current stack trace in speedbar | |
592 @end menu | |
593 | |
594 @node RMAIL, Info, Minor Modes, Minor Modes | |
595 @comment node-name, next, previous, up | |
596 @section RMAIL | |
597 @cindex RMAIL | |
598 | |
599 When using RMAIL, speedbar will display two sections. The first is a | |
600 layer one reply button. Clicking here will initialize a reply buffer | |
601 showing only this email address in the @samp{To:} field. | |
602 | |
603 The second section lists all RMAIL folders in the same directory as your | |
604 main RMAIL folder. The general rule is that RMAIL folders always appear | |
605 in all caps, or numbers. It is possible to save mail in folders with | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
606 lower case letters, but there is no clean way of detecting such RMAIL folders |
32674 | 607 without opening them all. |
608 | |
609 Each folder can be visited by clicking the name. You can move mail from | |
610 the current RMAIL folder into a different folder by clicking the | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
611 @samp{<M>} button. The @samp{M} stands for Move. |
32674 | 612 |
613 In this way you can manage your existing RMAIL folders fairly easily | |
614 using the mouse. | |
615 | |
616 @node Info, GDB, RMAIL, Minor Modes | |
617 @comment node-name, next, previous, up | |
618 @section Info | |
619 @cindex Info | |
620 | |
621 When browsing Info files, all local relevant information is displayed in | |
622 the info buffer and a topical high-level view is provided in speedbar. | |
623 All top-level info nodes are shown in the speedbar frame, and can be | |
624 jumped to by clicking the name. | |
625 | |
626 You can open these nodes with the @samp{[+]} button to see what sub-topics | |
627 are available. Since these sub-topics are not examined until you click | |
628 the @samp{[+]} button, sometimes a @samp{[?]} will appear when you click on | |
629 a @samp{[+]}, indicating that there are no sub-topics. | |
630 | |
631 @node GDB, , Info, Minor Modes | |
632 @comment node-name, next, previous, up | |
633 @section GDB | |
634 @cindex gdb | |
635 @cindex gud | |
636 | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
637 If you are debugging an application with GDB in Emacs, speedbar can show |
32674 | 638 you the current stack when the current buffer is the @file{*gdb*} |
639 buffer. Usually, it will just report that there is no stack, but when | |
640 the application is stopped, the current stack will be shown. | |
641 | |
642 You can click on any stack element and gdb will move to that stack | |
643 level. You can then check variables local to that level at the GDB | |
644 prompt. | |
645 | |
646 This mode has the unfortunate side-effect of breaking GDB's repeat | |
647 feature when you hit @kbd{RET} since your previous command is overridden | |
648 with a stack fetching command. | |
649 | |
650 @node Customizing, Extending, Minor Modes, Top | |
651 @comment node-name, next, previous, up | |
652 @chapter Customizing | |
653 @cindex customizing | |
654 | |
655 Speedbar is highly customizable, with a plethora of control elements. | |
656 Since speedbar is so visual and reduces so much information, this is an | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
657 important aspect of its behavior. |
32674 | 658 |
659 In general, there are three custom groups you can use to quickly modify | |
660 speedbar's behavior. | |
661 | |
662 @table @code | |
663 @item speedbar | |
664 Basic speedbar behaviors. | |
665 @item speedbar-vc | |
666 Customizations regarding version control handling. | |
667 @item speedbar-faces | |
668 Customize speedbar's many colors and fonts. | |
669 @end table | |
670 | |
671 @menu | |
672 * Frames and Faces:: Visible behaviors. | |
673 * Tag Hierarchy Methods:: Customizing how tags are displayed. | |
674 * Version Control:: Adding new VC detection modes. | |
675 * Hooks:: The many hooks you can use. | |
676 @end menu | |
677 | |
678 @node Frames and Faces, Tag Hierarchy Methods, Customizing, Customizing | |
679 @comment node-name, next, previous, up | |
680 @section Frames and Faces | |
681 @cindex faces | |
682 @cindex frame parameters | |
683 | |
684 There are several faces speedbar generates to provide a consistent | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
685 color scheme across display types. You can customize these faces using |
32674 | 686 your favorite method. They are: |
687 | |
688 @table @asis | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
689 @cindex @code{speedbar-button-face} |
32674 | 690 @item speedbar-button-face |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
691 Face used on expand/contract buttons. |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
692 @cindex @code{speedbar-file-face} |
32674 | 693 @item speedbar-file-face |
694 Face used on Files. Should also be used on non-directory like nodes. | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
695 @cindex @code{speedbar-directory-face} |
32674 | 696 @item speedbar-directory-face |
697 Face used for directories, or nodes which consist of groups of other nodes. | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
698 @cindex @code{speedbar-tag-face} |
32674 | 699 @item speedbar-tag-face |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
700 Face used for tags in a file, or for leaf items. |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
701 @cindex @code{speedbar-selected-face} |
32674 | 702 @item speedbar-selected-face |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
703 Face used to highlight the selected item. This would be the current |
32674 | 704 file being edited. |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
705 @cindex @code{speedbar-highlight-face} |
32674 | 706 @item speedbar-highlight-face |
707 Face used when the mouse passes over a button. | |
708 @end table | |
709 | |
710 You can also customize speedbar's initial frame parameters. How this is | |
711 accomplished is dependent on your platform being Emacs or XEmacs. | |
712 | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
713 @cindex @code{speedbar-frame-parameters}, Emacs |
32674 | 714 In Emacs, change the alist @code{speedbar-frame-parameters}. This |
715 variable is used to set up initial details. Height is also | |
716 automatically added when speedbar is created, though you can override | |
717 it. | |
718 | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
719 @cindex @code{speedbar-frame-plist}, XEmacs |
32674 | 720 In XEmacs, change the plist @code{speedbar-frame-plist}. This is the |
721 XEmacs way of doing the same thing. | |
722 | |
723 @node Tag Hierarchy Methods, Version Control, Frames and Faces, Customizing | |
724 @comment node-name, next, previous, up | |
725 @section Tag Hierarchy Methods | |
726 @cindex tag hierarchy | |
727 @cindex tag groups | |
728 @cindex tag sorting | |
729 | |
730 When listing tags within a file, it is possible to get an annoyingly | |
731 long list of entries. Imenu (which generates the tag list in Emacs) | |
732 will group some classes of items automatically. Even here, however, | |
733 some tag groups can be quite large. | |
734 | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
735 @cindex @code{speedbar-tag-hierarchy-method} |
32674 | 736 To solve this problem, tags can be grouped into logical units through a |
737 hierarchy processor. The specific variable to use is | |
738 @code{speedbar-tag-hierarchy-method}. There are several methods that | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
739 can be applied in any order. They are: |
32674 | 740 |
741 @table @code | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
742 @cindex @code{speedbar-trim-words-tag-hierarchy} |
32674 | 743 @item speedbar-trim-words-tag-hierarchy |
744 Find a common prefix for all elements of a group, and trim it off. | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
745 @cindex @code{speedbar-prefix-group-tag-hierarchy} |
32674 | 746 @item speedbar-prefix-group-tag-hierarchy |
747 If a group is too large, place sets of tags into bins based on common | |
748 prefixes. | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
749 @cindex @code{speedbar-simple-group-tag-hierarchy} |
32674 | 750 @item speedbar-simple-group-tag-hierarchy |
751 Take all items in the top level list not in a group, and stick them into | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
752 a @samp{Tags} group. |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
753 @cindex @code{speedbar-sort-tag-hierarchy} |
32674 | 754 @item speedbar-sort-tag-hierarchy |
755 Sort all items, leaving groups on top. | |
756 @end table | |
757 | |
758 You can also add your own functions to reorganize tags as you see fit. | |
759 | |
760 Some other control variables are: | |
761 | |
762 @table @code | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
763 @cindex @code{speedbar-tag-group-name-minimum-length} |
32674 | 764 @item speedbar-tag-group-name-minimum-length |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
765 Default value: 4. |
32674 | 766 |
767 The minimum length of a prefix group name before expanding. Thus, if | |
768 the @code{speedbar-tag-hierarchy-method} includes | |
769 @code{speedbar-prefix-group-tag-hierarchy} and one such group's common | |
770 characters is less than this number of characters, then the group name | |
771 will be changed to the form of: | |
772 | |
773 @example | |
774 worda to wordb | |
775 @end example | |
776 | |
777 instead of just | |
778 | |
779 @example | |
780 word | |
781 @end example | |
782 | |
783 This way we won't get silly looking listings. | |
784 | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
785 @cindex @code{speedbar-tag-split-minimum-length} |
32674 | 786 @item speedbar-tag-split-minimum-length |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
787 Default value: 20. |
32674 | 788 |
789 Minimum length before we stop trying to create sub-lists in tags. | |
790 This is used by all tag-hierarchy methods that break large lists into | |
791 sub-lists. | |
792 | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
793 @cindex @code{speedbar-tag-regroup-maximum-length} |
32674 | 794 @item speedbar-tag-regroup-maximum-length |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
795 Default value: 10. |
32674 | 796 |
797 Maximum length of submenus that are regrouped. | |
798 If the regrouping option is used, then if two or more short subgroups | |
799 are next to each other, then they are combined until this number of | |
800 items is reached. | |
801 @end table | |
802 | |
803 @node Version Control, Hooks, Tag Hierarchy Methods, Customizing | |
804 @comment node-name, next, previous, up | |
805 @section Version Control | |
806 @cindex version control | |
807 @cindex vc extensions | |
808 | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
809 When using the file mode in speedbar, information regarding a version |
32674 | 810 control system adds small details to the display. If a file is in a |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
811 version control system, and is ``checked out'', or ``locked'' locally, an |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
812 asterisk @samp{*} is placed at the end of the file name. In addition, |
32674 | 813 the directory name for Version Control systems are left out of the |
814 speedbar display. | |
815 | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
816 @cindex @code{speedbar-directory-unshown-regexp} |
32674 | 817 You can easily add new version control systems into speedbar's detection |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
818 scheme. To make a directory ``disappear'' from the list, use the variable |
32674 | 819 @code{speedbar-directory-unshown-regexp}. |
820 | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
821 @cindex @code{speedbar-vc-path-enable-hook} |
32674 | 822 Next, you need to write entries for two hooks. The first is |
823 @code{speedbar-vc-path-enable-hook} which will enable a VC check in the | |
824 current directory for the group of files being checked. Your hook | |
825 function should take one parameter (the directory to check) and return | |
826 @code{t} if your VC method is in control here. | |
827 | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
828 @cindex @code{speedbar-vc-in-control-hook} |
32674 | 829 The second function is @code{speedbar-vc-in-control-hook}. This hook |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
830 takes two parameters, the @var{path} of the file to check, and the |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
831 @var{file} name. Return @code{t} if you want to have the asterisk |
32674 | 832 placed near this file. |
833 | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
834 @cindex @code{speedbar-vc-indicator} |
32674 | 835 Lastly, you can change the VC indicator using the variable |
836 @code{speedbar-vc-indicator}, and specify a single character string. | |
837 | |
838 @node Hooks, , Version Control, Customizing | |
839 @comment node-name, next, previous, up | |
840 @section Hooks | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
841 @cindex hooks |
32674 | 842 |
843 There are several hooks in speedbar allowing custom behaviors to be | |
844 added. Available hooks are: | |
845 | |
846 @table @code | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
847 @cindex @code{speedbar-visiting-file-hook} |
32674 | 848 @item speedbar-visiting-file-hook |
849 Hooks run when speedbar visits a file in the selected frame. | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
850 @cindex @code{speedbar-visiting-tag-hook} |
32674 | 851 @item speedbar-visiting-tag-hook |
852 Hooks run when speedbar visits a tag in the selected frame. | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
853 @cindex @code{speedbar-load-hook} |
32674 | 854 @item speedbar-load-hook |
855 Hooks run when speedbar is loaded. | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
856 @cindex @code{speedbar-reconfigure-keymaps-hook} |
32674 | 857 @item speedbar-reconfigure-keymaps-hook |
858 Hooks run when the keymaps are regenerated. Keymaps are reconfigured | |
859 whenever modes change. This will let you add custom keybindings. | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
860 @cindex @code{speedbar-before-popup-hook} |
32674 | 861 @item speedbar-before-popup-hook |
862 Hooks called before popping up the speedbar frame. | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
863 New frames are often popped up when ``power clicking'' on an item to view |
32674 | 864 it. |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
865 @cindex @code{speedbar-before-delete-hook} |
32674 | 866 @item speedbar-before-delete-hook |
867 Hooks called before deleting or hiding the speedbar frame. | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
868 @cindex @code{speedbar-mode-hook} |
32674 | 869 @item speedbar-mode-hook |
870 Hooks called after creating a speedbar buffer. | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
871 @cindex @code{speedbar-timer-hook} |
32674 | 872 @item speedbar-timer-hook |
873 Hooks called after running the speedbar timer function. | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
874 @cindex @code{speedbar-scanner-reset-hook} |
32674 | 875 @item speedbar-scanner-reset-hook |
876 Hook called whenever generic scanners are reset. | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
877 Set this to implement your own scanning or rescan safe functions with |
32674 | 878 state data. |
879 @end table | |
880 | |
881 @node Extending, Index, Customizing, Top | |
882 @comment node-name, next, previous, up | |
883 @chapter Extending | |
884 @cindex extending | |
885 | |
886 Speedbar can run different types of Major display modes such as Files | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
887 (@pxref{File Mode}), and Buffers (@pxref{Buffer Mode}). It can also manage |
32674 | 888 different minor display modes for use with buffers handling specialized |
889 data. | |
890 | |
891 These major and minor display modes are handled through an extension | |
892 system which permits specialized keymaps and menu extensions, in | |
893 addition to a unique rendering function. You can also specify a wide | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
894 range of tagging functions. The default uses @code{imenu}, but new |
32674 | 895 tagginging methods can be easilly added. In this chapter, you will |
896 learn how to write your own major or minor display modes, and how to | |
897 create specialized tagging functions. | |
898 | |
899 @menu | |
900 * Minor Display Modes:: How to create a minor display mode. | |
901 * Major Display Modes:: How to create a major display mode. | |
902 * Tagging Extentions:: How to create your own tagging methods. | |
903 * Creating a display:: How to insert buttons and hierarchies. | |
904 @end menu | |
905 | |
906 @node Minor Display Modes, Major Display Modes, Extending, Extending | |
907 @section Minor Display Modes | |
908 @cindex create minor display mode | |
909 | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
910 A @dfn{minor display mode} is a mode useful when using a specific type of |
32674 | 911 buffer. This mode might not be useful for any other kind of data or |
912 mode, or may just be more useful that a files or buffers based mode when | |
913 working with a specialized mode. | |
914 | |
915 Examples that already exist for speedbar include RMAIL, Info, and gdb. | |
916 These modes display information specific to the major mode shown in the | |
917 attached frame. | |
918 | |
919 To enable a minor display mode in your favorite Major mode, follow these | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
920 steps. The string @samp{@var{name}} is the name of the major mode being |
32674 | 921 augmented with speedbar. |
922 | |
923 @enumerate | |
924 @item | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
925 Create the keymap variable @code{@var{name}-speedbar-key-map}. |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
926 |
32674 | 927 @item |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
928 Create a function, named whatever you like, which assigns values into your |
32674 | 929 keymap. Use this command to create the keymap before assigning |
930 bindings: | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
931 |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
932 @smallexample |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
933 (setq @var{name}-speedbar-key-map (speedbar-make-specialized-keymap)) |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
934 @end smallexample |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
935 |
32674 | 936 This function creates a special keymap for use in speedbar. |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
937 |
32674 | 938 @item |
939 Call your install function, or assign it to a hook like this: | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
940 |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
941 @smallexample |
32674 | 942 (if (featurep 'speedbar) |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
943 (@var{name}-install-speedbar-variables) |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
944 (add-hook 'speedbar-load-hook '@var{name}-install-speedbar-variables)) |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
945 @end smallexample |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
946 |
32674 | 947 @item |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
948 Create an easymenu compatible vector named |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
949 @code{@var{name}-speedbar-menu-items}. This will be spliced into |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
950 speedbar's control menu. |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
951 |
32674 | 952 @item |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
953 Create a function called @code{@var{name}-speedbar-buttons}. This function |
32674 | 954 should take one variable, which is the buffer for which it will create |
955 buttons. At this time @code{(current-buffer)} will point to the | |
956 uncleared speedbar buffer. | |
957 @end enumerate | |
958 | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
959 When writing @code{@var{name}-speedbar-buttons}, the first thing you will |
32674 | 960 want to do is execute a check to see if you need to re-create your |
961 display. If it needs to be cleared, you need to erase the speedbar | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
962 buffer yourself, and start drawing buttons. @xref{Creating a display}. |
32674 | 963 |
964 @node Major Display Modes, Tagging Extentions, Minor Display Modes, Extending | |
965 @section Major Display Modes | |
966 @cindex create major display mode | |
967 | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
968 Creating a @dfn{Major Display Mode} for speedbar requires authoring a keymap, |
32674 | 969 an easy-menu segment, and writing several functions. These items can be |
970 given any name, and are made the same way as in a minor display mode | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
971 (@pxref{Minor Display Modes}). Once this is done, these items need to be |
32674 | 972 registered. |
973 | |
974 Because this setup activity may or may not have speedbar available when | |
975 it is being loaded, it is necessary to create an install function. This | |
976 function should create and initialize the keymap, and add your | |
977 expansions into the customization tables. | |
978 | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
979 @cindex @code{speedbar-make-specialized-keymap} |
32674 | 980 When creating the keymap, use the function |
981 @code{speedbar-make-specialized-keymap} instead of other keymap making | |
982 functions. This will provide you with the initial bindings needed. | |
983 Some common speedbar functions you might want to bind are: | |
984 | |
985 @table @code | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
986 @cindex @code{speedbar-edit-line} |
32674 | 987 @item speedbar-edit-line |
988 Edit the item on the current line. | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
989 @cindex @code{speedbar-expand-line} |
32674 | 990 @item speedbar-expand-line |
991 Expand the item under the cursor. | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
992 With a numeric argument (@kbd{C-u}), flush cached data before expanding. |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
993 @cindex @code{speedbar-contract-line} |
32674 | 994 @item speedbar-contract-line |
995 Contract the item under the cursor. | |
996 @end table | |
997 | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
998 @cindex @code{speedbar-line-path} |
32674 | 999 These function require that function @code{speedbar-line-path} be |
1000 correctly overloaded to work. | |
1001 | |
1002 Next, register your extension like this; | |
1003 | |
1004 @example | |
1005 (speedbar-add-expansion-list '("MyExtension" | |
1006 MyExtension-speedbar-menu-items | |
1007 MyExtension-speedbar-key-map | |
1008 MyExtension-speedbar-buttons)) | |
1009 @end example | |
1010 | |
1011 There are no limitations to the names you use. | |
1012 | |
1013 The first parameter is the string representing your display mode. | |
1014 The second parameter is a variable name containing an easymenu compatible | |
1015 menu definition. This will be stuck in the middle of speedbar's menu. | |
1016 The third parameter is the variable name containing the keymap we | |
1017 discussed earlier. | |
1018 The last parameter is a function which draws buttons for your mode. | |
1019 This function must take two parameters. The directory currently being | |
1020 displayed, and the depth at which you should start rendering buttons. | |
1021 The function will then draw (starting at the current cursor position) | |
1022 any buttons deemed necessary based on the input parameters. | |
1023 @xref{Creating a display}. | |
1024 | |
1025 Next, you need to register function overrides. This may look something | |
1026 like this: | |
1027 | |
1028 @example | |
1029 (speedbar-add-mode-functions-list | |
1030 '("MYEXTENSION" | |
1031 (speedbar-item-info . MyExtension-speedbar-item-info) | |
1032 (speedbar-line-path . MyExtension-speedbar-line-path))) | |
1033 @end example | |
1034 | |
1035 The first element in the list is the name of you extension. The second | |
1036 is an alist of functions to overload. The function to overload is | |
1037 first, followed by what you want called instead. | |
1038 | |
1039 For @code{speedbar-line-path} your function should take an optional DEPTH | |
1040 parameter. This is the starting depth for heavily indented lines. If | |
1041 it is not provided, you can derive it like this: | |
1042 | |
1043 @example | |
1044 (save-match-data | |
1045 (if (not depth) | |
1046 (progn | |
1047 (beginning-of-line) | |
1048 (looking-at "^\\([0-9]+\\):") | |
1049 (setq depth (string-to-int (match-string 1))))) | |
1050 @end example | |
1051 | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
1052 @noindent |
32674 | 1053 where the depth is stored as invisible text at the beginning of each |
1054 line. | |
1055 | |
1056 The path returned should be the full path name of the file associated | |
1057 with that line. If the cursor is on a tag, then the file containing | |
1058 that tag should be returned. This is critical for built in file based | |
1059 functions to work (meaning less code for you to write). If your display | |
1060 does not deal in files, you do not need to overload this function. | |
1061 | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
1062 @cindex @code{speedbar-item-info} |
32674 | 1063 The function @code{speedbar-item-info}, however, is very likely to need |
1064 overloading. This function takes no parameters and must derive a text | |
1065 summary to display in the minibuffer. | |
1066 | |
1067 There are several helper functions you can use if you are going to use | |
1068 built in tagging. These functions can be @code{or}ed since each one | |
1069 returns non-nil if it displays a message. They are: | |
1070 | |
1071 @table @code | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
1072 @cindex @code{speedbar-item-info-file-helper} |
32674 | 1073 @item speedbar-item-info-file-helper |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
1074 This takes an optional @var{filename} parameter. You can derive your own |
32674 | 1075 filename, or it will derive it using a (possibly overloaded) function |
1076 @code{speedbar-line-file}. It shows details about a file. | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
1077 @cindex @code{speedbar-item-info-tag-helper} |
32674 | 1078 @item speedbar-item-info-tag-helper |
1079 If the current line is a tag, then display information about that tag, | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
1080 such as its parent file, and location. |
32674 | 1081 @end table |
1082 | |
1083 Your custom function might look like this: | |
1084 | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
1085 @example |
32674 | 1086 (defun MyExtension-item-info () |
1087 "Display information about the current line." | |
1088 (or (speedbar-item-info-tag-helper) | |
1089 (message "Interesting detail."))) | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
1090 @end example |
32674 | 1091 |
1092 Once you have done all this, speedbar will show an entry in the | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
1093 @samp{Displays} menu declaring that your extension is available. |
32674 | 1094 |
1095 @node Tagging Extentions, Creating a display, Major Display Modes, Extending | |
1096 @section Tagging Extentions | |
1097 | |
1098 It is possible to create new methods for tagging files in speedbar. | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
1099 To do this, you need two basic functions, one function to fetch the |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
1100 tags from a buffer, the other to insert them below the filename. |
32674 | 1101 |
1102 @defun my-fetch-dynamic-tags file | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
1103 Parse @var{file} for a list of tags. Return the list, or @code{t} if there was |
32674 | 1104 an error. |
1105 @end defun | |
1106 | |
1107 The non-error return value can be anything, as long as it can be | |
1108 inserted by it's paired function: | |
1109 | |
1110 @defun my-insert-tag-list level lst | |
1111 Insert a list of tags @var{lst} started at indentation level | |
1112 @var{level}. Creates buttons for each tag, and provides any other | |
1113 display information requried. | |
1114 @end defun | |
1115 | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
1116 @cindex @code{speedbar-create-tag-hierarchy} |
32674 | 1117 It is often useful to use @code{speedbar-create-tag-hierarchy} on your |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
1118 token list. See that function's documentation for details on what it |
32674 | 1119 requires. |
1120 | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
1121 @cindex @code{speedbar-dynamic-tags-function-list} |
32674 | 1122 Once these two functions are written, modify the variable |
1123 @code{speedbar-dynamic-tags-function-list} to include your parser at the | |
1124 beginning, like this: | |
1125 | |
1126 @example | |
1127 (add-to-list 'speedbar-dynamic-tags-function-list | |
1128 '(my-fetch-dynamic-tags . my-insert-tag-list)) | |
1129 @end example | |
1130 | |
1131 If your parser is only good for a few types of files, make sure that it | |
1132 is either a buffer local modification, or that the tag generator returns | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
1133 @code{t} for non valid buffers. |
32674 | 1134 |
1135 @node Creating a display, , Tagging Extentions, Extending | |
1136 @section Creating a display | |
1137 @cindex creating a display | |
1138 | |
1139 Rendering a display in speedbar is completely flexible. When your | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
1140 button function is called, see @ref{Minor Display Modes}, and @ref{Major |
32674 | 1141 Display Modes}, you have control to @code{insert} anything you want. |
1142 | |
1143 The conventions allow almost anything to be inserted, but several helper | |
1144 functions are provided to make it easy to create the standardized | |
1145 buttons. | |
1146 | |
1147 To understand the built in functions, each "button" in speedbar consists | |
1148 of four important pieces of data. The text to be displayed, token | |
1149 data to be associated with the text, a function to call, and some face to | |
1150 display it in. | |
1151 | |
1152 When a function is provided, then that text becomes mouse activated, | |
1153 meaning the mouse will highlight the text. | |
1154 | |
1155 Additionally, for data which can form deep trees, each line is given a | |
1156 depth which indicates how far down the tree it is. This information is | |
1157 stored in invisible text at the beginning of each line, and is used by | |
1158 the navigation commands. | |
1159 | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
1160 @defun speedbar-insert-button text face mouse function &optional token prevline |
32674 | 1161 This function inserts one button into the current location. |
1162 @var{text} is the text to insert. @var{face} is the face in which it | |
1163 will be displayed. @var{mouse} is the face to display over the text | |
1164 when the mouse passes over it. @var{function} is called whenever the | |
1165 user clicks on the text. | |
1166 | |
1167 The optional argument @var{token} is extra data to associated with the | |
1168 text. Lastly @var{prevline} should be non-nil if you want this line to | |
1169 appear directly after the last button which was created instead of on | |
1170 the next line. | |
1171 @end defun | |
1172 | |
1173 @defun speedbar-make-tag-line exp-button-type exp-button-char exp-button-function exp-button-data tag-button tag-button-function tag-button-data tag-button-face depth | |
1174 | |
1175 Create a tag line with @var{exp-button-type} for the small expansion | |
1176 button. This is the button that expands or contracts a node (if | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
1177 applicable), and @var{exp-button-char} the character in it (@samp{+}, |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
1178 @samp{-}, @samp{?}, |
32674 | 1179 etc). @var{exp-button-function} is the function to call if it's clicked |
1180 on. Button types are @code{'bracket}, @code{'angle}, @code{'curly}, | |
1181 @code{'expandtag}, @code{'statictag}, or nil. @var{exp-button-data} is | |
1182 extra data attached to the text forming the expansion button. | |
1183 | |
1184 Next, @var{tag-button} is the text of the tag. | |
1185 @var{tag-button-function} is the function to call if clicked on, and | |
1186 @var{tag-button-data} is the data to attach to the text field (such a | |
1187 tag positioning, etc). @var{tag-button-face} is a face used for this | |
1188 type of tag. | |
1189 | |
1190 Lastly, @var{depth} shows the depth of expansion. | |
1191 | |
1192 This function assumes that the cursor is in the speedbar window at the | |
1193 position to insert a new item, and that the new item will end with a CR | |
1194 @end defun | |
1195 | |
1196 @defun speedbar-insert-generic-list level list expand-fun find-fun | |
1197 | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
1198 At @var{level}, (the current indentation level desired) insert a generic |
32674 | 1199 multi-level alist @var{list}. Associations with lists get @samp{@{+@}} |
1200 tags (to expand into more nodes) and those with positions or other data | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
1201 just get a @samp{>} as the indicator. @samp{@{+@}} buttons will have the |
32674 | 1202 function @var{expand-fun} and the token is the @code{cdr} list. The |
1203 token name will have the function @var{find-fun} and not token. | |
1204 | |
1205 Each element of the list can have one of these forms: | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
1206 |
32674 | 1207 @table @code |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
1208 @item (@var{name} . marker-or-number) |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
1209 One tag at this level. |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
1210 @item (@var{name} (@var{name} . marker-or-number) (@var{name} . marker-or-number) ... ) |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
1211 One group of tags. |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
1212 @item (@var{name} marker-or-number (@var{name} . marker-or-number) ... ) |
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
1213 One Group of tags where the group has a starting position. |
32674 | 1214 @end table |
1215 | |
1216 When you use @code{speedbar-insert-generic-list}, there are some | |
1217 variables you can set buffer-locally to change the behavior. The most | |
1218 obvious is @code{speedbar-tag-hierarchy-method}. | |
1219 @xref{Tag Hierarchy Methods}. | |
1220 | |
1221 @defvar speedbar-generic-list-group-expand-button-type | |
32702
788c194fbcd1
Correct typos, fix markup, add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
32674
diff
changeset
|
1222 This is the button type used for groups of tags, whether expanded |
32674 | 1223 or added in via a hierarchy method. Two good values are |
1224 @code{'curly} and @code{'expandtag}. Curly is the default button, and | |
1225 @code{'expandtag} is useful if the groups also has a position. | |
1226 @end defvar | |
1227 | |
1228 @defvar speedbar-generic-list-tag-button-type | |
1229 This is the button type used for a single tag. | |
1230 Two good values are @code{nil} and @code{'statictag}. | |
1231 @code{nil} is the default, and @code{'statictag} has the same width as | |
1232 @code{'expandtag}. | |
1233 @end defvar | |
1234 | |
1235 @end defun | |
1236 | |
1237 @node Index, , Extending, Top | |
1238 @comment node-name, next, previous, up | |
1239 @unnumbered Concept Index | |
1240 @printindex cp | |
1241 | |
1242 @bye | |
1243 @c LocalWords: speedbar's xref Keybindings slowbar kbd subsubsection | |
1244 @c LocalWords: keybindings |