]> code.delx.au - gnu-emacs-elpa/commitdiff
All files now uses the lexical-binding
authorAlexey Veretennikov <txm.fourier@gmail.com>
Sat, 13 Jun 2015 20:28:20 +0000 (22:28 +0200)
committerAlexey Veretennikov <txm.fourier@gmail.com>
Sat, 13 Jun 2015 20:28:20 +0000 (22:28 +0200)
ztree-diff-model.el
ztree-diff.el
ztree-dir.el
ztree-util.el
ztree-view.el
ztree.el

index ed459f22454787bb8aa61dfb687aa108b19bbecd..b68631e052eb8d06330f06521bd7b1010648a21b 100644 (file)
@@ -1,4 +1,4 @@
-;;; ztree-diff-model.el --- diff model for directory trees
+;;; ztree-diff-model.el --- diff model for directory trees -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 2013-2015  Free Software Foundation, Inc.
 ;;
@@ -79,7 +79,7 @@
             "\n"
             " * Children: " ch-str
             "\n")))
-                          
+
 
 (defun ztree-diff-node-short-name-wrapper (node &optional right-side)
   "Return the short name of the NODE given.
@@ -157,12 +157,12 @@ Filters out . and .."
                (file-exists-p left)
                (file-exists-p right))
       (if isdir
-        (let ((traverse (ztree-diff-node-traverse
-                         node
-                         left
-                         right)))
-          (ztree-diff-node-set-different node (car traverse))
-          (ztree-diff-node-set-children node (cdr traverse)))
+          (let ((traverse (ztree-diff-node-traverse
+                           node
+                           left
+                           right)))
+            (ztree-diff-node-set-different node (car traverse))
+            (ztree-diff-node-set-children node (cdr traverse)))
         ;; node is a file
         (ztree-diff-node-set-different
          node
@@ -341,7 +341,7 @@ the rest is the combined list of nodes."
     (ztree-diff-node-set-children node (cdr traverse))
     (ztree-diff-node-set-different node (car traverse))
     (message "Done.")))
-    
+
 
 
 (provide 'ztree-diff-model)
index f9eee13b7034fe9fc40332b5ef379d70ca322660..cd7a353e235aea2c2f880629ed81a7d720480101 100644 (file)
@@ -1,4 +1,4 @@
-;;; ztree-diff.el --- Text mode diff for directory trees
+;;; ztree-diff.el --- Text mode diff for directory trees -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 2013-2015  Free Software Foundation, Inc.
 ;;
@@ -114,10 +114,10 @@ By default paths starting with dot (like .git) are ignored")
   (insert "\n")
   (when ztree-diff-dirs-pair
     (ztree-insert-with-face (concat "Left:  " (car ztree-diff-dirs-pair))
-                      ztreep-diff-header-small-face)
+                            ztreep-diff-header-small-face)
     (insert "\n")
     (ztree-insert-with-face (concat "Right: " (cdr ztree-diff-dirs-pair))
-                      ztreep-diff-header-small-face)
+                            ztreep-diff-header-small-face)
     (insert "\n"))
   (ztree-insert-with-face "Legend:" ztreep-diff-header-small-face)
   (insert "\n")
@@ -151,7 +151,7 @@ By default paths starting with dot (like .git) are ignored")
              (file-exists-p right))
         node
       nil)))
-      
+
 (defun ztree-diff-existing-common-parent (node)
   "Return the first node in up in hierarchy of the NODE which has both sides."
   (let ((common (ztree-diff-existing-common node)))
@@ -170,7 +170,7 @@ By default paths starting with dot (like .git) are ignored")
         (ztree-diff-model-partial-rescan common)
         (ztree-diff-node-update-all-parents-diff node)
         (ztree-refresh-buffer (line-number-at-pos))))))
-  
+
 
 (defun ztree-diff-partial-rescan ()
   "Perform partial rescan on the current node."
@@ -178,7 +178,7 @@ By default paths starting with dot (like .git) are ignored")
   (let ((found (ztree-find-node-at-point)))
     (when found
       (ztree-diff-do-partial-rescan (car found)))))
