]> code.delx.au - gnu-emacs-elpa/blobdiff - packages/ztree/ztree-dir.el
Merge remote-tracking branch 'ztree/master'
[gnu-emacs-elpa] / packages / ztree / ztree-dir.el
index 7506b8469d67948739c269dee186c3cfaf7b727c..d52aef149b292d6100791b8c00b9415d0951ad31 100644 (file)
   "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)