]> code.delx.au - gnu-emacs-elpa/commitdiff
Merge remote-tracking branch 'ztree/master'
authorAlexey Veretennikov <alexey.veretennikov@gmail.com>
Sat, 13 Jun 2015 09:19:44 +0000 (11:19 +0200)
committerAlexey Veretennikov <alexey.veretennikov@gmail.com>
Sat, 13 Jun 2015 09:19:44 +0000 (11:19 +0200)
Added added variable ztree-dir-move-focus; if set move the focus
to opened editor window when the user press Enter

1  2 
packages/ztree/ztree-dir.el

index 7506b8469d67948739c269dee186c3cfaf7b727c,d52aef149b292d6100791b8c00b9415d0951ad31..d52aef149b292d6100791b8c00b9415d0951ad31
    "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
  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)