-  
+
 
 (defun ztree-diff-simple-diff (node)
   "Create a simple diff buffer for files from left and right panels.
@@ -213,7 +213,7 @@ Argument NODE node containing paths to files to call a diff on."
 2 if left or right present - view left or rigth"
   (let ((left (ztree-diff-node-left-path node))
         (right (ztree-diff-node-right-path node))
-        (open-f '(lambda (path) (if hard (find-file path)
+        (open-f #'(lambda (path) ((insert )f hard (find-file path)
                                   (let ((split-width-threshold nil))
                                     (view-file-other-window path))))))
     (cond ((and left right)
@@ -225,7 +225,7 @@ Argument NODE node containing paths to files to call a diff on."
           (left (funcall open-f left))
           (right (funcall open-f right))
           (t nil))))
-           
+
 
 
 (defun ztree-diff-copy-file (node source-path destination-path copy-to-right)
@@ -258,7 +258,7 @@ COPY-TO-RIGHT specifies which side of the NODE to update."
 
 
 (defun ztree-diff-copy-dir (node source-path destination-path copy-to-right)
-    "Update the NODE status and copy the directory.
+  "Update the NODE status and copy the directory.
 Directory copied from SOURCE-PATH to DESTINATION-PATH.
 COPY-TO-RIGHT specifies which side of the NODE to update."
   (let* ((src-path (file-name-as-directory source-path))
@@ -352,7 +352,7 @@ COPY-TO-RIGHT specifies which side of the NODE to update."
                 ((and (eq side 'right)
                       node-right)
                  (view-file node-right))))))))
-  
+
 
 (defun ztree-diff-delete-file ()
   "Delete the file under the cursor."
@@ -447,7 +447,7 @@ Argument DIR2 right directory."
     (ztreediff-mode)
     (setq ztree-diff-dirs-pair (cons dir1 dir2))
     (ztree-refresh-buffer)))
-          
+
 
 
 
index 60ad9571d62cb36f2daeba7579ffb9fc9e1a7982..3dd87b7f78e462f598a0b939b6956fc1c52a3c5f 100644 (file)
@@ -1,4 +1,4 @@
-;;; ztree-dir.el --- Text mode directory tree
+;;; ztree-dir.el --- Text mode directory tree -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 2013-2015  Free Software Foundation, Inc.
 ;;
index 28193acac0da9ebcd98e2331f5c8229cd4d0d8d8..85df4446d6203e71975563c536ecd84035577543 100644 (file)
@@ -1,4 +1,4 @@
-;;; ztree-util.el --- Auxulary utilities for the ztree package
+;;; ztree-util.el --- Auxulary utilities for the ztree package -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 2013-2015  Free Software Foundation, Inc.
 ;;
@@ -100,19 +100,19 @@ To test expansion one can use GNU Emacs's pp library:
        (defun ,ctor-name (,@record-fields)
          (let ((,rec-var))
            ,@(mapcar #'(lambda (x)
-                      (list 'setq rec-var (list 'plist-put rec-var (list 'quote x) x)))
-                    record-fields)))
+                         (list 'setq rec-var (list 'plist-put rec-var (list 'quote x) x)))
+                     record-fields)))
        ;; getters with names "record-name-field" where the "field"
        ;; is from record-fields
        ,@(mapcar #'(lambda (x)
-                    (let ((getter-name (intern (concat (symbol-name record-name)
-                                                       "-"
-                                                       (symbol-name x)))))
-                      `(progn
-                         (defun ,getter-name (,rec-var)
-                           (plist-get ,rec-var ',x)
-                           ))))
-                record-fields)
+                     (let ((getter-name (intern (concat (symbol-name record-name)
+                                                        "-"
+                                                        (symbol-name x)))))
+                       `(progn
+                          (defun ,getter-name (,rec-var)
+                            (plist-get ,rec-var ',x)
+                            ))))
+                 record-fields)
        ;; setters wit names "record-name-set-field where the "field"
        ;; is from record-fields
        ;; arguments for setters: (record value)
index 89ae094cb35e11c1ce5727dfede9994fa9a203bc..519097b8e463a2cac54d69547a7182f5f8f4c935 100644 (file)
@@ -1,4 +1,4 @@
-;;; ztree-view.el --- Text mode tree view (buffer)
+;;; ztree-view.el --- Text mode tree view (buffer) -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 2013-2015  Free Software Foundation, Inc.
 ;;
@@ -191,7 +191,7 @@ or nil if there is no node"
         (node (ztree-find-node-in-line (line-number-at-pos))))
     (when node
       (cons node (if (> (current-column) center) 'right 'left)))))
