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

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

[elpa] master 9de243f 1/2: Issue #17: added variable ztree-dir-move-focu


From: Alexey Veretennikov
Subject: [elpa] master 9de243f 1/2: Issue #17: added variable ztree-dir-move-focus; if set move the focus to opened editor window when press Enter
Date: Sat, 13 Jun 2015 09:20:35 +0000

branch: master
commit 9de243f06906cb3e824c2bbe3d75fd1f3661c5e3
Author: Alexey Veretennikov <address@hidden>
Commit: Alexey Veretennikov <address@hidden>

    Issue #17: added variable ztree-dir-move-focus; if set move the focus to 
opened editor window when press Enter
---
 ztree-dir.el |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/ztree-dir.el b/ztree-dir.el
index 7506b84..d52aef1 100644
--- a/ztree-dir.el
+++ b/ztree-dir.el
@@ -54,6 +54,14 @@
   "Hidden files regexp.
 By default all filest starting with dot '.', including . and ..")
 
+;;
+;; Configurable variables
+;; 
+
+(defvar ztree-dir-move-focus nil
+  "If set to true moves the focus to opened window when the
+user press RETURN on file ")t
+
 
 ;;
 ;; Faces
@@ -92,9 +100,12 @@ By default all filest starting with dot '.', including . 
and ..")
 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))))
+    (cond ((and hard ztree-dir-move-focus)
+           (find-file-other-window node))
+          (hard
+           (save-selected-window (find-file-other-window node)))
+          (t 
+           (find-file node)))))
 
 ;;;###autoload
 (defun ztree-dir (path)



reply via email to

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