From: Alexey Veretennikov Date: Mon, 18 Jan 2016 22:21:14 +0000 (+0100) Subject: Fixed compile warnings X-Git-Url: https://code.delx.au/gnu-emacs-elpa/commitdiff_plain/da721ab7540174801c1cbef759e09dc202f8b699 Fixed compile warnings --- diff --git a/ztree-diff.el b/ztree-diff.el index 006d7cfec..3793cbb69 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 d1aa5867c..9e8920d98 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)