# HG changeset patch # User Eli Zaretskii # Date 972080626 0 # Node ID 788c194fbcd1ebd7ab731b6404bc748309b0b734 # Parent a533149c0450c4a7dbaf020faa806df74ea5e70f Correct typos, fix markup, add index entries. diff -r a533149c0450 -r 788c194fbcd1 man/speedbar.texi --- a/man/speedbar.texi Fri Oct 20 19:14:07 2000 +0000 +++ b/man/speedbar.texi Fri Oct 20 22:23:46 2000 +0000 @@ -1,6 +1,6 @@ \input texinfo @c -*-texinfo-*- @c -@c $Id$ +@c $Id: speedbar.texi,v 1.1 2000/10/20 01:53:35 zappo Exp $ @c @c This file is part of GNU Emacs @@ -37,6 +37,8 @@ Copyright @copyright{} 1999, 2000 Eric M. Ludlam @end titlepage +@syncodeindex fn cp + @node Top, , , (dir)Top @comment node-name, next, previous, up @@ -58,23 +60,23 @@ is highlighted. Speedbar also mimics the explorer windows by providing multiple display modes. These modes come in two flavors. Major display modes remain consistent across buffers, and minor display modes appear -only when a buffer of the applicable type is shown. This provides +only when a buffer of the applicable type is shown. This allows authors of other packages to provide speedbar summaries customized to the needs of that mode. Throughout this manual, activities are defined as "clicking on", or "expanding" items. Clicking means using using @kbd{mouse-2} on a button. Expanding refers to clicking on an expansion button to display -an expanded summary of the entry the exapansion button is -on. @xref{Basic Navigation}. +an expanded summary of the entry the expansion button is +on. @xref{Basic Navigation}. @menu * Introduction:: Basics of speedbar. * Basic Navigation:: Basics of speedbar common between all modes. -* File Mode:: Summerizing files. -* Buffer Mode:: Summerizing buffers. +* File Mode:: Summarizing files. +* Buffer Mode:: Summarizing buffers. * Minor Modes:: Additional minor modes such as Info and RMAIL. -* Customizing:: Changing speedbar behaviors. +* Customizing:: Changing speedbar behavior. * Extending:: Extend speedbar for your own project. * Index:: @end menu @@ -87,27 +89,29 @@ To start using speedbar use the command @kbd{M-x speedbar RET} or select it from the Tools menu in versions of Emacs with speedbar installed by default. This command will open a new frame to summarize the local -files. On X windows, or under Windows NT, speedbar's frame is twenty +files. On X Window systems or on MS-Windows, speedbar's frame is twenty characters wide, and will mimic the height of the frame from which it was started. It positions itself to the left or right of the frame you started it from. To use speedbar effectivly, it is important to understand its relationship with the frame you started it from. This frame is the -"attached frame" which speedbar will use as a reference point. Once -started speedbar will watch the contents of this frame, and attempts to +@dfn{attached frame} which speedbar will use as a reference point. Once +started, speedbar watches the contents of this frame, and attempts to make it's contents relevant to the buffer loaded into the attached frame. In addition, all requests made in speedbar that require the display of another buffer will display in the attached frame. When used in terminal mode, the new frame appears the same size as the terminal. Since it is not visible while working in the attached frame, -speedbar will save time by using "slowbar" mode, where no tracking is -done until speedbar is requested to show itself. +speedbar will save time by using the @dfn{slowbar mode}, where no tracking is +done until speedbar is requested to show itself (i.e., the speedbar's +frame becomes the selected frame). +@cindex @code{speedbar-get-focus} The function to use when switching between frames using the keyboard is @code{speedbar-get-focus}. This function will toggle between frames, and -useful to bind to a key in terminal mode @xref{Customizing}. +it's useful to bind it to a key in terminal mode. @xref{Customizing}. @node Basic Navigation, File Mode, Introduction, Top @comment node-name, next, previous, up @@ -131,34 +135,38 @@ @cindex keybindings These keybindings are common across all modes: + @table @kbd @item delete, SPC -@cindex scrolling +@cindex scrolling in speedbar Scroll up and down one page. @item Q -@cindex quitting +@cindex quitting speedbar Quit speedbar, and kill the frame. @item q Quit speedbar, and hide the frame. This makes it faster to restore the -speedbar frame. +speedbar frame, than if you press @kbd{Q}. @item g -@cindex refresh +@cindex refresh speedbar display Refresh whatever contents are in speedbar. @item t -@cindex slowbar +@cindex slowbar mode Toggle speedbar to and from slowbar mode. In slowbar mode, frame tracking is not done. -@item n, p +@item n +@itemx p @cindex navigation -Move to the next or previous item. A summary of that item will be -displayed in the attached frame's minibuffer. -@item M-n, M-p +Move, respectively, to the next or previous item. A summary of that +item will be displayed in the attached frame's minibuffer. +@item M-n +@itemx M-p Move to the next or previous item in a restricted fashion. If a list is open, the cursor will skip over it. If the cursor is in an open list, it will not leave it. -@item C-M-n, C-M-n +@item C-M-n +@itemx C-M-n Move forwards and backwards across extended groups. This lets you -quickly skip over all files, or directories, or other common sub-item at +quickly skip over all files, directories, or other common sub-items at the same current depth. @item C-x b Switch buffers in the attached frame. @@ -171,27 +179,29 @@ @cindex mode switching hotkeys @table @kbd @item b -Switch into Quick Buffers mode @xref{Buffer Mode}. After one use, the +Switch into Quick Buffers mode (@pxref{Buffer Mode}). After one use, the previous display mode is restored. @item f -Switch into Files mode. +Switch into File mode. @item r Switch back to the previous mode. @end table Some modes provide groups, lists and tags. @xref{Basic Visuals}. When -these are available some additional common bindings are available. +these are available, some additional common bindings are available. @cindex common keys @table @kbd -@item RET, e +@item RET +@itemx e Edit/Open the current group or tag. This behavior is dependent on the mode. In general, files or buffers are opened in the attached frame, and directories or group nodes are expanded locally. -@item +,= +@item + +@itemx = Expand the current group, displaying sub items. When used with a prefix argument, any data that may have been cached is -flushed. This is similar to a power click. @xref{Mouse Bindings}. +flushed. This is similar to a power click. @xref{Mouse Bindings}. @item - Contract the current group, hiding sub items. @end table @@ -203,16 +213,16 @@ Speedbar has visual cues for indicating different types of data. These cues are used consistently across the different speedbar modes to make -them easier to understand. +them easier to interpret. -At a high level, in Files mode, there are directory buttons, sub +At a high level, in File mode, there are directory buttons, sub directory buttons, file buttons, tag buttons, and expansion buttons. This makes it easy to use the mouse to navigate a directory tree, and quickly view files, or a summary of those files. The most basic visual effect used to distinguis between these button types is color and mouse highlighting. Anything the mouse highlights -can be clicked on and is called a button @xref{Mouse Bindings}. +can be clicked on and is called a button (@pxref{Mouse Bindings}). Anything not highlighted by the mouse will not be clickable. Text in speedbar consists of four different types of data. Knowing how @@ -226,10 +236,10 @@ view of more complex systems, like a directory tree, or manual chapters. Groups appear at different indentation levels, and are prefixed with a -@code{+} in some sort of "box". The group name will summarize the +@samp{+} in some sort of "box". The group name will summarize the information within it, and the expansion box will display that -information inline. In files mode, directories and files are "groups" -where the @code{+} is surrounded by brackets like this: +information inline. In File mode, directories and files are "groups" +where the @samp{+} is surrounded by brackets like this: @example <+> include @@ -244,48 +254,49 @@ In all modes, a group can be "edited" by pressing @kbd{RET}, meaning a file will be opened, or a directory explicitly opened in speedbar. A group can be expanded or contracted using @kbd{+} or -@kbd{-}. @xref{Basic Keybindings}. +@kbd{-}. @xref{Basic Keybindings}. -Sometimes groups may have a @code{?} in it's indicator box. This means +Sometimes groups may have a @samp{?} in it's indicator box. This means that it is a group type, but there are no contents, or no known way of extracting contents of that group. When a group has been expanded, the indicator button changes from -@code{+} to @code{-}. This indicates that the contents are being shown. -Click the @code{-} button to contract the group, or hide the contents +@samp{+} to @samp{-}. This indicates that the contents are being shown. +Click the @samp{-} button to contract the group, or hide the contents currently displayed. @subsubsection Tags @cindex tags Tags are the leaf nodes of the tree system. Tags are generally prefixed -with a simple character, such as @code{>}. Tags can only be jumped to using +with a simple character, such as @samp{>}. Tags can only be jumped to using @kbd{RET} or @kbd{e}. @subsubsection Boolean Flags Sometimes a group or tag is given a boolean flag. These flags appear as -extra text characters at the end of the line. Files mode uses boolean -flags, such as a @code{*} to indicate that a file has been checked out +extra text characters at the end of the line. File mode uses boolean +flags, such as a @samp{*} to indicate that a file has been checked out of a versioning system. -For additional flags, +For additional flags, see @c Note to self, update these to sub-nodes which are more relevant. -@xref{File Mode}, @xref{Version Control}. +@ref{File Mode}, and @ref{Version Control}. @subsubsection Unadorned Text Unadorned text generally starts in column 0, without any special symbols -prefixing them. In buffers mode different buffer groups are prefixed +prefixing them. In Buffers mode different buffer groups are prefixed with a description of what the following buffers are (Files, scratch buffers, and invisible buffers.) -Unadorned text will generally be colorless, and not be clickable. +Unadorned text will generally be colorless, and not clickable. @subsubsection Color Cues Each type of Group, item indicator, and label is given a different -color. The colors chosen are dependent on a light or dark background. +color. The colors chosen are dependent on whether the background color +is light or dark. Of important note is that the "current item", which may be a buffer or file name, is highlighted red, and underlined. @@ -305,28 +316,32 @@ The mouse has become a common information navigation tool. Speedbar will use the mouse to navigate file systems, buffer lists, and other data. The different textual cues provide buttons which can be clicked -on @xref{Basic Visuals}. Anything that highlights can be clicked on +on (@pxref{Basic Visuals}). Anything that highlights can be clicked on with the mouse, or effected by the menu. The mouse bindings are: + @table @kbd @item mouse-1 -Move cursor to that location -@item mouse-2, double-mouse-1 -Activate the current button. @kbd{double-mouse-1} is called a "double -click" on other platforms, and is useful for windows users with two +Move cursor to that location. +@item mouse-2 +@itemx double-mouse-1 +Activate the current button. @kbd{double-mouse-1} is called a @dfn{double +click} on other platforms, and is useful for windows users with two button mice. -@item SHIFT-mouse-2, SHIFT-double-mouse-1 +@c Isn't it true that with two-button mice, the right button is mouse-2? +@item S-mouse-2 +@itemx S-double-mouse-1 @cindex power click This has the same effect as @kbd{mouse-2}, except it is called a power -click. This means that if a group with an expansion button @code{+} is +click. This means that if a group with an expansion button @samp{+} is clicked, any caches are flushed, and subitems re-read. If it is a name, it will be opened in a new frame. @item mouse-3 Activate the speedbar menu. The item selected effects the line clicked, not the line where the cursor was. @item mode-line mouse-1 -Activate the menu. This effects the item the cursor is on before the +Activate the menu. This affects the item the cursor is on before the click, since the mouse was not clicked on anything. @item C-mouse-1 Buffers sub-menu. The buffer in the attached frame is switched. @@ -343,11 +358,11 @@ @cindex displays submenu You can display different data by using different display modes. These -specialized modes make it easier to navigate the relevent pieces of +specialized modes make it easier to navigate the relevant pieces of information, such as files and directories, or buffers. In the main menu, found by clicking @kbd{mouse-3}, there is a submenu -labeled "Displays". This submenu lets you easily choose between +labeled ``Displays''. This submenu lets you easily choose between different display modes. The contents are modes currently loaded into emacs. By default, this @@ -364,7 +379,7 @@ can even see if a file is checked out of a version control system, or has some associated object file. -Advanced behaviors, like copying and renaming files is also provided. +Advanced behavior, like copying and renaming files, is also provided. @menu * Directory Display:: What the display means. @@ -383,16 +398,17 @@ wish to jump to. Next, directories are listed. A directory starts with the group -indicator button @code{<+>}. Clicking the directory name makes speedbar +indicator button @samp{<+>}. Clicking the directory name makes speedbar load that directory as the root directory for its display. Clicking the -@code{<+>} button will list all directories and files beneath. +@samp{<+>} button will list all directories and files beneath. -Next, files are listed. Files start with the group indicator @code{[+]} -or @code{[?]}. You can jump to a file in the attached frame by clicking -on the file name. You can expand a file and look at it's tags by -clicking on the @code{[+]} symbol near the file name. +Next, files are listed. Files start with the group indicator @samp{[+]} +or @samp{[?]}. You can jump to a file in the attached frame by clicking +on the file name. You can expand a file and look at its tags by +clicking on the @samp{[+]} symbol near the file name. A typical session might look like this: + @example ~/lisp/ <+> checkdoc @@ -417,15 +433,17 @@ In this example, you can see several directories. The directory @file{speedbar} has been opened inline. Inside the directory -@file{speedbar}, the file @file{speedbar.el} has it's tags exposed. +@file{speedbar}, the file @file{speedbar.el} has its tags exposed. These tags are extensive, and they are summarized into tag groups. Files get additional boolean flags associated with them. Valid flags are: + @cindex file flags @table @code @item * This file has been checked out of a version control -system. @xref{Version Control}. +system. @xref{Version Control}. +@cindex @code{speedbar-obj-alist} @item # This file has an up to date object file associated with it. The variable @code{speedbar-obj-alist} defines how speedbar determines this @@ -437,8 +455,8 @@ A Tag group is prefixed with the symbol @samp{@{+@}}. Clicking this symbol will show all symbols that have been organized into that group. Different types of files have unique tagging methods as defined by their -major mode. Tags are generated with either the @file{imenu} package, or -through an @file{etags} interface. +major mode. Tags are generated with either the @code{imenu} package, or +through the @code{etags} interface. Tag groups are defined in multiple ways which make it easier to find the tag you are looking for. Imenu keywords explicitly create groups, and @@ -451,20 +469,20 @@ few characters of the given symbols are specified in the group name. Some group names may say something like @samp{speedbar-t to speedbar-v}, indicating that all symbols which alphabetically fall between those -catagories are included in that sub-group. @xref{Tag Hierarchy Methods}. +catagories are included in that sub-group. @xref{Tag Hierarchy Methods}. @node Hidden Files, File Keybindings, Directory Display, File Mode @comment node-name, next, previous, up @section Hidden Files @cindex hidden files -On unix, a hidden file is a file whose name starts with a period. They +On Unix, a hidden file is a file whose name starts with a period. They are hidden from a regular directory listing because the user is not generally interested in them. In speedbar, a hidden file is a file which isn't very interesting and might prove distracting to the user. Any uninteresting files are -removed from the File display. There are two levels of interest in +removed from the File display. There are two levels of uninterest in speedbar. The first level of uninterest are files which have no expansion method, or way of extracting tags. The second level is any file that matches the same pattern used for completion in @@ -472,12 +490,12 @@ @code{completion-ignored-extensions}. You can toggle the display of uninteresting files from the toggle menu -item "Show All Files". This will display all level one hidden files. -These files will be shown with a @code{?} indicator. Level 2 hidden +item @samp{Show All Files}. This will display all level one hidden files. +These files will be shown with a @samp{?} indicator. Level 2 hidden files will still not be shown. -Object files fall into the catagory of level 2 hidden files. You can -determine their presense by the @code{#} and @code{!} file indicators +Object files fall into the category of level 2 hidden files. You can +determine their presence by the @samp{#} and @samp{!} file indicators. @xref{Directory Display}. @node File Keybindings, , Hidden Files, File Mode @@ -485,9 +503,9 @@ @section File Keybindings @cindex file keybindings -Files mode has keybindings permitting different file system operations -such as copy or rename. These commands all operate on "the current -file." In this case, the current file is the file at point, or clicked +File mode has keybindings permitting different file system operations +such as copy or rename. These commands all operate on the @dfn{current +file}. In this case, the current file is the file at point, or clicked on when pulling up the menu. @table @kbd @@ -500,8 +518,8 @@ @item B Byte compile the Emacs Lisp file on this line. @item L -Load the Emacs Lisp file on this line. If an elc file exists, optionally load -that. +Load the Emacs Lisp file on this line. If a @file{.elc} file exists, +optionally load that. @item C Copy the current file to some other location. @item R @@ -515,40 +533,41 @@ One menu item toggles the display of all available files. By default, only files which Emacs understands, and knows how to convert into a tag -list. By showing all files, additional files such as text files are +list, are shown. By showing all files, additional files such as text files are also displayed, but they are prefixed with the @samp{[?]} symbol. This -means that it is a file, but that Emacs doesn't know how to expand it. +means that it is a file, but Emacs doesn't know how to expand it. @node Buffer Mode, Minor Modes, File Mode, Top @comment node-name, next, previous, up @chapter Buffer Mode @cindex buffer mode -Buffer mode is very similar to file mode, except that instead of +Buffer mode is very similar to File mode, except that instead of tracking the current directory and all files available there, the -current list of buffers already loaded into Emacs is shown. +current list of Emacs buffers is shown. -These buffers can have their tags expanded in the same way as files -and uses the same unknown file indicator @xref{File Mode}. +These buffers can have their tags expanded in the same way as files, +and uses the same unknown file indicator (@pxref{File Mode}). -Buffers mode does not have file operation bindings, but the following +Buffer mode does not have file operation bindings, but the following buffer specific keybindings are available: + @table @kbd @item k -Kill this buffer. Do not touch it's file. +Kill this buffer. Do not touch its file. @item r Revert this buffer, reloading from disk. @end table -In addition to buffers mode, there is also Quick Buffers mode. In fact, +In addition to Buffer mode, there is also Quick Buffer mode. In fact, Quick Buffers is bound to the @kbd{b} key. The only difference between -Buffers and Quick Buffers is that after one operation is is performed +Buffers and Quick Buffers is that after one operation is performed which effects the attached frame, the display is immediately reverted to the last displayed mode. -Thus, if you are in Files mode, and you need quick access to a buffer, +Thus, if you are in File mode, and you need quick access to a buffer, press @kbd{b}, click on the buffer you want, and speedbar will revert -back to Files mode. +back to File mode. @node Minor Modes, Customizing, Buffer Mode, Top @comment node-name, next, previous, up @@ -584,12 +603,12 @@ The second section lists all RMAIL folders in the same directory as your main RMAIL folder. The general rule is that RMAIL folders always appear in all caps, or numbers. It is possible to save mail in folders with -lower case letters, but there is no clean way detecting RMAIL folders +lower case letters, but there is no clean way of detecting such RMAIL folders without opening them all. Each folder can be visited by clicking the name. You can move mail from the current RMAIL folder into a different folder by clicking the -@samp{} button. The M stands for Move. +@samp{} button. The @samp{M} stands for Move. In this way you can manage your existing RMAIL folders fairly easily using the mouse. @@ -615,7 +634,7 @@ @cindex gdb @cindex gud -If you are debugging an application with GDB in emacs, speedbar can show +If you are debugging an application with GDB in Emacs, speedbar can show you the current stack when the current buffer is the @file{*gdb*} buffer. Usually, it will just report that there is no stack, but when the application is stopped, the current stack will be shown. @@ -635,7 +654,7 @@ Speedbar is highly customizable, with a plethora of control elements. Since speedbar is so visual and reduces so much information, this is an -important aspect of it's behavior. +important aspect of its behavior. In general, there are three custom groups you can use to quickly modify speedbar's behavior. @@ -663,21 +682,27 @@ @cindex frame parameters There are several faces speedbar generates to provide a consistent -colorscheme across display types. You can customize these faces using +color scheme across display types. You can customize these faces using your favorite method. They are: @table @asis +@cindex @code{speedbar-button-face} @item speedbar-button-face -Faced used on expand/contract buttons. +Face used on expand/contract buttons. +@cindex @code{speedbar-file-face} @item speedbar-file-face Face used on Files. Should also be used on non-directory like nodes. +@cindex @code{speedbar-directory-face} @item speedbar-directory-face Face used for directories, or nodes which consist of groups of other nodes. +@cindex @code{speedbar-tag-face} @item speedbar-tag-face -Face used for tags in a file, or leaf items. +Face used for tags in a file, or for leaf items. +@cindex @code{speedbar-selected-face} @item speedbar-selected-face -Face used to highlight the "selected" item. This would be the current +Face used to highlight the selected item. This would be the current file being edited. +@cindex @code{speedbar-highlight-face} @item speedbar-highlight-face Face used when the mouse passes over a button. @end table @@ -685,11 +710,13 @@ You can also customize speedbar's initial frame parameters. How this is accomplished is dependent on your platform being Emacs or XEmacs. +@cindex @code{speedbar-frame-parameters}, Emacs In Emacs, change the alist @code{speedbar-frame-parameters}. This variable is used to set up initial details. Height is also automatically added when speedbar is created, though you can override it. +@cindex @code{speedbar-frame-plist}, XEmacs In XEmacs, change the plist @code{speedbar-frame-plist}. This is the XEmacs way of doing the same thing. @@ -705,20 +732,25 @@ will group some classes of items automatically. Even here, however, some tag groups can be quite large. +@cindex @code{speedbar-tag-hierarchy-method} To solve this problem, tags can be grouped into logical units through a hierarchy processor. The specific variable to use is @code{speedbar-tag-hierarchy-method}. There are several methods that -can be applied in any order. they are: +can be applied in any order. They are: @table @code +@cindex @code{speedbar-trim-words-tag-hierarchy} @item speedbar-trim-words-tag-hierarchy Find a common prefix for all elements of a group, and trim it off. +@cindex @code{speedbar-prefix-group-tag-hierarchy} @item speedbar-prefix-group-tag-hierarchy If a group is too large, place sets of tags into bins based on common prefixes. +@cindex @code{speedbar-simple-group-tag-hierarchy} @item speedbar-simple-group-tag-hierarchy Take all items in the top level list not in a group, and stick them into -a `Tags' group. +a @samp{Tags} group. +@cindex @code{speedbar-sort-tag-hierarchy} @item speedbar-sort-tag-hierarchy Sort all items, leaving groups on top. @end table @@ -728,8 +760,9 @@ Some other control variables are: @table @code +@cindex @code{speedbar-tag-group-name-minimum-length} @item speedbar-tag-group-name-minimum-length -Default Value: 4. +Default value: 4. The minimum length of a prefix group name before expanding. Thus, if the @code{speedbar-tag-hierarchy-method} includes @@ -749,21 +782,22 @@ This way we won't get silly looking listings. +@cindex @code{speedbar-tag-split-minimum-length} @item speedbar-tag-split-minimum-length -Default value: 20 +Default value: 20. Minimum length before we stop trying to create sub-lists in tags. This is used by all tag-hierarchy methods that break large lists into sub-lists. +@cindex @code{speedbar-tag-regroup-maximum-length} @item speedbar-tag-regroup-maximum-length -Default value: 10 +Default value: 10. Maximum length of submenus that are regrouped. If the regrouping option is used, then if two or more short subgroups are next to each other, then they are combined until this number of items is reached. - @end table @node Version Control, Hooks, Tag Hierarchy Methods, Customizing @@ -772,61 +806,75 @@ @cindex version control @cindex vc extensions -When using the Files mode in speedbar, information regarding a version +When using the file mode in speedbar, information regarding a version control system adds small details to the display. If a file is in a -version control system, and is "checked out", or "locked" locally, an -asterisk @asis{*} is placed at the end of the file name. In addition, +version control system, and is ``checked out'', or ``locked'' locally, an +asterisk @samp{*} is placed at the end of the file name. In addition, the directory name for Version Control systems are left out of the speedbar display. +@cindex @code{speedbar-directory-unshown-regexp} You can easily add new version control systems into speedbar's detection -scheme. To make a directory "disappear" from the list, use the variable +scheme. To make a directory ``disappear'' from the list, use the variable @code{speedbar-directory-unshown-regexp}. +@cindex @code{speedbar-vc-path-enable-hook} Next, you need to write entries for two hooks. The first is @code{speedbar-vc-path-enable-hook} which will enable a VC check in the current directory for the group of files being checked. Your hook function should take one parameter (the directory to check) and return @code{t} if your VC method is in control here. +@cindex @code{speedbar-vc-in-control-hook} The second function is @code{speedbar-vc-in-control-hook}. This hook -takes two parameters. The @var{PATH} of the file to check, plus the -@var{FILE} name. Return @code{t} if you want to have the asterisk +takes two parameters, the @var{path} of the file to check, and the +@var{file} name. Return @code{t} if you want to have the asterisk placed near this file. +@cindex @code{speedbar-vc-indicator} Lastly, you can change the VC indicator using the variable @code{speedbar-vc-indicator}, and specify a single character string. @node Hooks, , Version Control, Customizing @comment node-name, next, previous, up @section Hooks +@cindex hooks There are several hooks in speedbar allowing custom behaviors to be added. Available hooks are: @table @code +@cindex @code{speedbar-visiting-file-hook} @item speedbar-visiting-file-hook Hooks run when speedbar visits a file in the selected frame. +@cindex @code{speedbar-visiting-tag-hook} @item speedbar-visiting-tag-hook Hooks run when speedbar visits a tag in the selected frame. +@cindex @code{speedbar-load-hook} @item speedbar-load-hook Hooks run when speedbar is loaded. +@cindex @code{speedbar-reconfigure-keymaps-hook} @item speedbar-reconfigure-keymaps-hook Hooks run when the keymaps are regenerated. Keymaps are reconfigured whenever modes change. This will let you add custom keybindings. +@cindex @code{speedbar-before-popup-hook} @item speedbar-before-popup-hook Hooks called before popping up the speedbar frame. -New frames are often popped up when "power clicking" on an item to view +New frames are often popped up when ``power clicking'' on an item to view it. +@cindex @code{speedbar-before-delete-hook} @item speedbar-before-delete-hook Hooks called before deleting or hiding the speedbar frame. +@cindex @code{speedbar-mode-hook} @item speedbar-mode-hook Hooks called after creating a speedbar buffer. +@cindex @code{speedbar-timer-hook} @item speedbar-timer-hook Hooks called after running the speedbar timer function. +@cindex @code{speedbar-scanner-reset-hook} @item speedbar-scanner-reset-hook Hook called whenever generic scanners are reset. -Set this to implement your own scanning / rescan safe functions with +Set this to implement your own scanning or rescan safe functions with state data. @end table @@ -836,14 +884,14 @@ @cindex extending Speedbar can run different types of Major display modes such as Files -@xref{File Mode}, and Buffers @xref{Buffer Mode}. It can also manage +(@pxref{File Mode}), and Buffers (@pxref{Buffer Mode}). It can also manage different minor display modes for use with buffers handling specialized data. These major and minor display modes are handled through an extension system which permits specialized keymaps and menu extensions, in addition to a unique rendering function. You can also specify a wide -range of tagging functions. The default uses @file{imenu}, but new +range of tagging functions. The default uses @code{imenu}, but new tagginging methods can be easilly added. In this chapter, you will learn how to write your own major or minor display modes, and how to create specialized tagging functions. @@ -859,7 +907,7 @@ @section Minor Display Modes @cindex create minor display mode -A minor display mode is a mode useful when using a specific type of +A @dfn{minor display mode} is a mode useful when using a specific type of buffer. This mode might not be useful for any other kind of data or mode, or may just be more useful that a files or buffers based mode when working with a specialized mode. @@ -869,50 +917,58 @@ attached frame. To enable a minor display mode in your favorite Major mode, follow these -steps. The string @samp{} is the name of the major mode being +steps. The string @samp{@var{name}} is the name of the major mode being augmented with speedbar. @enumerate @item -Create the keymap variable @code{-speedbar-key-map}. +Create the keymap variable @code{@var{name}-speedbar-key-map}. + @item -Create a function named whatever you like which assigns values into your +Create a function, named whatever you like, which assigns values into your keymap. Use this command to create the keymap before assigning bindings: -@example - (setq -speedbar-key-map (speedbar-make-specialized-keymap)) -@end example + +@smallexample + (setq @var{name}-speedbar-key-map (speedbar-make-specialized-keymap)) +@end smallexample + This function creates a special keymap for use in speedbar. + @item Call your install function, or assign it to a hook like this: -@example + +@smallexample (if (featurep 'speedbar) - (-install-speedbar-variables) - (add-hook 'speedbar-load-hook '-install-speedbar-variables)) -@end example + (@var{name}-install-speedbar-variables) + (add-hook 'speedbar-load-hook '@var{name}-install-speedbar-variables)) +@end smallexample + @item -Create an easymenu compatible vector named @code{-speedbar-menu-items}. -This will be spliced into speedbar's control menu. +Create an easymenu compatible vector named +@code{@var{name}-speedbar-menu-items}. This will be spliced into +speedbar's control menu. + @item -Create a function called @code{-speedbar-buttons}. This function +Create a function called @code{@var{name}-speedbar-buttons}. This function should take one variable, which is the buffer for which it will create buttons. At this time @code{(current-buffer)} will point to the uncleared speedbar buffer. @end enumerate -When writing @code{-speedbar-buttons}, the first thing you will +When writing @code{@var{name}-speedbar-buttons}, the first thing you will want to do is execute a check to see if you need to re-create your display. If it needs to be cleared, you need to erase the speedbar -buffer yourself, and start drawing buttons. @xref{Creating a display}. +buffer yourself, and start drawing buttons. @xref{Creating a display}. @node Major Display Modes, Tagging Extentions, Minor Display Modes, Extending @section Major Display Modes @cindex create major display mode -Creating a Major Display Mode for speedbar requires authoring a keymap, +Creating a @dfn{Major Display Mode} for speedbar requires authoring a keymap, an easy-menu segment, and writing several functions. These items can be given any name, and are made the same way as in a minor display mode -@xref{Minor Display Modes}. Once this is done, these items need to be +(@pxref{Minor Display Modes}). Once this is done, these items need to be registered. Because this setup activity may or may not have speedbar available when @@ -920,21 +976,26 @@ function should create and initialize the keymap, and add your expansions into the customization tables. +@cindex @code{speedbar-make-specialized-keymap} When creating the keymap, use the function @code{speedbar-make-specialized-keymap} instead of other keymap making functions. This will provide you with the initial bindings needed. Some common speedbar functions you might want to bind are: @table @code +@cindex @code{speedbar-edit-line} @item speedbar-edit-line Edit the item on the current line. +@cindex @code{speedbar-expand-line} @item speedbar-expand-line Expand the item under the cursor. -With universal argument @key{C-u}, flush cached data before expanding. +With a numeric argument (@kbd{C-u}), flush cached data before expanding. +@cindex @code{speedbar-contract-line} @item speedbar-contract-line Contract the item under the cursor. @end table +@cindex @code{speedbar-line-path} These function require that function @code{speedbar-line-path} be correctly overloaded to work. @@ -988,6 +1049,7 @@ (setq depth (string-to-int (match-string 1))))) @end example +@noindent where the depth is stored as invisible text at the beginning of each line. @@ -997,6 +1059,7 @@ functions to work (meaning less code for you to write). If your display does not deal in files, you do not need to overload this function. +@cindex @code{speedbar-item-info} The function @code{speedbar-item-info}, however, is very likely to need overloading. This function takes no parameters and must derive a text summary to display in the minibuffer. @@ -1006,34 +1069,38 @@ returns non-nil if it displays a message. They are: @table @code +@cindex @code{speedbar-item-info-file-helper} @item speedbar-item-info-file-helper -This takes an optional FILENAME parameter. You can derive your own +This takes an optional @var{filename} parameter. You can derive your own filename, or it will derive it using a (possibly overloaded) function @code{speedbar-line-file}. It shows details about a file. +@cindex @code{speedbar-item-info-tag-helper} @item speedbar-item-info-tag-helper If the current line is a tag, then display information about that tag, -such as it's parent file, and location. +such as its parent file, and location. @end table Your custom function might look like this: +@example (defun MyExtension-item-info () "Display information about the current line." (or (speedbar-item-info-tag-helper) (message "Interesting detail."))) +@end example Once you have done all this, speedbar will show an entry in the -Displays menu declaring that your extension is available. +@samp{Displays} menu declaring that your extension is available. @node Tagging Extentions, Creating a display, Major Display Modes, Extending @section Tagging Extentions It is possible to create new methods for tagging files in speedbar. -To do this, you need two basic functions. One function will fetch the -tags from a buffer, and the second will insert them below the filename. +To do this, you need two basic functions, one function to fetch the +tags from a buffer, the other to insert them below the filename. @defun my-fetch-dynamic-tags file -Parse @var{file} for a list of tags. Return the list, or t if there was +Parse @var{file} for a list of tags. Return the list, or @code{t} if there was an error. @end defun @@ -1046,10 +1113,12 @@ display information requried. @end defun +@cindex @code{speedbar-create-tag-hierarchy} It is often useful to use @code{speedbar-create-tag-hierarchy} on your -token list. See that functions documentation for details on what it +token list. See that function's documentation for details on what it requires. +@cindex @code{speedbar-dynamic-tags-function-list} Once these two functions are written, modify the variable @code{speedbar-dynamic-tags-function-list} to include your parser at the beginning, like this: @@ -1061,14 +1130,14 @@ If your parser is only good for a few types of files, make sure that it is either a buffer local modification, or that the tag generator returns -t for non valid buffers. +@code{t} for non valid buffers. @node Creating a display, , Tagging Extentions, Extending @section Creating a display @cindex creating a display Rendering a display in speedbar is completely flexible. When your -button function is called, @xref{Minor Display Modes}, @xref{Major +button function is called, see @ref{Minor Display Modes}, and @ref{Major Display Modes}, you have control to @code{insert} anything you want. The conventions allow almost anything to be inserted, but several helper @@ -1088,7 +1157,7 @@ stored in invisible text at the beginning of each line, and is used by the navigation commands. -@defun speedbar-insert-button text face mouse function @@optional token prevline +@defun speedbar-insert-button text face mouse function &optional token prevline This function inserts one button into the current location. @var{text} is the text to insert. @var{face} is the face in which it will be displayed. @var{mouse} is the face to display over the text @@ -1105,7 +1174,8 @@ Create a tag line with @var{exp-button-type} for the small expansion button. This is the button that expands or contracts a node (if -applicable), and @var{exp-button-char} the character in it (+, -, ?, +applicable), and @var{exp-button-char} the character in it (@samp{+}, +@samp{-}, @samp{?}, etc). @var{exp-button-function} is the function to call if it's clicked on. Button types are @code{'bracket}, @code{'angle}, @code{'curly}, @code{'expandtag}, @code{'statictag}, or nil. @var{exp-button-data} is @@ -1125,21 +1195,22 @@ @defun speedbar-insert-generic-list level list expand-fun find-fun -At @var{LEVEL}, (the current indentation level desired) insert a generic +At @var{level}, (the current indentation level desired) insert a generic multi-level alist @var{list}. Associations with lists get @samp{@{+@}} tags (to expand into more nodes) and those with positions or other data -just get a > as the indicator. @samp{@{+@}} buttons will have the +just get a @samp{>} as the indicator. @samp{@{+@}} buttons will have the function @var{expand-fun} and the token is the @code{cdr} list. The token name will have the function @var{find-fun} and not token. Each element of the list can have one of these forms: + @table @code -@item ("name" . marker-or-number) -one tag at this level -@item ("name" ("name" . marker-or-number) ("name" . marker-or-number) ... ) -One group of tags -@item ("name" marker-or-number ("name" . marker-or-number) ... ) -One Group of tags where the group has a starting position +@item (@var{name} . marker-or-number) +One tag at this level. +@item (@var{name} (@var{name} . marker-or-number) (@var{name} . marker-or-number) ... ) +One group of tags. +@item (@var{name} marker-or-number (@var{name} . marker-or-number) ... ) +One Group of tags where the group has a starting position. @end table When you use @code{speedbar-insert-generic-list}, there are some @@ -1148,7 +1219,7 @@ @xref{Tag Hierarchy Methods}. @defvar speedbar-generic-list-group-expand-button-type -This is the button type used for groups of tags, weather expanded, +This is the button type used for groups of tags, whether expanded or added in via a hierarchy method. Two good values are @code{'curly} and @code{'expandtag}. Curly is the default button, and @code{'expandtag} is useful if the groups also has a position. @@ -1168,9 +1239,6 @@ @unnumbered Concept Index @printindex cp -@unnumbered Function Index -@printindex fn - @bye @c LocalWords: speedbar's xref Keybindings slowbar kbd subsubsection @c LocalWords: keybindings