-  
+
 
 (defun ztree-is-expanded-node (node)
   "Find if the NODE is in the list of expanded nodes."
@@ -225,7 +225,7 @@ Argument STATE node state."
       (dolist (child children)
         (ztree-do-toggle-expand-subtree-iter child state)))))
 
-     
+
 (defun ztree-do-toggle-expand-subtree ()
   "Implements the subtree expand."
   (let* ((line (line-number-at-pos))
@@ -241,7 +241,7 @@ Argument STATE node state."
       (ztree-refresh-buffer line)
       ;; restore window start position
       (set-window-start (selected-window) current-pos))))
-          
+
 
 (defun ztree-do-perform-action (hard)
   "Toggle expand/collapsed state for nodes or perform an action.
@@ -262,7 +262,7 @@ should be performed on node."
         (ztree-refresh-buffer line)
         ;; restore window start position
         (set-window-start (selected-window) current-pos)))))
-  
+
 
 (defun ztree-perform-action ()
   "Toggle expand/collapsed state for nodes or perform the action.
@@ -291,7 +291,7 @@ Performs the soft action, binded on Space, on node."
              ztree-expanded-nodes-list))
     (push node ztree-expanded-nodes-list)))
 
-   
+
 (defun ztree-toggle-expand-state (node)
   "Toggle expanded/collapsed state for NODE."
   (ztree-do-toggle-expand-state node (not (ztree-is-expanded-node node))))
@@ -322,15 +322,15 @@ then close the node."
 Argument NODE node which contents will be returned."
   (let ((nodes (funcall ztree-node-contents-fun node))
         (comp  #'(lambda (x y)
-                 (string< (funcall ztree-node-short-name-fun x)
-                          (funcall ztree-node-short-name-fun y)))))
+                   (string< (funcall ztree-node-short-name-fun x)
+                            (funcall ztree-node-short-name-fun y)))))
     (cons (sort (ztree-filter
                  #'(lambda (f) (funcall ztree-node-is-expandable-fun f))
                  nodes) comp)
           (sort (ztree-filter
                  #'(lambda (f) (not (funcall ztree-node-is-expandable-fun f)))
                  nodes) comp))))
-                
+
 
 (defun ztree-draw-char (c x y &optional face)
   "Draw char C at the position (1-based) (X Y).
@@ -497,7 +497,7 @@ Argument PATH start node."
           (when (funcall ztree-node-showp-fun leaf)
             ;; insert the leaf and add it to children
             (push (ztree-insert-entry leaf (1+ depth) nil)
-                    children)))))
+                  children)))))
     ;; result value is the list - head is the root line,
     ;; rest are children
     (cons root-line children)))
index 79e6fe6d2b68e5f17192228ffe4c8c1b3cb00703..2f739aa9b61da3f1e204e7b80f0fa57dbb425bec 100644 (file)
--- a/ztree.el
+++ b/ztree.el
@@ -1,4 +1,4 @@
-;;; ztree.el --- Text mode directory tree
+;;; ztree.el --- Text mode directory tree -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 2013-2015  Free Software Foundation, Inc.
 ;;