Skip to content

Commit

Permalink
Add command direx:expand-item-recursively command
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomohiro Matsuyama committed Jul 8, 2013
1 parent fc813e2 commit ba8b950
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions direx.el
Expand Up @@ -338,6 +338,11 @@ mouse-2: find this node in other window"))
(unless (direx:item-open item)
(direx:item-expand item)))

(defun direx:item-expand-recursively (item)
(direx:item-expand item)
(dolist (child (direx:item-children item))
(direx:item-expand-recursively child)))

(defun direx:item-collapse (item)
(unless (direx:item-leaf-p item)
(setf (direx:item-open item) nil)
Expand Down Expand Up @@ -786,6 +791,12 @@ mouse-2: find this node in other window"))
(direx:item-expand item)
(direx:move-to-item-name-part item)))

(defun direx:expand-item-recursively ()
(interactive)
(let ((item (direx:item-at-point!)))
(direx:item-expand-recursively item)
(direx:move-to-item-name-part item)))

(defun direx:collapse-item ()
(interactive)
(let ((item (direx:item-at-point!)))
Expand Down Expand Up @@ -831,6 +842,7 @@ mouse-2: find this node in other window"))
(define-key map (kbd "RET") 'direx:maybe-find-item)
(define-key map (kbd "TAB") 'direx:toggle-item)
(define-key map (kbd "i") 'direx:toggle-item)
(define-key map (kbd "E") 'direx:expand-item-recursively)
(define-key map (kbd "g") 'direx:refresh-whole-tree)
(define-key map [mouse-1] 'direx:mouse-1)
(define-key map [mouse-2] 'direx:mouse-2)
Expand Down

0 comments on commit ba8b950

Please sign in to comment.