Skip to content

Commit

Permalink
small fixes for next release
Browse files Browse the repository at this point in the history
  • Loading branch information
berndl committed Jun 27, 2005
1 parent 4e08edc commit d625a76
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 48 deletions.
14 changes: 7 additions & 7 deletions NEWS
@@ -1,6 +1,6 @@
* Changes for ECB version 2.32beta3

** New backbone-add-on of ECB for getting definition for the symbol at point
** New backbone-add-on of ECB for getting the definition of the symbol at point

It allows to display in a new special ECB-window the semantic (do not
confuse this trem with the semantic-library!) context of the definition of
Expand All @@ -18,13 +18,13 @@

** New native ECB-display interactor for the semantic-analyzer
There is a new tree-buffer ECB-analyse which displays the tags and
informations of the semanic-analyzer in a smooth way. There are already
some new prebuild layouts which contain this new tree-buffer (TODO). But of
course it can be added to own build layouts (either via the command
`ecb-create-new-layout' or via a elisp-rogrammed new layout).
informations of the semanic-analyzer in a smooth way. There are already new
prebuild layouts "left-analyse" and "leftright-analyse" which contain this
new tree-buffer interactor. But of course it can be added to own build
layouts - either via the command `ecb-create-new-layout' (add a buffer of
type "other" and name "analyse" into the new layout) or via a
elisp-rogrammed new layout.

TODO: + adding new section in the info-manual

** New smart-arrow-navigation in a tree-buffer with up- and down-arrow
Point jumps to the first character of the previous (up) rsp. next node
(down). "First" character means either the first character of the
Expand Down
5 changes: 5 additions & 0 deletions TODO
@@ -1,3 +1,8 @@
- Implement ecb-upgrading with the new url-package of Emacs 22 and with
url-dl.el (at least copy this code into ecb-upgrade) - in combination with
tar-mode it should be possible to download and extract a new ecb-version
without any external tools like wget, tar and gzip!

- Implementing the class-browser of speedbar native with ECB in an
additional special ecb-window - a very important todo of high
priority!
Expand Down
2 changes: 2 additions & 0 deletions ecb-analyse.el
Expand Up @@ -617,6 +617,8 @@ analyse-buffer."
ecb-analyse-buffer-after-create-hook)
:after-update-hook nil))



