Skip to content
This repository has been archived by the owner on Apr 25, 2020. It is now read-only.

Commit

Permalink
preventing "unused variable" warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
kazu-yamamoto committed Aug 20, 2015
1 parent 2451071 commit 531a731
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 22 deletions.
7 changes: 3 additions & 4 deletions elisp/ghc-check.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down Expand Up @@ -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")))))

Expand Down
2 changes: 1 addition & 1 deletion elisp/ghc-doc.el
Original file line number Diff line number Diff line change
Expand Up @@ -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\"
Expand Down
17 changes: 10 additions & 7 deletions elisp/ghc-func.el
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Expand All @@ -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 ()))))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions elisp/ghc-indent.el
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down
2 changes: 1 addition & 1 deletion elisp/ghc-info.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion elisp/ghc-process.el
Original file line number Diff line number Diff line change
Expand Up @@ -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))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Expand Down
9 changes: 3 additions & 6 deletions elisp/ghc-rewrite.el
Original file line number Diff line number Diff line change
Expand Up @@ -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))))
Expand Down

0 comments on commit 531a731

Please sign in to comment.