diff options
| author | Nick Roberts | 2006-02-28 02:52:56 +0000 |
|---|---|---|
| committer | Nick Roberts | 2006-02-28 02:52:56 +0000 |
| commit | 5ef215741bb942ce7ae5fa84e4cc1e943ec55a93 (patch) | |
| tree | 9d07e25f1680392302c65f3d07d63c0554a33c42 | |
| parent | bc4c8031d3b7ad883c6721a09a0171c6bc055117 (diff) | |
| download | emacs-5ef215741bb942ce7ae5fa84e4cc1e943ec55a93.tar.gz emacs-5ef215741bb942ce7ae5fa84e4cc1e943ec55a93.zip | |
Re-instate comments about developing for speedbar
[this is what info and gdb-ui use even if better methods exist now].
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/speedbar.el | 67 |
2 files changed, 70 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index eb2e87a163f..3344bca5ba3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2006-02-28 Nick Roberts <nickrob@snap.net.nz> | 1 | 2006-02-28 Nick Roberts <nickrob@snap.net.nz> |
| 2 | 2 | ||
| 3 | * speedbar.el: Re-instate comments about developing for speedbar | ||
| 4 | [this is what info and gdb-ui use even if better methods exist now]. | ||
| 5 | |||
| 3 | * t-mouse.el: New file. | 6 | * t-mouse.el: New file. |
| 4 | (t-mouse-tty): Use with-temp-buffer. Add more terminal types. | 7 | (t-mouse-tty): Use with-temp-buffer. Add more terminal types. |
| 5 | (t-mouse-lispy-buffer-posn-from-coords): Remove. Use the C | 8 | (t-mouse-lispy-buffer-posn-from-coords): Remove. Use the C |
diff --git a/lisp/speedbar.el b/lisp/speedbar.el index 4f0e2edf7cb..6a9ecbc542d 100644 --- a/lisp/speedbar.el +++ b/lisp/speedbar.el | |||
| @@ -57,6 +57,73 @@ this version is not backward compatible to 0.14 or earlier.") | |||
| 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. |