emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master da721ab 33/36: Fixed compile warnings


From: Alexey Veretennikov
Subject: [elpa] master da721ab 33/36: Fixed compile warnings
Date: Wed, 27 Jan 2016 23:50:59 +0000

branch: master
commit da721ab7540174801c1cbef759e09dc202f8b699
Author: Alexey Veretennikov <address@hidden>
Commit: Alexey Veretennikov <address@hidden>

    Fixed compile warnings
---
 ztree-diff.el |    4 ++--
 ztree-view.el |   24 +++++++++++-------------
 2 files changed, 13 insertions(+), 15 deletions(-)

diff --git a/ztree-diff.el b/ztree-diff.el
index 006d7cf..3793cbb 100644
--- a/ztree-diff.el
+++ b/ztree-diff.el
@@ -445,8 +445,8 @@ COPY-TO-RIGHT specifies which side of the NODE to update."
                        (if delete-from-left
                            #'ztree-diff-node-set-left-path
                          #'ztree-diff-node-set-right-path)))
-                  (mapcar (lambda (x) (funcall update-fun x nil))
-                          (cons node (ztree-diff-node-children node))))
+                  (mapc (lambda (x) (funcall update-fun x nil))
+                        (cons node (ztree-diff-node-children node))))
                 ;; and update diff status
                 ;; if was ignored keep the old status
                 (unless (eql (ztree-diff-node-different node) 'ignore)
diff --git a/ztree-view.el b/ztree-view.el
index d1aa586..9e8920d 100644
--- a/ztree-view.el
+++ b/ztree-view.el
@@ -163,7 +163,9 @@ the buffer is split to 2 trees")
 (define-derived-mode ztree-mode special-mode "Ztree"
   "A major mode for displaying the directory tree in text mode."
   ;; only spaces
-  (setq indent-tabs-mode nil))
+  (setq indent-tabs-mode nil)
+  (setq        buffer-read-only t))
+
 
 (defun ztree-find-node-in-line (line)
   "Return the node for the LINE specified.
@@ -570,8 +572,7 @@ Optional argument FACE face to write text with."
     (delete-region (point) (line-end-position))
     ;; every indentation level is 4 characters
     (when (> depth 0)
-      (dotimes (i depth)
-        (insert-char ?\s 4)))           ; insert 4 spaces
+      (insert-char ?\s (* 4 depth)))           ; insert 4 spaces
     (when (> (length short-name) 0)
       (let ((start-pos (point)))
         (if expandable
@@ -606,13 +607,12 @@ Optional argument LINE scroll to the line given."
     ;; used in 2-side tree mode
     (when ztree-node-side-fun
       (setq ztree-line-tree-properties (make-hash-table)))
-    (toggle-read-only)
-    (erase-buffer)
-    (funcall ztree-tree-header-fun)
-    (setq ztree-start-line (line-number-at-pos (point)))
-    (ztree-insert-node-contents ztree-start-node)
-    (scroll-to-line (if line line ztree-start-line))
-    (toggle-read-only)))
+    (let ((buffer-read-only nil))
+      (erase-buffer)
+      (funcall ztree-tree-header-fun)
+      (setq ztree-start-line (line-number-at-pos (point)))
+      (ztree-insert-node-contents ztree-start-node)
+      (scroll-to-line (if line line ztree-start-line)))))
 
 
 (defun ztree-view (
@@ -628,7 +628,6 @@ Optional argument LINE scroll to the line given."
                    action-fun
                    &optional
                    node-side-fun
-                   post-create-hook
                    )
   "Create a ztree view buffer configured with parameters given.
 Argument BUFFER-NAME Name of the buffer created.
@@ -643,8 +642,7 @@ Argument EQUAL-FUN An equality function for nodes.
 Argument CHILDREN-FUN Function to get children from the node.
 Argument FACE-FUN Function to determine face of the node.
 Argument ACTION-FUN an action to perform when the Return is pressed.
-Optional argument NODE-SIDE-FUN Determines the side of the node.
-Optional argument POST-CREATE-FUN"
+Optional argument NODE-SIDE-FUN Determines the side of the node."
   (let ((buf (get-buffer-create buffer-name)))
     (switch-to-buffer buf)
     (ztree-mode)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]