Function: vhdl-speedbar-dired
vhdl-speedbar-dired is a byte-compiled function defined in
vhdl-mode.el.gz.
Signature
(vhdl-speedbar-dired TEXT TOKEN INDENT)
Documentation
Speedbar click handler for directory expand button in hierarchy mode.
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/vhdl-mode.el.gz
(defun vhdl-speedbar-dired (text token indent)
"Speedbar click handler for directory expand button in hierarchy mode."
(cond ((string-match "\\+" text) ; we have to expand this dir
(setq speedbar-shown-directories
(cons (expand-file-name
(concat (speedbar-line-directory indent) token "/"))
speedbar-shown-directories))
(speedbar-change-expand-button-char ?-)
(speedbar-reset-scanners)
(speedbar-with-writable
(save-excursion
(end-of-line) (forward-char 1)
(vhdl-speedbar-insert-dirs
(speedbar-file-lists
(concat (speedbar-line-directory indent) token "/"))
(1+ indent))
(speedbar-reset-scanners)
(vhdl-speedbar-insert-dir-hierarchy
(abbreviate-file-name
(concat (speedbar-line-directory indent) token "/"))
(1+ indent) speedbar-power-click)))
(vhdl-speedbar-update-current-unit t t))
((string-match "-" text) ; we have to contract this node
(speedbar-reset-scanners)
(let ((oldl speedbar-shown-directories)
(newl nil)
(td (expand-file-name
(concat (speedbar-line-directory indent) token))))
(while oldl
(if (not (string-match (concat "^" (regexp-quote td)) (car oldl)))
(push (car oldl) newl))
(setq oldl (cdr oldl)))
(setq speedbar-shown-directories (nreverse newl)))
(speedbar-change-expand-button-char ?+)
(speedbar-delete-subblock indent))
(t (error "Nothing to display")))
(when (equal (selected-frame) speedbar-frame)
(speedbar-center-buffer-smartly)))