[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master f9620df 34/92: Added action on modified files
From: |
Alexey Veretennikov |
Subject: |
[elpa] master f9620df 34/92: Added action on modified files |
Date: |
Thu, 11 Jun 2015 19:48:00 +0000 |
branch: master
commit f9620dfd5802915f42e5770ee054e75c31122a9d
Author: Alexey Veretennikov <address@hidden>
Commit: Alexey Veretennikov <address@hidden>
Added action on modified files
---
ztree-diff.el | 7 +++++++
ztree-view.el | 9 ++++++++-
ztree.el | 3 ++-
3 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/ztree-diff.el b/ztree-diff.el
index 84f7b37..0c44ad9 100644
--- a/ztree-diff.el
+++ b/ztree-diff.el
@@ -91,6 +91,12 @@ including . and ..")
(insert-with-face "==============" ztreep-diff-header-face)
(newline))
+(defun ztree-diff-model-action (node)
+ (let ((left (ztree-diff-model-get-left-path node))
+ (right (ztree-diff-model-get-right-path node)))
+ (when (and left right)
+ (ediff left right))))
+
(defun ztree-diff (dir1 dir2)
"Creates an interactive buffer with the directory tree of the path given"
(interactive "DLeft directory \nDRight directory ")
@@ -105,6 +111,7 @@ including . and ..")
'equal
'ztree-diff-model-children
'ztree-diff-model-face
+ 'ztree-diff-model-action
'ztree-diff-model-side)))
diff --git a/ztree-view.el b/ztree-view.el
index b3a5318..b83ea8b 100644
--- a/ztree-view.el
+++ b/ztree-view.el
@@ -123,6 +123,10 @@ the buffer is split to 2 trees")
"Function returning face for the node")
(make-variable-buffer-local 'ztree-node-face-fun)
+(defun ztree-node-action-fun nil
+ "Function called when Enter/Space pressed on the node")
+(make-variable-buffer-local 'ztree-node-action-fun)
+
;;
;; Major mode definitions
@@ -214,7 +218,8 @@ node for the line specified"
;; only for expandable nodes
(ztree-toggle-expand-state node)
;; do nothing leafs files for now
- nil)
+ (when ztree-node-action-fun
+ (funcall ztree-node-action-fun node)))
;; save the current window start position
(let ((current-pos (window-start)))
;; refresh buffer and scroll back to the saved line
@@ -496,6 +501,7 @@ apparently shall not be visible"
equal-fun
children-fun
face-fun
+ action-fun
&optional node-side-fun
)
(let ((buf (get-buffer-create buffer-name)))
@@ -511,6 +517,7 @@ apparently shall not be visible"
(setq ztree-node-equal-fun equal-fun)
(setq ztree-node-contents-fun children-fun)
(setq ztree-node-face-fun face-fun)
+ (setq ztree-node-action-fun action-fun)
(setq ztree-node-side-fun node-side-fun)
(ztree-refresh-buffer)))
diff --git a/ztree.el b/ztree.el
index f79c2c0..26f2ab2 100644
--- a/ztree.el
+++ b/ztree.el
@@ -99,7 +99,8 @@ including . and ..")
'file-directory-p
'string-equal
'(lambda (x) (directory-files x 'full))
- nil))))
+ nil ; face
+ nil)))) ; action
(provide 'ztree)
- [elpa] master a39e8c6 24/92: Started preparation for 2 column tree, (continued)
- [elpa] master a39e8c6 24/92: Started preparation for 2 column tree, Alexey Veretennikov, 2015/06/11
- [elpa] master 3260487 25/92: Preparing for the double tree drawing, Alexey Veretennikov, 2015/06/11
- [elpa] master 8685235 27/92: Added support for 2 trees, Alexey Veretennikov, 2015/06/11
- [elpa] master 28fa370 33/92: Reimplemented search for node by line using hash table, Alexey Veretennikov, 2015/06/11
- [elpa] master 413cff4 30/92: Drawing trees only to visible items, Alexey Veretennikov, 2015/06/11
- [elpa] master 161b1b3 35/92: Added messages, Alexey Veretennikov, 2015/06/11
- [elpa] master 9b91d44 31/92: Implemented colors support for different files, Alexey Veretennikov, 2015/06/11
- [elpa] master 44743c1 37/92: Added progress indication to the diff model, Alexey Veretennikov, 2015/06/11
- [elpa] master 99a0cf7 36/92: Started work for identifying parents in nodes, Alexey Veretennikov, 2015/06/11
- [elpa] master 291a115 32/92: Header is now customizable, Alexey Veretennikov, 2015/06/11
- [elpa] master f9620df 34/92: Added action on modified files,
Alexey Veretennikov <=
- [elpa] master 900c8fa 38/92: Refactored using defrecord macro, Alexey Veretennikov, 2015/06/11
- [elpa] master 6154ab8 21/92: Split view and models - for directory tree and for diff tree, Alexey Veretennikov, 2015/06/11
- [elpa] master 8335785 39/92: Added comment, Alexey Veretennikov, 2015/06/11
- [elpa] master 1ab3b48 43/92: Implemented file copying, Alexey Veretennikov, 2015/06/11
- [elpa] master af28a78 41/92: Started implementation of the copy functionality, Alexey Veretennikov, 2015/06/11
- [elpa] master 75b89a6 48/92: Fixed typo, Alexey Veretennikov, 2015/06/11
- [elpa] master 725f388 42/92: Preparation to copy implementation done, Alexey Veretennikov, 2015/06/11
- [elpa] master f78b859 47/92: Updated readme, Alexey Veretennikov, 2015/06/11
- [elpa] master 20d8217 44/92: Implemented directory copying, Alexey Veretennikov, 2015/06/11
- [elpa] master d590f88 40/92: Added minor mode for ztree diff, to create custom keybindings, Alexey Veretennikov, 2015/06/11