emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 557024f 72/92: Merge pull request #6 from jpkotta/master


From: Alexey Veretennikov
Subject: [elpa] master 557024f 72/92: Merge pull request #6 from jpkotta/master
Date: Thu, 11 Jun 2015 19:48:16 +0000

branch: master
commit 557024f975550130542ab55031a0c2083fb4c1ea
Merge: b772a0c 4086298
Author: Alexey Veretennikov <address@hidden>
Commit: Alexey Veretennikov <address@hidden>

    Merge pull request #6 from jpkotta/master
    
    add ztree-find-file as the action for ztree-dir
---
 ztree-dir.el |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/ztree-dir.el b/ztree-dir.el
index d321d16..64edaed 100644
--- a/ztree-dir.el
+++ b/ztree-dir.el
@@ -89,6 +89,16 @@ including . and ..")
   (not (string-match ztree-hidden-files-regexp
                      (file-short-name filename))))
 
+(defun ztree-find-file (node hard)
+  "Finds the file at NODE.
+
+If HARD is non-nil, the file is opened in another window.
+Otherwise, the ztree window is used to find the file."
+  (when (and (stringp node) (file-readable-p node))
+    (if hard
+        (save-selected-window (find-file-other-window node))
+      (find-file node))))
+
 ;;;###autoload
 (defun ztree-dir (path)
   "Creates an interactive buffer with the directory tree of the path given"
@@ -104,7 +114,7 @@ including . and ..")
                   'string-equal
                   '(lambda (x) (directory-files x 'full))
                   nil                   ; face
-                  nil))))               ; action
+                  'ztree-find-file)))) ; action
 
 
 (provide 'ztree-dir)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]