Skip to content

Commit

Permalink
tree-buffer-highlight-node-data now returns nil if no highlighting co…
Browse files Browse the repository at this point in the history
…uld be

done. So now the caller can check this result and react suitable.

General expanding of tree-buffers now possible.
  • Loading branch information
berndl committed Jan 29, 2003
1 parent 5547d27 commit 9216326
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions tree-buffer.el
Expand Up @@ -440,17 +440,25 @@ START-NODE is nil or equal to the root-node then all nodes of current
tree-buffer are searched from beginning until the node with data NODE-DATA has
been found otherwise the search starts with START-NODE. If DONT-MAKE-VISIBLE
is true then no tree-buffer recentering has been done to make this node
visible."
visible.
If either NODE-DATA is nil or if the node belonging to NODE-DATA can not be
found because it is invisible \(probably because its parent-node is not
expanded) then no highlighting takes place but the existing highlighting is
removed and nil is returned. Otherwise the node is highlighted and not nil is
returned."
(if node-data
(let* ((name-node (tree-buffer-find-name-node-data node-data start-node))
(name (car name-node))
(node (cdr name-node))
(w (get-buffer-window (current-buffer))))
(if (null node)
;; node can not be found because maybe the node is a subnode and
;; it´s parent is not expanded --> then there is no node for
;; NODE-DATA; therefore we must remove the highlighting
(tree-buffer-remove-highlight)
(progn
;; node can not be found because maybe the node is a subnode and
;; it´s parent is not expanded --> then there is no node for
;; NODE-DATA; therefore we must remove the highlighting
(tree-buffer-remove-highlight)
nil)
(setq tree-buffer-highlighted-node-data node-data)
(save-excursion
(move-overlay tree-buffer-highlight-overlay
Expand All @@ -459,8 +467,11 @@ visible."
(when (not dont-make-visible)
;; make node visible if not and optimize the windows display for
;; the node.
(tree-buffer-recenter node w))))
(tree-buffer-remove-highlight)))
(tree-buffer-recenter node w))
;; we have highlighted the node wo we return not nil.
t))
(tree-buffer-remove-highlight)
nil))

(defun tree-buffer-help-echo-fn (win obj pos)
"This function is the value of the `help-echo' property of each
Expand Down

0 comments on commit 9216326

Please sign in to comment.