From 531a731da1991c74d675431624fac14ad83ca1a0 Mon Sep 17 00:00:00 2001 From: Kazu Yamamoto Date: Wed, 19 Aug 2015 15:37:41 +0900 Subject: [PATCH] preventing "unused variable" warnings. --- elisp/ghc-check.el | 7 +++---- elisp/ghc-doc.el | 2 +- elisp/ghc-func.el | 17 ++++++++++------- elisp/ghc-indent.el | 4 ++-- elisp/ghc-info.el | 2 +- elisp/ghc-process.el | 2 +- elisp/ghc-rewrite.el | 9 +++------ 7 files changed, 21 insertions(+), 22 deletions(-) diff --git a/elisp/ghc-check.el b/elisp/ghc-check.el index 5819a17..d02142a 100644 --- a/elisp/ghc-check.el +++ b/elisp/ghc-check.el @@ -295,14 +295,13 @@ nil do not display errors/warnings. (let ((file-msgs (ghc-get-only-holes))) (if (null file-msgs) (message "No holes") - (let ((file (ghc-file-msgs-get-file file-msgs)) - (msgs (ghc-file-msgs-get-msgs file-msgs))) + (let ((msgs (ghc-file-msgs-get-msgs file-msgs))) (ghc-display nil (lambda () (progn (mapc (lambda (x) (insert x "\n\n")) msgs) - (buttonize-buffer)) )))))) + (buttonize-buffer)))))))) (defun ghc-display-holes-to-minibuf () (let ((file-msgs (ghc-get-only-holes))) @@ -479,7 +478,7 @@ nil do not display errors/warnings. (forward-line) (re-search-forward "^$" nil t) (insert fn) - (dotimes (i arity) + (dotimes (_i arity) (insert " _")) (insert " = error \"" fn "\"\n"))))) diff --git a/elisp/ghc-doc.el b/elisp/ghc-doc.el index 512fa7d..42790dd 100644 --- a/elisp/ghc-doc.el +++ b/elisp/ghc-doc.el @@ -54,7 +54,7 @@ (defconst ghc-doc-hackage-format "http://hackage.haskell.org/packages/archive/%s/%s/doc/html/%s.html") -(defun ghc-browse-url-safari (uri &rest args) +(defun ghc-browse-url-safari (uri &rest _args) "Open a URI in Safari using AppleScript. This preserves anchors." (let ((script (format " tell application \"Safari\" diff --git a/elisp/ghc-func.el b/elisp/ghc-func.el index 83d1840..34eff59 100644 --- a/elisp/ghc-func.el +++ b/elisp/ghc-func.el @@ -18,9 +18,10 @@ (defun ghc-replace-character (string from to) "Replace characters equal to FROM to TO in STRING." (let ((ret (copy-sequence string))) - (dotimes (cnt (length ret) ret) + (dotimes (cnt (length ret)) (if (char-equal (aref ret cnt) from) - (aset ret cnt to))))) + (aset ret cnt to))) + ret)) (defun ghc-replace-character-buffer (from-c to-c) (let ((from (char-to-string from-c)) @@ -66,7 +67,7 @@ (dolist (lst lol) (dolist (key lst) (puthash key key hash))) - (maphash (lambda (key val) (ghc-add ret key)) hash) + (maphash (lambda (key _val) (ghc-add ret key)) hash) ret)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -90,8 +91,9 @@ (condition-case nil (let ((m (set-marker (make-marker) 1 (current-buffer))) ret) - (dotimes (i n (nreverse ret)) - (ghc-add ret (read m)))) + (dotimes (_i n) + (ghc-add ret (read m))) + (nreverse ret)) (error ())))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -108,10 +110,11 @@ (defun ghc-keyword-number-pair (spec) (let ((len (length spec)) key ret) - (dotimes (i len (nreverse ret)) + (dotimes (i len) (setq key (intern (concat ":" (symbol-name (car spec))))) (setq ret (cons (cons key i) ret)) - (setq spec (cdr spec))))) + (setq spec (cdr spec))) + (nreverse ret))) (defmacro ghc-defstruct (type &rest spec) `(progn diff --git a/elisp/ghc-indent.el b/elisp/ghc-indent.el index 3f1de9e..519cce5 100644 --- a/elisp/ghc-indent.el +++ b/elisp/ghc-indent.el @@ -10,11 +10,11 @@ (defvar ghc-indent-offset 4) -(defun ghc-make-indent-shallower (beg end) +(defun ghc-make-indent-shallower (_beg _end) (interactive "r") (indent-rigidly (region-beginning) (region-end) (- ghc-indent-offset))) -(defun ghc-make-indent-deeper (beg end) +(defun ghc-make-indent-deeper (_beg _end) (interactive "r") (indent-rigidly (region-beginning) (region-end) ghc-indent-offset)) diff --git a/elisp/ghc-info.el b/elisp/ghc-info.el index d7854c5..abe4356 100644 --- a/elisp/ghc-info.el +++ b/elisp/ghc-info.el @@ -63,7 +63,7 @@ (cons 'ghc-type-clear-overlay after-change-functions)) (add-hook 'post-command-hook 'ghc-type-post-command-hook)) -(defun ghc-type-clear-overlay (&optional beg end len) +(defun ghc-type-clear-overlay (&optional _beg _end _len) (when (overlayp ghc-type-overlay) (ghc-type-set-ix 0) (ghc-type-set-point 0) diff --git a/elisp/ghc-process.el b/elisp/ghc-process.el index 94dc5d7..3e0c4a5 100644 --- a/elisp/ghc-process.el +++ b/elisp/ghc-process.el @@ -141,7 +141,7 @@ (funcall ghc-process-callback 'ng) (setq ghc-process-running nil))))))) -(defun ghc-process-sentinel (process event) +(defun ghc-process-sentinel (_process _event) (setq ghc-process-running nil)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/elisp/ghc-rewrite.el b/elisp/ghc-rewrite.el index e8087a9..20f7f69 100644 --- a/elisp/ghc-rewrite.el +++ b/elisp/ghc-rewrite.el @@ -126,12 +126,9 @@ (lambda () (insert "Possible completions:\n") (mapc - (lambda (x) - (let* (; (ins1 (insert "- ")) - (pos-begin (point)) - (ins (insert x)) - (pos-end (point)) - (ins3 (insert "\n"))) + (lambda (_x) + (let ((pos-begin (point)) + (pos-end (point))) (make-button pos-begin pos-end :type 'auto-button))) (ghc-sinfo-get-info info)))) (select-window (ghc-auto-completion-window))))