preventing "unused variable" warnings.

This commit is contained in:
Kazu Yamamoto 2015-08-19 15:37:41 +09:00
parent 24510719b8
commit 531a731da1
7 changed files with 21 additions and 22 deletions

View File

@ -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")))))

View File

@ -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\"

View File

@ -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

View File

@ -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))

View File

@ -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)

View File

@ -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))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

View File

@ -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))))