[elpa] master updated (4f9c5f4 -> 4e0df28)
fourier pushed a change to branch master. from 4f9c5f4 * cl-lib/cl-lib.el: Make it work for Emacs-21. Bump version to 0.6 new dc4df88 Fix about cl-lib new 497605f Merge pull request #41 from syohex/cl-lib new e1009bb Issue #42: Added support for narrow/widen in ztree-dir. new 9aae752 Fix TRAMP regression new 87c9714 Merge pull request #43 from dvzubarev/tramp-fix new 3a4df17 Updated docstrings and bumped version new 4e0df28 1) Implemented feature: narrow/widen directories in ztree-dir 2) Fixed regression in TRAMP mode while in ztree-diff 3) Updated docstrings. Summary of changes: packages/ztree/ztree-diff-model.el | 14 - packages/ztree/ztree-diff.el |2 +- packages/ztree/ztree-dir.el| 40 +--- packages/ztree/ztree-util.el | 16 ++- packages/ztree/ztree-view.el | 27 ++-- packages/ztree/ztree.el|2 +- 6 files changed, 75 insertions(+), 26 deletions(-)
[elpa] master 497605f 2/7: Merge pull request #41 from syohex/cl-lib
branch: master commit 497605f3b4c1ca7e948655d4efe733d2154708f7 Merge: 2751b96 dc4df88 Author: Alexey Veretennikov Commit: GitHub Merge pull request #41 from syohex/cl-lib Fix about cl-lib --- ztree-dir.el |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ztree-dir.el b/ztree-dir.el index 7d866ff..600d965 100644 --- a/ztree-dir.el +++ b/ztree-dir.el @@ -45,7 +45,7 @@ (require 'ztree-util) (require 'ztree-view) -(eval-when-compile (require 'cl-lib)) +(require 'cl-lib) ;; ;; Constants @@ -149,8 +149,8 @@ Otherwise, the ztree window is used to find the file." "Returns the list of files/directories for the given PATH" ;; remove . and .. from the list of files to avoid infinite ;; recursion - (remove-if (lambda (x) (string-match-p "/\\.\\.?$" x)) - (directory-files path 'full))) + (cl-remove-if (lambda (x) (string-match-p "/\\.\\.?$" x)) +(directory-files path 'full)))
[elpa] master e1009bb 3/7: Issue #42: Added support for narrow/widen in ztree-dir.
branch: master commit e1009bb20576950a0a433a4910c15d1cf9327866 Author: Alexey Veretennikov Commit: Alexey Veretennikov Issue #42: Added support for narrow/widen in ztree-dir. In ztree-dir now it is possible to focus on directory under the cursor (or parent directory of the file under the cursor) using '>' hotkey. One can also widen to the to the parent of the root directory using '<' hotkey. This allows to navigate the whole filesystem without leaving the buffer. --- ztree-dir.el | 31 +-- ztree-util.el | 16 +++- ztree-view.el | 27 --- 3 files changed, 60 insertions(+), 14 deletions(-) diff --git a/ztree-dir.el b/ztree-dir.el index 600d965..5e7a509 100644 --- a/ztree-dir.el +++ b/ztree-dir.el @@ -61,7 +61,7 @@ By default all filest starting with dot `.', including . and ..") (defvar ztree-dir-move-focus nil "If set to true moves the focus to opened window when the -user press RETURN on file ") +user press RETURN on file") (defvar-local ztree-dir-filter-list (list ztree-hidden-files-regexp) "List of regexp file names to filter out. @@ -96,7 +96,9 @@ One could add own filters in the following way: " Dir" ;; The minor mode keymap `( -(,(kbd "H") . ztree-dir-toggle-show-filtered-files))) +(,(kbd "H") . ztree-dir-toggle-show-filtered-files) +(,(kbd ">") . ztree-dir-narrow-to-dir) +(,(kbd "<") . ztree-dir-widen-to-parent))) @@ -153,6 +155,31 @@ Otherwise, the ztree window is used to find the file." (directory-files path 'full))) +(defun ztree-dir-narrow-to-dir () + "Interactive command to narrow the current directory buffer. +The buffer is narrowed to the directory under the cursor. +If the cursor is on a file, the buffer is narrowed to the parent directory." + (interactive) + (let* ((line (line-number-at-pos)) + (node (ztree-find-node-in-line line)) + (parent (ztree-get-parent-for-line line))) +(if (file-directory-p node) +(ztree-change-start-node node) + (when parent +(ztree-change-start-node (ztree-find-node-in-line parent)) + + +(defun ztree-dir-widen-to-parent () + "Interactive command to widen the current directory buffer to parent. +The buffer is widened to the parent of the directory of the current buffer. +This allows to jump to the parent directory if this directory is one level +up of the opened." + (interactive) + (let* ((node ztree-start-node) + (parent (file-name-directory (directory-file-name node +(when parent + (ztree-change-start-node parent + ;;;###autoload (defun ztree-dir (path) diff --git a/ztree-util.el b/ztree-util.el index 39975b0..5ac764b 100644 --- a/ztree-util.el +++ b/ztree-util.el @@ -48,10 +48,17 @@ Taken from http://www.emacswiki.org/emacs/ElispCookbook#toc39"; Argument STRING string to process.'." (replace-regexp-in-string "\n" "" string)) + (defun ztree-file-short-name (file) "By given FILE name return base file/directory name. Taken from http://lists.gnu.org/archive/html/emacs-devel/2011-01/msg01238.html"; - (ztree-printable-string (file-name-nondirectory (directory-file-name file + (let* ((dir (directory-file-name file)) + (simple-dir (file-name-nondirectory dir))) +;; check if the root directory +(if (string= "" simple-dir) +dir + (ztree-printable-string simple-dir + (defun ztree-car-atom (value) "Return VALUE if value is an atom, otherwise (car value) or nil. @@ -79,6 +86,13 @@ Used since `car-safe' returns nil for atoms" (file2-remote (file-remote-p file2))) (string-equal file1-remote file2-remote))) + +(defun ztree-scroll-to-line (line) + "Recommended way to set the cursor to specified LINE." + (goto-char (point-min)) + (forward-line (1- line))) + + (provide 'ztree-util) ;;; ztree-util.el ends here diff --git a/ztree-view.el b/ztree-view.el index f1a9afd..8cf0ced 100644 --- a/ztree-view.el +++ b/ztree-view.el @@ -192,17 +192,13 @@ or nil if there is no node" "For given LINE set the PARENT in the global array." (aset ztree-parent-lines-array (- line ztree-start-line) parent)) + (defun ztree-get-parent-for-line (line) "For given LINE return a parent." (when (and (>= line ztree-start-line) (< line (+ (length ztree-parent-lines-array) ztree-start-line))) (aref ztree-parent-lines-array (- line ztree-start-line -(defun scroll-to-line (line) - "Recommended way to set the cursor to specified LINE." - (goto-char (point-min)) - (forward-line (1- line))) - (defun ztree-do-toggle-expand-subtree-iter (node state) "Iteration in expanding subtree. @@ -303,7 +299,7 @@ then close the node." (setq ztree-count-subsequent-bs t) (ztree-refresh-buffer line)) (progn (setq ztree-count-subsequent-bs nil) - (scroll-to-line parent))) + (ztr
[elpa] master 4e0df28 7/7: 1) Implemented feature: narrow/widen directories in ztree-dir
branch: master commit 4e0df28dfdaeb9a21cc394983d1c5a3ae424bef8 Merge: 4f9c5f4 3a4df17 Author: Alexey Veretennikov Commit: Alexey Veretennikov 1) Implemented feature: narrow/widen directories in ztree-dir 2) Fixed regression in TRAMP mode while in ztree-diff 3) Updated docstrings. Merge commit '3a4df17edddef84160194802acc034cfa2dbd678' --- packages/ztree/ztree-diff-model.el | 14 - packages/ztree/ztree-diff.el |2 +- packages/ztree/ztree-dir.el| 40 +--- packages/ztree/ztree-util.el | 16 ++- packages/ztree/ztree-view.el | 27 ++-- packages/ztree/ztree.el|2 +- 6 files changed, 75 insertions(+), 26 deletions(-) diff --git a/packages/ztree/ztree-diff-model.el b/packages/ztree/ztree-diff-model.el index 1f78d62..6f4c951 100644 --- a/packages/ztree/ztree-diff-model.el +++ b/packages/ztree/ztree-diff-model.el @@ -145,9 +145,9 @@ Returns t if equal." (error "Compared files are not on the same host")) (let* ((file1-untrampified (ztree-untrampify-filename file1)) (file2-untrampified (ztree-untrampify-filename file2))) -(if (or - (/= (nth 7 (file-attributes file1-untrampified)) -(nth 7 (file-attributes file2-untrampified))) +(if (or + (/= (nth 7 (file-attributes file1)) +(nth 7 (file-attributes file2))) (/= 0 (process-file diff-command nil nil nil "-q" file1-untrampified file2-untrampified))) @@ -374,8 +374,12 @@ which returns t if the node should be ignored (like files starting with dot etc)." (setf ztree-diff-model-ignore-fun ignore-p)) -(defun ztree-diff-model-set-progress-fun (progess-fun) - (setf ztree-diff-model-progress-fun progess-fun)) + +(defun ztree-diff-model-set-progress-fun (progress-fun) + "Setter for the buffer-local PROGRESS-FUN callback. +This callback is called to indicate the ongoing activity. +Callback is a function without arguments." + (setf ztree-diff-model-progress-fun progress-fun)) (provide 'ztree-diff-model) diff --git a/packages/ztree/ztree-diff.el b/packages/ztree/ztree-diff.el index c454709..a4bd012 100644 --- a/packages/ztree/ztree-diff.el +++ b/packages/ztree/ztree-diff.el @@ -499,7 +499,7 @@ unless it is a parent node." (defun ztree-diff-update-wait-message (&optional msg) - "Update the wait mesage with one more `.' progress indication." + "Update the wait message MSG with one more `.' progress indication." (if msg (setq ztree-diff-wait-message msg) (when ztree-diff-wait-message diff --git a/packages/ztree/ztree-dir.el b/packages/ztree/ztree-dir.el index 7d866ff..dada7d0 100644 --- a/packages/ztree/ztree-dir.el +++ b/packages/ztree/ztree-dir.el @@ -45,7 +45,7 @@ (require 'ztree-util) (require 'ztree-view) -(eval-when-compile (require 'cl-lib)) +(require 'cl-lib) ;; ;; Constants @@ -60,8 +60,7 @@ By default all filest starting with dot `.', including . and ..") ;; (defvar ztree-dir-move-focus nil - "If set to true moves the focus to opened window when the -user press RETURN on file ") + "Defines if move focus to opened window on hard-action command (RETURN) on a file.") (defvar-local ztree-dir-filter-list (list ztree-hidden-files-regexp) "List of regexp file names to filter out. @@ -96,7 +95,9 @@ One could add own filters in the following way: " Dir" ;; The minor mode keymap `( -(,(kbd "H") . ztree-dir-toggle-show-filtered-files))) +(,(kbd "H") . ztree-dir-toggle-show-filtered-files) +(,(kbd ">") . ztree-dir-narrow-to-dir) +(,(kbd "<") . ztree-dir-widen-to-parent))) @@ -146,13 +147,38 @@ Otherwise, the ztree window is used to find the file." (defun ztree-dir-directory-files (path) - "Returns the list of files/directories for the given PATH" + "Return the list of files/directories for the given PATH." ;; remove . and .. from the list of files to avoid infinite ;; recursion - (remove-if (lambda (x) (string-match-p "/\\.\\.?$" x)) - (directory-files path 'full))) + (cl-remove-if (lambda (x) (string-match-p "/\\.\\.?$" x)) +(directory-files path 'full))) +(defun ztree-dir-narrow-to-dir () + "Interactive command to narrow the current directory buffer. +The buffer is narrowed to the directory under the cursor. +If the cursor is on a file, the buffer is narrowed to the parent directory." + (interactive) + (let* ((line (line-number-at-pos)) + (node (ztree-find-node-in-line line)) + (parent (ztree-get-parent-for-line line))) +(if (file-directory-p node) +(ztree-change-start-node node) + (when parent +(ztree-change-start-node (ztree-find-node-in-line parent)) + + +(defun ztree-dir-widen-to-parent () + "Interactive command to widen the current directory buffer to parent. +The buffer is widened to the parent of the directory of
[elpa] master dc4df88 1/7: Fix about cl-lib
branch: master commit dc4df881c083606b1855e84297b47d8bb8ca12fb Author: Syohei YOSHIDA Commit: Syohei YOSHIDA Fix about cl-lib - Use cl-lib function instead of cl.el - Remove eval-when-compile for using cl-lib function --- ztree-dir.el |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ztree-dir.el b/ztree-dir.el index 7d866ff..600d965 100644 --- a/ztree-dir.el +++ b/ztree-dir.el @@ -45,7 +45,7 @@ (require 'ztree-util) (require 'ztree-view) -(eval-when-compile (require 'cl-lib)) +(require 'cl-lib) ;; ;; Constants @@ -149,8 +149,8 @@ Otherwise, the ztree window is used to find the file." "Returns the list of files/directories for the given PATH" ;; remove . and .. from the list of files to avoid infinite ;; recursion - (remove-if (lambda (x) (string-match-p "/\\.\\.?$" x)) - (directory-files path 'full))) + (cl-remove-if (lambda (x) (string-match-p "/\\.\\.?$" x)) +(directory-files path 'full)))
[elpa] master 3a4df17 6/7: Updated docstrings and bumped version
branch: master commit 3a4df17edddef84160194802acc034cfa2dbd678 Author: Alexey Veretennikov Commit: Alexey Veretennikov Updated docstrings and bumped version --- ztree-diff-model.el | 10 +++--- ztree-diff.el |2 +- ztree-dir.el|5 ++--- ztree.el|2 +- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/ztree-diff-model.el b/ztree-diff-model.el index c8dbeb2..6f4c951 100644 --- a/ztree-diff-model.el +++ b/ztree-diff-model.el @@ -145,7 +145,7 @@ Returns t if equal." (error "Compared files are not on the same host")) (let* ((file1-untrampified (ztree-untrampify-filename file1)) (file2-untrampified (ztree-untrampify-filename file2))) -(if (or +(if (or (/= (nth 7 (file-attributes file1)) (nth 7 (file-attributes file2))) (/= 0 (process-file diff-command nil nil nil "-q" @@ -374,8 +374,12 @@ which returns t if the node should be ignored (like files starting with dot etc)." (setf ztree-diff-model-ignore-fun ignore-p)) -(defun ztree-diff-model-set-progress-fun (progess-fun) - (setf ztree-diff-model-progress-fun progess-fun)) + +(defun ztree-diff-model-set-progress-fun (progress-fun) + "Setter for the buffer-local PROGRESS-FUN callback. +This callback is called to indicate the ongoing activity. +Callback is a function without arguments." + (setf ztree-diff-model-progress-fun progress-fun)) (provide 'ztree-diff-model) diff --git a/ztree-diff.el b/ztree-diff.el index c454709..a4bd012 100644 --- a/ztree-diff.el +++ b/ztree-diff.el @@ -499,7 +499,7 @@ unless it is a parent node." (defun ztree-diff-update-wait-message (&optional msg) - "Update the wait mesage with one more `.' progress indication." + "Update the wait message MSG with one more `.' progress indication." (if msg (setq ztree-diff-wait-message msg) (when ztree-diff-wait-message diff --git a/ztree-dir.el b/ztree-dir.el index 5e7a509..dada7d0 100644 --- a/ztree-dir.el +++ b/ztree-dir.el @@ -60,8 +60,7 @@ By default all filest starting with dot `.', including . and ..") ;; (defvar ztree-dir-move-focus nil - "If set to true moves the focus to opened window when the -user press RETURN on file") + "Defines if move focus to opened window on hard-action command (RETURN) on a file.") (defvar-local ztree-dir-filter-list (list ztree-hidden-files-regexp) "List of regexp file names to filter out. @@ -148,7 +147,7 @@ Otherwise, the ztree window is used to find the file." (defun ztree-dir-directory-files (path) - "Returns the list of files/directories for the given PATH" + "Return the list of files/directories for the given PATH." ;; remove . and .. from the list of files to avoid infinite ;; recursion (cl-remove-if (lambda (x) (string-match-p "/\\.\\.?$" x)) diff --git a/ztree.el b/ztree.el index dbe9911..d615f64 100644 --- a/ztree.el +++ b/ztree.el @@ -4,7 +4,7 @@ ;; ;; Author: Alexey Veretennikov ;; Created: 2013-11-11 -;; Version: 1.0.4 +;; Version: 1.0.5 ;; Package-Requires: ((cl-lib "0")) ;; Keywords: files tools ;; URL: https://github.com/fourier/ztree
[elpa] master 87c9714 5/7: Merge pull request #43 from dvzubarev/tramp-fix
branch: master commit 87c97145c7abb0670b36362e16aed68b3f4e28fd Merge: e1009bb 9aae752 Author: Alexey Veretennikov Commit: GitHub Merge pull request #43 from dvzubarev/tramp-fix Fix TRAMP regression --- ztree-diff-model.el |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ztree-diff-model.el b/ztree-diff-model.el index 1f78d62..c8dbeb2 100644 --- a/ztree-diff-model.el +++ b/ztree-diff-model.el @@ -146,8 +146,8 @@ Returns t if equal." (let* ((file1-untrampified (ztree-untrampify-filename file1)) (file2-untrampified (ztree-untrampify-filename file2))) (if (or - (/= (nth 7 (file-attributes file1-untrampified)) -(nth 7 (file-attributes file2-untrampified))) + (/= (nth 7 (file-attributes file1)) +(nth 7 (file-attributes file2))) (/= 0 (process-file diff-command nil nil nil "-q" file1-untrampified file2-untrampified)))
[elpa] master 9aae752 4/7: Fix TRAMP regression
branch: master commit 9aae752467272214de2930af8d91ef5070e42c91 Author: denin Commit: denin Fix TRAMP regression file-attributes accepts trampified paths, otherwise it looks for local files. --- ztree-diff-model.el |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ztree-diff-model.el b/ztree-diff-model.el index 1f78d62..c8dbeb2 100644 --- a/ztree-diff-model.el +++ b/ztree-diff-model.el @@ -146,8 +146,8 @@ Returns t if equal." (let* ((file1-untrampified (ztree-untrampify-filename file1)) (file2-untrampified (ztree-untrampify-filename file2))) (if (or - (/= (nth 7 (file-attributes file1-untrampified)) -(nth 7 (file-attributes file2-untrampified))) + (/= (nth 7 (file-attributes file1)) +(nth 7 (file-attributes file2))) (/= 0 (process-file diff-command nil nil nil "-q" file1-untrampified file2-untrampified)))