(silentcomp-provide 'ecb-analyse)

;;; ecb-anaylse.el ends here
10 changes: 7 additions & 3 deletions ecb-common-browser.el
Expand Up @@ -550,13 +550,17 @@ Removes all creators and set it to nil."
"Define a creator-function CREATOR for a tree-buffer which name is hold in
the symbol TREE-BUFFER-NAME-SYMBOL. Do not quote CREATOR and
TREE-BUFFER-NAME-SYMBOL. DOCSTRING is the docstring for CREATOR. BODY is all
the program-code of CREATOR \(should contain a call to `tree-buffer-create').
It makes sense that BODY returns the created tree-buffer.
the program-code of CREATOR \(must contain a call to `tree-buffer-create'). It
makes sense that BODY returns the created tree-buffer.
When creating a tree-buffer with this macro then this tree-buffer will be
automatically created \(i.e. its creator-function defined with this macro will
be called) when activating ECB and the tree-buffer will automatically
registered at ECB."
registered at ECB. This means that some features of ECB will work
automatically out of the box with this tree-buffer.
When creating a tree-buffer for ECB then it MUST be created with this macro
and not with `tree-buffer-create'!"
`(eval-and-compile
(ecb-tree-buffer-creators-register (quote ,tree-buffer-name-symbol)
(quote ,creator))
Expand Down
10 changes: 9 additions & 1 deletion ecb-method-browser.el
Expand Up @@ -3509,11 +3509,19 @@ should be displayed. For 1 and 2 the value of EDIT-WINDOW-NR is ignored."
;; in current buffer; e.g. parent or include tags can be such tags! Try
;; to find the tag
((= type ecb-methods-nodetype-externtag)
;; data is here a string and just the name of a tag not a tag!
(set-buffer (get-file-buffer ecb-path-selected-source))
;; Try to find source using JDE
(setq found (ecb-jde-show-class-source data))
;; Fix from Daniel Dbertin (<airboss@nodewarrior.org>)
;; TODO: Klaus Berndl <klaus.berndl@sdm.de>: encapsulate these function
;; with ecb-- wrappers!
(let ((types (semantic-ctxt-scoped-types)))
(setq tag (and types (car (semantic-deep-find-tags-by-name data types))))
(if tag
(setq filename (semantic-tag-file-name tag))))
;; Try to find source using Semantic DB
(when (not found)
(when (and (null tag) (not found))
(let ((parent (ecb-semanticdb-get-type-definition data)))
(when parent
(setq tag (cdr parent))
Expand Down
4 changes: 4 additions & 0 deletions ecb.el
Expand Up @@ -2263,6 +2263,10 @@ performance-problem!"
(when (and (not (> (minibuffer-depth) 0))
(not (equal ecb-last-major-mode major-mode))
(not (member (buffer-name (current-buffer))
;; TODO: Klaus Berndl <klaus.berndl@sdm.de>: I
;; think this is not fully correct - what about an
;; ecb-interactor which is not a tree-buffer like
;; the ecb-symboldef-stuff?!
(ecb-tree-buffers-name-list))))
(let ((last-mode ecb-last-major-mode))
(setq ecb-last-major-mode major-mode)
Expand Down
83 changes: 46 additions & 37 deletions tree-buffer.el
Expand Up @@ -317,8 +317,8 @@ A tree-node can have the following slots:
DATA: The data of the node; can be arbitrary lisp-structures.
EXPANDABLE: If not nil then the node is currently expanded, means its
children are visible.
EXPANDED: If not nil then the node is currently expanded, means its children
are visible.
PARENT: The parent tree-node.
Expand All @@ -342,9 +342,11 @@ A tree-node can have the following slots:
displayed name can be different from the NAME according to the value of
SHRINK-NAME.
TODO: Add here a full description about the usage of tree-node or - even
better - add a hyper-link to the related info-node like follows:
See Info node `Font Lock' and Info node `(elisp)Font Lock Basics'.."
For all parameters except NOT-EXPANDABLE the description is available in the
slot-list above. If NOT-EXPANDABLE is set to not nil then the slot EXPANDABLE
will be set to nil; otherwise to t.
See Info node `(ecb)tree-buffer' for all details of using tree-nodes."
(let ((n (-tree-node-new :name name
:type type
:data data
Expand Down Expand Up @@ -1080,14 +1082,14 @@ image-object for TREE-IMAGE-NAME."

(defun tree-buffer-select (mouse-button shift-pressed control-pressed meta-pressed)
"If the callback-function in slot IS-CLICK-VALID-FN of `tree-buffer-spec'
returns nil then nothing is done. Otherwise: If the node is expandable and the
node is not expanded then the callback-function in slot NODE-EXPANDED-FN of
`tree-buffer-spec' is called with the node, the clicked MOUSE-BUTTON \(1 for
mouse-1, 2 for mouse-2, 0 for no mouse-button but a key like RET or TAB),
SHIFT-PRESSED, CONTROL-PRESSED and META-PRESSED informations and the name of
the tree-buffer as arguments. If the node is not expandable then the
callback-function in NODE-SELECTED-FN of `tree-buffer-spec' is called with the
same arguments as slot NODE-EXPANDED-FN of `tree-buffer-spec'."
returns nil then nothing is done. Otherwise: If either the MOUSE-BUTTON is 0
or point is as the node-name then the callback-function in slot
NODE-SELECTED-FN is called with the needed arguments \(see
`tree-buffer-create'). If point is at the expand/collape-button depending of
the expansion-state either the callback in slot NODE-EXPANDED-FN or
NODE-COLLAPSED-FN is called \(for parameters see again `tree-buffer-create').
None of these callbacks must modify the slot EXPANDED of the passed node
because this is done automatically by this function."
(unless (not (equal (selected-frame) tree-buffer-frame))
(when (and (tree-buffer-spec->is-click-valid-fn tree-buffer-spec)
(funcall (tree-buffer-spec->is-click-valid-fn tree-buffer-spec)
Expand Down Expand Up @@ -1881,7 +1883,8 @@ see `tree-buffer-expand-node'. This function is not for external usage; use

(defun tree-buffer-set-root (root)
"Set the root-node of current tree-buffer to ROOT.
ROOT must be a tree-node object."
ROOT must be either that root-node automatically created by
`tree-buffer-create' or a node returned by `tree-node-new-root'!"
(setq tree-buffer-root root)
(setf (tree-node->expanded tree-buffer-root) t))

Expand Down Expand Up @@ -2121,7 +2124,9 @@ For a description of NODE-COMMAND-P see `tree-buffer-create-menu'."
;; to current window not to frame!
;; TODO: Klaus Berndl <klaus.berndl@sdm.de>: For XEmacs this does not work!
(defun tree-buffer-show-node-menu-keyboard (&optional use-tmm)
"Activate the popup-menu of current tree-buffer via keyboard."
"Activate the popup-menu of current tree-buffer via keyboard. If called with
a prefix-arg then the library tmm.el is used for displaying the popup-menu -
ignored with XEmacs."
(interactive "P")
(if use-tmm
(unless (not (equal (selected-frame) tree-buffer-frame))
Expand Down Expand Up @@ -2450,7 +2455,7 @@ IS-CLICK-VALID-FN: `tree-buffer-create' rebinds mouse-1, mouse-2, RET \(and
TAB) and also in combination with shift and control \(not
with TAB). IS-CLICK-VALID-FN is called first if a node or
an expand-symbol is clicked. This function is called with
four arguments:
five arguments:
- mouse-button: The clicked mouse-button or RET or TAB \(0
= RET or TAB, 1 = mouse-1, 2 = mouse 2)
- shift-pressed: non nil if the SHIFT-key was pressed
Expand Down Expand Up @@ -2485,10 +2490,10 @@ NODE-EXPANDED-FN: Function to call if a node is expandable, point stays onto
- control-pressed
- meta-pressed
- tree-buffer-name
This function should add all children nodes to this node
\(if possible). This function has to ensure that the
expandable- and expanded state of the selected node is
correct after returning!
This function should add all children nodes to this node if
not already done \(if possible). This function has to ensure
that the expandable- and expanded state of the selected node
is correct after returning!
NODE-COLLAPSED-FN: Function to call if a node is expandable, point stays
onto the expand-symbol and node is already expanded.
This function is called with the following parameters:
Expand All @@ -2498,20 +2503,20 @@ NODE-COLLAPSED-FN: Function to call if a node is expandable, point stays
- control-pressed
- meta-pressed
- tree-buffer-name
This function is only a callback to inform the user of
this tree-buffer that this node has been collapsed. This
function must not modify the expandable- or expanded
state of the selected node!
This function is only a callback to inform the owner/user
of this tree-buffer that this node has been collapsed. This
function must not modify the expandable- or expanded state
of the selected node!
NODE-MOUSE-OVER-FN: Function to call when the mouse is moved over a node. This
function is called with three arguments: NODE, WINDOW,
NO-PRINT, each of them related to the current tree-buffer.
If NO-PRINT is nil then the function must print the text
itself in any manner. This function must always return the
text which either is printed by the function itself or by
the caller \(if NO-PRINT is not nil). The current buffer
for this function is the tree-buffer. With XEmacs this
function is only called if the tree-buffer track-mouse
mechanism is activated \(see the function
for this function is the tree-buffer itself. With XEmacs
this function is only called if the tree-buffer
track-mouse mechanism is activated \(see the function
`tree-buffer-activate-follow-mouse'). With GNU Emacs 21
this function is called by the `help-echo' property added
to each node.
Expand All @@ -2523,7 +2528,7 @@ MOUSE-HIGHLIGHT-FN: If nil then in this tree-buffer no node is highlighted
mouse moves over it - otherwise no highlighting takes place.
NODE-DATA-EQUAL-FN: Function used by the tree-buffer to test if the data of
two tree-nodes are equal. The function is called with two
args: The DATA-slot of the two tree-nodes.
args: The DATA-slots of the two tree-nodes.
MAYBE-EMPTY-NODE-TYPES: Nil or a list of node-types \(a node-type is an
integer which must be set for `tree-node-new'). Nodes
with one of these types are treated as empty if they
Expand Down Expand Up @@ -2643,17 +2648,17 @@ TYPE-FACER: Nil or a list of one or more conses, each cons for a node-type \(a
node-type is an integer which must be set for `tree-node-new').
The cdr of a cons can be:
- a face-symbol
- a function-symbol which gets to arguments \(see
- a function-symbol which gets two arguments \(see
`tree-buffer-insert-text'). This function can do anything, but
normally it should face a tree-node.
- the symbol t. Then the tree-buffer assumes that the node-text is
already faced and therefore it does not face the node, means it
does nothing then inserting the node-text, if the tree-buffer is
updated.
EXPAND-SYMBOL-BEFORE-P: If not nil then the expand-symbol \(is displayed before
EXPAND-SYMBOL-BEFORE-P: If not nil then the expand-symbol is displayed before
the node-text. Ignored when TREE-STYLE is 'image and
Emacs can display images.
HIGHLIGHT-NODE-FACE: Face used for highlighting current node in this
HIGHLIGHT-NODE-FACE: Face used for highlighting current selected node in this
tree-buffer.
GENERAL-FACE: General face in which the whole tree-buffer should be displayed.
AFTER-CREATE-HOOK: A function or a list of functions \(with no arguments)
Expand All @@ -2663,7 +2668,9 @@ AFTER-CREATE-HOOK: A function or a list of functions \(with no arguments)
\(use `local-set-key' for this).
AFTER-UPDATE-HOOK: A function or a list of functions \(with no arguments)
called each time after the tree-buffer has been updated via
`tree-buffer-update'."
`tree-buffer-update'.
See Info node `(ecb)tree-buffer' for all details of using tree-buffers."
(let ((nop (function (lambda(e) (interactive "e"))))
(a-c-h (if (functionp after-create-hook)
(list after-create-hook)
Expand Down Expand Up @@ -2953,11 +2960,13 @@ AFTER-UPDATE-HOOK: A function or a list of functions \(with no arguments)
(dolist (f a-c-h)
(funcall f)))))

(defun tree-buffer-destroy (buffer)
"Destroy the tree-buffer"
(when buffer
(setq tree-buffers (delq (get-buffer buffer) tree-buffers))
(ignore-errors (kill-buffer buffer))))
(defun tree-buffer-destroy (tree-buffer-name)
"Destroy the tree-buffer with name TREE-BUFFER-NAME. Does nothing if either
tree-buffer-name is not alive or if it is not a tree-buffer created with
`tree-buffer-create'."
(when (and tree-buffer-name (member (get-buffer tree-buffer-name) tree-buffers))
(setq tree-buffers (delq (get-buffer tree-buffer-name) tree-buffers))
(ignore-errors (kill-buffer tree-buffer-name))))


;; editor goodies
Expand Down

0 comments on commit d625a76

Please sign in to comment.