Mercurial > emacs
comparison lisp/speedbar.el @ 69197:9f9cc4dd5f76
Re-instate comments about developing for speedbar
[this is what info and gdb-ui use even if better methods exist now].
author | Nick Roberts <nickrob@snap.net.nz> |
---|---|
date | Tue, 28 Feb 2006 02:49:16 +0000 |
parents | 4d9d30d2a347 |
children | d836c61e53c9 |
comparison
equal
deleted
inserted
replaced
69196:6c74df3ce672 | 69197:9f9cc4dd5f76 |
---|---|
55 ;; assoc should be available in all modern versions of Emacs. | 55 ;; assoc should be available in all modern versions of Emacs. |
56 ;; The custom package is optional (for easy configuration of speedbar) | 56 ;; The custom package is optional (for easy configuration of speedbar) |
57 ;; http://www.dina.kvl.dk/~abraham/custom/ | 57 ;; http://www.dina.kvl.dk/~abraham/custom/ |
58 ;; custom is available in all versions of Emacs version 20 or better. | 58 ;; custom is available in all versions of Emacs version 20 or better. |
59 ;; | 59 ;; |
60 ;;; Developing for speedbar | |
61 ;; | |
62 ;; Adding a speedbar specialized display mode: | |
63 ;; | |
64 ;; Speedbar can be configured to create a special display for certain | |
65 ;; modes that do not display traditional file/tag data. Rmail, Info, | |
66 ;; and the debugger are examples. These modes can, however, benefit | |
67 ;; from a speedbar style display in their own way. | |
68 ;; | |
69 ;; If your `major-mode' is `foo-mode', the only requirement is to | |
70 ;; create a function called `foo-speedbar-buttons' which takes one | |
71 ;; argument, BUFFER. BUFFER will be the buffer speedbar wants filled. | |
72 ;; In `foo-speedbar-buttons' there are several functions that make | |
73 ;; building a speedbar display easy. See the documentation for | |
74 ;; `speedbar-with-writable' (needed because the buffer is usually | |
75 ;; read-only) `speedbar-make-tag-line', `speedbar-insert-button', and | |
76 ;; `speedbar-insert-generic-list'. If you use | |
77 ;; `speedbar-insert-generic-list', also read the doc for | |
78 ;; `speedbar-tag-hierarchy-method' in case you wish to override it. | |
79 ;; The macro `speedbar-with-attached-buffer' brings you back to the | |
80 ;; buffer speedbar is displaying for. | |
81 ;; | |
82 ;; For those functions that make buttons, the "function" should be a | |
83 ;; symbol that is the function to call when clicked on. The "token" | |
84 ;; is extra data you can pass along. The "function" must take three | |
85 ;; parameters. They are (TEXT TOKEN INDENT). TEXT is the text of the | |
86 ;; button clicked on. TOKEN is the data passed in when you create the | |
87 ;; button. INDENT is an indentation level, or 0. You can store | |
88 ;; indentation levels with `speedbar-make-tag-line' which creates a | |
89 ;; line with an expander (eg. [+]) and a text button. | |
90 ;; | |
91 ;; Some useful functions when writing expand functions, and click | |
92 ;; functions are `speedbar-change-expand-button-char', | |
93 ;; `speedbar-delete-subblock', and `speedbar-center-buffer-smartly'. | |
94 ;; The variable `speedbar-power-click' is set to t in your functions | |
95 ;; when the user shift-clicks. This is an indication of anything from | |
96 ;; refreshing cached data to making a buffer appear in a new frame. | |
97 ;; | |
98 ;; If you wish to add to the default speedbar menu for the case of | |
99 ;; `foo-mode', create a variable `foo-speedbar-menu-items'. This | |
100 ;; should be a list compatible with the `easymenu' package. It will | |
101 ;; be spliced into the main menu. (Available with click-mouse-3). If | |
102 ;; you wish to have extra key bindings in your special mode, create a | |
103 ;; variable `foo-speedbar-key-map'. Instead of using `make-keymap', | |
104 ;; or `make-sparse-keymap', use the function | |
105 ;; `speedbar-make-specialized-keymap'. This lets you inherit all of | |
106 ;; speedbar's default bindings with low overhead. | |
107 ;; | |
108 ;; Adding a speedbar top-level display mode: | |
109 ;; | |
110 ;; Unlike the specialized modes, there are no name requirements, | |
111 ;; however the methods for writing a button display, menu, and keymap | |
112 ;; are the same. Once you create these items, you can call the | |
113 ;; function `speedbar-add-expansion-list'. It takes one parameter | |
114 ;; which is a list element of the form (NAME MENU KEYMAP &rest | |
115 ;; BUTTON-FUNCTIONS). NAME is a string that will show up in the | |
116 ;; Displays menu item. MENU is a symbol containing the menu items to | |
117 ;; splice in. KEYMAP is a symbol holding the keymap to use, and | |
118 ;; BUTTON-FUNCTIONS are the function names to call, in order, to create | |
119 ;; the display. | |
120 ;; Another tweakable variable is `speedbar-stealthy-function-list' | |
121 ;; which is of the form (NAME &rest FUNCTION ...). NAME is the string | |
122 ;; name matching `speedbar-add-expansion-list'. (It does not need to | |
123 ;; exist.). This provides additional display info which might be | |
124 ;; time-consuming to calculate. | |
125 ;; Lastly, `speedbar-mode-functions-list' allows you to set special | |
126 ;; function overrides. | |
60 | 127 |
61 ;;; TODO: | 128 ;;; TODO: |
62 ;; - Timeout directories we haven't visited in a while. | 129 ;; - Timeout directories we haven't visited in a while. |
63 | 130 |
64 (require 'assoc) | 131 (require 'assoc) |