[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 70d8bc5 17/92: Updated - aligned 80 chars in width
From: |
Alexey Veretennikov |
Subject: |
[elpa] master 70d8bc5 17/92: Updated - aligned 80 chars in width |
Date: |
Thu, 11 Jun 2015 19:47:54 +0000 |
branch: master
commit 70d8bc513d768915b0c507743bd7e846047876f3
Author: Alexey Veretennikov <address@hidden>
Commit: Alexey Veretennikov <address@hidden>
Updated - aligned 80 chars in width
---
ztree.el | 44 ++++++++++++++++++++++++++++++--------------
1 files changed, 30 insertions(+), 14 deletions(-)
diff --git a/ztree.el b/ztree.el
index ac974f9..5a76e94 100644
--- a/ztree.el
+++ b/ztree.el
@@ -200,7 +200,8 @@ node name for the line specified"
(defun ztree-is-expanded-node (node)
"Find if the node is in the list of expanded nodes"
- (ztree-find ztree-expanded-nodes-list #'(lambda (x) (funcall
ztree-node-equal-fun x node))))
+ (ztree-find ztree-expanded-nodes-list
+ #'(lambda (x) (funcall ztree-node-equal-fun x node))))
(defun ztree-set-parent-for-line (line parent)
@@ -223,19 +224,26 @@ node name for the line specified"
(let* ((line (line-number-at-pos))
(node (ztree-find-node-in-line line)))
(when node
- (if (funcall ztree-node-is-expandable-fun node) ; only for expandable
nodes
+ (if (funcall ztree-node-is-expandable-fun node)
+ ;; only for expandable nodes
(ztree-toggle-expand-state node)
- nil) ; do nothing leafs files for now
- (let ((current-pos (window-start))) ; save the current window start
position
- (ztree-refresh-buffer line) ; refresh buffer and scroll back to the
saved line
- (set-window-start (selected-window) current-pos))))) ; restore window
start position
+ ;; do nothing leafs files for now
+ nil)
+ ;; save the current window start position
+ (let ((current-pos (window-start)))
+ ;; refresh buffer and scroll back to the saved line
+ (ztree-refresh-buffer line)
+ ;; restore window start position
+ (set-window-start (selected-window) current-pos)))))
(defun ztree-toggle-expand-state (node)
"Toggle expanded/collapsed state for nodes"
(if (ztree-is-expanded-node node)
- (setq ztree-expanded-nodes-list (ztree-filter #'(lambda (x) (not
(funcall ztree-node-equal-fun node x)))
- ztree-expanded-nodes-list))
+ (setq ztree-expanded-nodes-list
+ (ztree-filter
+ #'(lambda (x) (not (funcall ztree-node-equal-fun node x)))
+ ztree-expanded-nodes-list))
(push node ztree-expanded-nodes-list)))
@@ -262,8 +270,12 @@ if previous key was Backspace - close the node"
"Returns pair of 2 elements: list of expandable nodes and
list of leafs"
(let ((nodes (funcall ztree-node-contents-fun path)))
- (cons (ztree-filter #'(lambda (f) (funcall ztree-node-is-expandable-fun
f)) nodes)
- (ztree-filter #'(lambda (f) (not (funcall
ztree-node-is-expandable-fun f))) nodes))))
+ (cons (ztree-filter
+ #'(lambda (f) (funcall ztree-node-is-expandable-fun f))
+ nodes)
+ (ztree-filter
+ #'(lambda (f) (not (funcall ztree-node-is-expandable-fun f)))
+ nodes))))
(defun ztree-node-is-in-filter-list (node)
"Determine if the node is in filter list (and therefore
@@ -355,7 +367,8 @@ apparently shall not be visible"
(dolist (node nodes)
(let ((short-node-name (funcall ztree-node-short-name-fun node)))
(unless (ztree-node-is-in-filter-list short-node-name)
- (push (ztree-insert-node-contents-1 node (1+ offset))
children))))
+ (push (ztree-insert-node-contents-1 node (1+ offset))
+ children))))
(dolist (leaf leafs)
(let ((short-leaf-name (funcall ztree-node-short-name-fun leaf)))
(when (not (ztree-node-is-in-filter-list short-leaf-name))
@@ -380,11 +393,13 @@ apparently shall not be visible"
(progn
(funcall node-sign expanded) ; for expandable nodes insert "[+/-]"
(insert " ")
- (put-text-property 0 (length short-name) 'face 'ztreep-node-face
short-name)
+ (put-text-property 0 (length short-name)
+ 'face 'ztreep-node-face short-name)
(insert short-name))
(progn
(insert " ")
- (put-text-property 0 (length short-name) 'face 'ztreep-leaf-face
short-name)
+ (put-text-property 0 (length short-name)
+ 'face 'ztreep-leaf-face short-name)
(insert short-name)))
(push (cons node (line-number-at-pos)) ztree-node-to-line-list)
(newline)
@@ -422,7 +437,8 @@ apparently shall not be visible"
(replace-regexp-in-string "\n" "" string))
(defun file-short-name (file)
- "Base file/directory name. Taken from
http://lists.gnu.org/archive/html/emacs-devel/2011-01/msg01238.html"
+ "Base file/directory name. Taken from
+ http://lists.gnu.org/archive/html/emacs-devel/2011-01/msg01238.html"
(printable-string (file-name-nondirectory (directory-file-name file))))
- [elpa] master fd46405 09/92: Fixed recursion problem, (continued)
- [elpa] master fd46405 09/92: Fixed recursion problem, Alexey Veretennikov, 2015/06/11
- [elpa] master a0c9a9d 08/92: Updated readme, Alexey Veretennikov, 2015/06/11
- [elpa] master ffe7b3b 07/92: Updated readme, Alexey Veretennikov, 2015/06/11
- [elpa] master b43e0e7 12/92: Added header face, Alexey Veretennikov, 2015/06/11
- [elpa] master c7eb2c2 02/92: Initial import - fork from difftree, Alexey Veretennikov, 2015/06/11
- [elpa] master 7c739c4 11/92: Added faces for arrows and [+] signs, Alexey Veretennikov, 2015/06/11
- [elpa] master aa7f07a 10/92: Added Backspace support, Alexey Veretennikov, 2015/06/11
- [elpa] master eb4ad8e 19/92: Removed test code!, Alexey Veretennikov, 2015/06/11
- [elpa] master 457f48e 13/92: Updated readme, Alexey Veretennikov, 2015/06/11
- [elpa] master 33fe3a2 14/92: Added support for double backspace for closing open directories, Alexey Veretennikov, 2015/06/11
- [elpa] master 70d8bc5 17/92: Updated - aligned 80 chars in width,
Alexey Veretennikov <=
- [elpa] master 5bbcfcf 18/92: Started diff model, Alexey Veretennikov, 2015/06/11
- [elpa] master b1de530 16/92: Isolated tree 'control' from the directory model, Alexey Veretennikov, 2015/06/11
- [elpa] master 7eb950e 22/92: Updated readme, Alexey Veretennikov, 2015/06/11
- [elpa] master 1279a61 28/92: Added face argument for ztree-draw-char and set face for vertical line in 2 trees mode, Alexey Veretennikov, 2015/06/11
- [elpa] master 120ffcb 15/92: Preparing to isolate ztree from directories api, Alexey Veretennikov, 2015/06/11
- [elpa] master 41d4c09 23/92: Fixed model issue when all files in added subtree looks like directories, Alexey Veretennikov, 2015/06/11
- [elpa] master 2f888c5 26/92: Added util file, Alexey Veretennikov, 2015/06/11
- [elpa] master 41ab149 29/92: Added sorting to the tree, Alexey Veretennikov, 2015/06/11
- [elpa] master d0e255e 20/92: Implemented difftree model, Alexey Veretennikov, 2015/06/11
- [elpa] master a39e8c6 24/92: Started preparation for 2 column tree, Alexey Veretennikov, 2015/06/11