[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 2f888c5 26/92: Added util file
From: |
Alexey Veretennikov |
Subject: |
[elpa] master 2f888c5 26/92: Added util file |
Date: |
Thu, 11 Jun 2015 19:47:57 +0000 |
branch: master
commit 2f888c50039edd5afcb189759fd2eb176367bd28
Author: Alexey Veretennikov <address@hidden>
Commit: Alexey Veretennikov <address@hidden>
Added util file
---
ztree-util.el | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 54 insertions(+), 0 deletions(-)
diff --git a/ztree-util.el b/ztree-util.el
new file mode 100644
index 0000000..00690be
--- /dev/null
+++ b/ztree-util.el
@@ -0,0 +1,54 @@
+;;; ztree-util.el --- Auxulary utilities for the ztree package
+
+;; Copyright (C) 2013 Alexey Veretennikov
+;;
+;; Author: Alexey Veretennikov <alexey dot veretennikov at gmail dot com>
+;; Created: 2013-11-1l
+;; Version: 1.0.0
+;; Keywords: files
+;; URL: https://github.com/fourier/ztree
+;; Compatibility: GNU Emacs GNU Emacs 24.x
+;;
+;; This file is NOT part of GNU Emacs.
+;;
+;; This program is free software; you can redistribute it and/or
+;; modify it under the terms of the GNU General Public License
+;; as published by the Free Software Foundation; either version 2
+;; of the License, or (at your option) any later version.
+;;
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with this program. If not, see <http://www.gnu.org/licenses/>.
+;;
+;;; Commentary:
+
+(defun ztree-find (where which)
+ "find element of the list `where` matching predicate `which`"
+ (catch 'found
+ (dolist (elt where)
+ (when (funcall which elt)
+ (throw 'found elt)))
+ nil))
+
+(defun ztree-filter (condp lst)
+ "Filter out elements of the list `lst` not satisfying predicate `condp`.
+Taken from http://www.emacswiki.org/emacs/ElispCookbook#toc39"
+ (delq nil
+ (mapcar (lambda (x) (and (funcall condp x) x)) lst)))
+
+
+(defun printable-string (string)
+ "Strip newline character from file names, like 'Icon\n'"
+ (replace-regexp-in-string "\n" "" string))
+
+(defun file-short-name (file)
+ "Base file/directory name. Taken from
+ http://lists.gnu.org/archive/html/emacs-devel/2011-01/msg01238.html"
+ (printable-string (file-name-nondirectory (directory-file-name file))))
+
+
+(provide 'ztree-util)
- [elpa] master eb4ad8e 19/92: Removed test code!, (continued)
- [elpa] master eb4ad8e 19/92: Removed test code!, Alexey Veretennikov, 2015/06/11
- [elpa] master 457f48e 13/92: Updated readme, Alexey Veretennikov, 2015/06/11
- [elpa] master 33fe3a2 14/92: Added support for double backspace for closing open directories, Alexey Veretennikov, 2015/06/11
- [elpa] master 70d8bc5 17/92: Updated - aligned 80 chars in width, Alexey Veretennikov, 2015/06/11
- [elpa] master 5bbcfcf 18/92: Started diff model, Alexey Veretennikov, 2015/06/11
- [elpa] master b1de530 16/92: Isolated tree 'control' from the directory model, Alexey Veretennikov, 2015/06/11
- [elpa] master 7eb950e 22/92: Updated readme, Alexey Veretennikov, 2015/06/11
- [elpa] master 1279a61 28/92: Added face argument for ztree-draw-char and set face for vertical line in 2 trees mode, Alexey Veretennikov, 2015/06/11
- [elpa] master 120ffcb 15/92: Preparing to isolate ztree from directories api, Alexey Veretennikov, 2015/06/11
- [elpa] master 41d4c09 23/92: Fixed model issue when all files in added subtree looks like directories, Alexey Veretennikov, 2015/06/11
- [elpa] master 2f888c5 26/92: Added util file,
Alexey Veretennikov <=
- [elpa] master 41ab149 29/92: Added sorting to the tree, Alexey Veretennikov, 2015/06/11
- [elpa] master d0e255e 20/92: Implemented difftree model, Alexey Veretennikov, 2015/06/11
- [elpa] master a39e8c6 24/92: Started preparation for 2 column tree, Alexey Veretennikov, 2015/06/11
- [elpa] master 3260487 25/92: Preparing for the double tree drawing, Alexey Veretennikov, 2015/06/11
- [elpa] master 8685235 27/92: Added support for 2 trees, Alexey Veretennikov, 2015/06/11
- [elpa] master 28fa370 33/92: Reimplemented search for node by line using hash table, Alexey Veretennikov, 2015/06/11
- [elpa] master 413cff4 30/92: Drawing trees only to visible items, Alexey Veretennikov, 2015/06/11
- [elpa] master 161b1b3 35/92: Added messages, Alexey Veretennikov, 2015/06/11
- [elpa] master 9b91d44 31/92: Implemented colors support for different files, Alexey Veretennikov, 2015/06/11
- [elpa] master 44743c1 37/92: Added progress indication to the diff model, Alexey Veretennikov, 2015/06/11