diff --git a/ghc-core.el b/ghc-core.el index d0dd1c94f..6dbbe0167 100644 --- a/ghc-core.el +++ b/ghc-core.el @@ -1,4 +1,4 @@ -;;; ghc-core.el --- Syntax highlighting module for GHC Core +;;; ghc-core.el --- Syntax highlighting module for GHC Core -*- lexical-binding: t -*- ;; Copyright (C) 2010 Johan Tibell diff --git a/ghci-script-mode.el b/ghci-script-mode.el index bbf3f4622..320e717cf 100644 --- a/ghci-script-mode.el +++ b/ghci-script-mode.el @@ -1,4 +1,4 @@ -;;; ghci-script-mode.el --- GHCi scripts major mode +;;; ghci-script-mode.el --- GHCi scripts major mode -*- lexical-binding: t -*- ;; Copyright (c) 2014 Chris Done. All rights reserved. diff --git a/haskell-align-imports.el b/haskell-align-imports.el index 5ee9eb708..7681856b1 100644 --- a/haskell-align-imports.el +++ b/haskell-align-imports.el @@ -1,4 +1,4 @@ -;;; haskell-align-imports.el --- Align the import lines in a Haskell file +;;; haskell-align-imports.el --- Align the import lines in a Haskell file -*- lexical-binding: t -*- ;; Copyright (C) 2010 Chris Done diff --git a/haskell-bot.el b/haskell-bot.el index 5505e7b4b..522601bb5 100644 --- a/haskell-bot.el +++ b/haskell-bot.el @@ -1,4 +1,4 @@ -;;; haskell-bot.el --- A Lambdabot interaction mode +;;; haskell-bot.el --- A Lambdabot interaction mode -*- lexical-binding: t -*- ;; Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. ;; Copyright (C) 2001 Chris Webb diff --git a/haskell-cabal.el b/haskell-cabal.el index b659726b4..9a3bfca68 100644 --- a/haskell-cabal.el +++ b/haskell-cabal.el @@ -1,4 +1,4 @@ -;;; haskell-cabal.el --- Support for Cabal packages +;;; haskell-cabal.el --- Support for Cabal packages -*- lexical-binding: t -*- ;; Copyright (C) 2007, 2008 Stefan Monnier @@ -459,8 +459,7 @@ resultung buffer-content" (,beg (plist-get ,section :beginning)) (,end (plist-get ,section :end)) (,start-col (plist-get ,section :data-start-column)) - (,section-data (buffer-substring ,beg ,end)) - (section-name (plist-get ,section :name ))) + (,section-data (buffer-substring ,beg ,end))) (save-excursion (prog1 (with-temp-buffer @@ -534,8 +533,7 @@ resultung buffer-content" "Strip indentation from each line, execute FORMS and reinstate indentation so that the indentation of the FIRST LINE matches" (let ((old-l1-indent (make-symbol "new-l1-indent")) - (new-l1-indent (make-symbol "old-l1-indent")) - (res nil)) + (new-l1-indent (make-symbol "old-l1-indent"))) `(let ( (,old-l1-indent (save-excursion (goto-char (point-min)) (current-indentation)))) @@ -672,9 +670,9 @@ resultung buffer-content" (let ((downcase-name (downcase name))) (haskell-cabal-find-subsection-by section - '(lambda (subsection) + `(lambda (subsection) (string= (downcase (haskell-cabal-section-name subsection)) - downcase-name))))) + ,downcase-name))))) (defun haskell-cabal-goto-subsection (name) (let ((subsection (haskell-cabal-find-subsection (haskell-cabal-section) name))) @@ -807,7 +805,6 @@ Source names from main-is and c-sources sections are left untouched (if (null candidates) (let* ((src-dir (haskell-cabal-join-paths base-dir (or (car src-dirs) ""))) (newfile (haskell-cabal-join-paths src-dir filename)) - (subdir (file-name-directory newfile)) (do-create-p (y-or-n-p (format "Create file %s ?" newfile)))) (when do-create-p (find-file-other-window newfile ))) diff --git a/haskell-checkers.el b/haskell-checkers.el index ac4a28797..a8e81ecd8 100644 --- a/haskell-checkers.el +++ b/haskell-checkers.el @@ -1,4 +1,4 @@ -;;; haskell-checkers.el --- Emacs interface to haskell lint and style checkers +;;; haskell-checkers.el --- Emacs interface to haskell lint and style checkers -*- lexical-binding: t -*- ;; Copyright (C) 2009-2011 Alex Ott, Liam O'Reilly ;; @@ -128,13 +128,13 @@ (when (re-search-forward new-old-code eline t) (replace-match new-code nil t))))))) -(defun haskell-lint-finish-hook (buf msg) +(defun haskell-lint-finish-hook (_buf _msg) "Function, that is executed at the end of HLint or scan execution" (if haskell-checkers-replace-with-suggestions (haskell-lint-replace-suggestions) (next-error 1 t))) -(defun haskell-scan-finish-hook (buf msg) +(defun haskell-scan-finish-hook (_buf _msg) "Function, that is executed at the end of haskell-scan execution" (next-error 1 t)) diff --git a/haskell-collapse.el b/haskell-collapse.el index 71a416785..8f6df5461 100644 --- a/haskell-collapse.el +++ b/haskell-collapse.el @@ -1,4 +1,4 @@ -;;; haskell-collapse.el --- Collapse expressions +;;; haskell-collapse.el --- Collapse expressions -*- lexical-binding: t -*- ;; Copyright (c) 2014 Chris Done. All rights reserved. diff --git a/haskell-commands.el b/haskell-commands.el index 0b808f4f5..768221baa 100644 --- a/haskell-commands.el +++ b/haskell-commands.el @@ -1,4 +1,4 @@ -;;; haskell-commands.el --- Commands that can be run on the process +;;; haskell-commands.el --- Commands that can be run on the process -*- lexical-binding: t -*- ;;; Commentary: @@ -343,7 +343,7 @@ should be inserted." expr)))))) ;;;###autoload -(defun haskell-mode-jump-to-def-or-tag (&optional next-p) +(defun haskell-mode-jump-to-def-or-tag (&optional _next-p) ;; FIXME NEXT-P arg is not used "Jump to the definition. Jump to definition of identifier at point by consulting GHCi, or @@ -513,7 +513,7 @@ Requires the :loc-at command from GHCi." 'face 'compilation-error))))))) ;;;###autoload -(defun haskell-process-cd (&optional not-interactive) +(defun haskell-process-cd (&optional _not-interactive) ;; FIXME optional arg is not used "Change directory." (interactive) @@ -585,7 +585,7 @@ Query PROCESS to `:cd` to directory DIR." (if (string-match "^[A-Za-z_]" (cdr state)) (format ":info %s" (cdr state)) (format ":info (%s)" (cdr state))))) - :complete (lambda (state response) + :complete (lambda (_state response) (unless (or (string-match "^Top level" response) (string-match "^" response)) (haskell-mode-message-line response))))))) @@ -603,7 +603,7 @@ Query PROCESS to `:cd` to directory DIR." (if (string-match "^[A-Za-z_]" (cdr state)) (format ":type %s" (cdr state)) (format ":type (%s)" (cdr state))))) - :complete (lambda (state response) + :complete (lambda (_state response) (unless (or (string-match "^Top level" response) (string-match "^" response)) (haskell-mode-message-line response))))))) @@ -719,7 +719,7 @@ function `xref-find-definitions' after new table was generated." (haskell-process-session (car state))) "find . -name '*.hs' -print0 -or -name '*.lhs' -print0 -or -name '*.hsc' -print0" "xargs -0 hasktags -e -x")))) - :complete (lambda (state response) + :complete (lambda (state _response) (when (cdr state) (let ((session-tags (haskell-session-tags-filename @@ -802,9 +802,9 @@ output. If CMD fails the buffer remains unchanged." (while (string-match "\\`\n+\\|^\\s-+\\|\\s-+$\\|\n+\\'" str) (setq str (replace-match "" t t str))) str)) - (errout (lambda (fmt &rest args) - (let* ((warning-fill-prefix " ")) - (display-warning cmd (apply 'format fmt args) :warning)))) + (_errout (lambda (fmt &rest args) + (let* ((warning-fill-prefix " ")) + (display-warning cmd (apply 'format fmt args) :warning)))) (filename (buffer-file-name (current-buffer))) (cmd-prefix (replace-regexp-in-string " .*" "" cmd)) (tmp-file (make-temp-file cmd-prefix)) @@ -813,9 +813,9 @@ output. If CMD fails the buffer remains unchanged." haskell-session) (haskell-session-cabal-dir haskell-session) default-directory)) - (errcode (with-temp-file tmp-file - (call-process cmd filename - (list (current-buffer) err-file) nil))) + (_errcode (with-temp-file tmp-file + (call-process cmd filename + (list (current-buffer) err-file) nil))) (stderr-output (with-temp-buffer (insert-file-contents err-file) diff --git a/haskell-compat.el b/haskell-compat.el index 4a18c6526..f83985458 100644 --- a/haskell-compat.el +++ b/haskell-compat.el @@ -1,4 +1,4 @@ -;;; haskell-compat.el --- legacy/compatibility backports for haskell-mode +;;; haskell-compat.el --- legacy/compatibility backports for haskell-mode -*- lexical-binding: t -*- ;; ;; Filename: haskell-compat.el ;; Description: legacy/compatibility backports for haskell-mode diff --git a/haskell-compile.el b/haskell-compile.el index 40ce23b22..97b92536d 100644 --- a/haskell-compile.el +++ b/haskell-compile.el @@ -1,4 +1,4 @@ -;;; haskell-compile.el --- Haskell/GHC compilation sub-mode +;;; haskell-compile.el --- Haskell/GHC compilation sub-mode -*- lexical-binding: t -*- ;; Copyright (C) 2013 Herbert Valerio Riedel diff --git a/haskell-complete-module.el b/haskell-complete-module.el index 5b33579be..7c5892b47 100644 --- a/haskell-complete-module.el +++ b/haskell-complete-module.el @@ -1,4 +1,4 @@ -;;; haskell-complete-module.el --- A fast way to complete Haskell module names +;;; haskell-complete-module.el --- A fast way to complete Haskell module names -*- lexical-binding: t -*- ;; Copyright (c) 2014 Chris Done. All rights reserved. @@ -35,8 +35,7 @@ (defun haskell-complete-module-read (prompt candidates) "Interactively auto-complete from a list of candidates." - (let ((continue t) - (stack (list)) + (let ((stack (list)) (pattern "") (result nil)) (delete-dups candidates) diff --git a/haskell-completions.el b/haskell-completions.el index b99e6dc19..94db9123a 100644 --- a/haskell-completions.el +++ b/haskell-completions.el @@ -1,4 +1,4 @@ -;;; haskell-completions.el --- Haskell Completion package +;;; haskell-completions.el --- Haskell Completion package -*- lexical-binding: t -*- ;; Copyright © 2015 Athur Fayzrakhmanov. All rights reserved. diff --git a/haskell-customize.el b/haskell-customize.el index e97f4c284..8a2fbc9fc 100644 --- a/haskell-customize.el +++ b/haskell-customize.el @@ -1,4 +1,4 @@ -;;; haskell-customize.el --- Customization settings +;;; haskell-customize.el --- Customization settings -*- lexical-binding: t -*- ;; Copyright (c) 2014 Chris Done. All rights reserved. diff --git a/haskell-debug.el b/haskell-debug.el index f18cd42c6..4872eee27 100644 --- a/haskell-debug.el +++ b/haskell-debug.el @@ -1,4 +1,4 @@ -;;; haskell-debug.el --- Debugging mode via GHCi +;;; haskell-debug.el --- Debugging mode via GHCi -*- lexical-binding: t -*- ;; Copyright (c) 2014 Chris Done. All rights reserved. @@ -556,8 +556,7 @@ Stopped at /home/foo/project/src/x.hs:6:25-36 (cl-loop for span in history do (let ((string (haskell-debug-get-span-string (plist-get span :path) - (plist-get span :span))) - (index (plist-get span :index))) + (plist-get span :span)))) (insert (propertize (format "%4d" i) 'face 'haskell-debug-trace-number-face) " " diff --git a/haskell-decl-scan.el b/haskell-decl-scan.el index b20b6c0af..e88df945d 100644 --- a/haskell-decl-scan.el +++ b/haskell-decl-scan.el @@ -1,4 +1,4 @@ -;;; haskell-decl-scan.el --- Declaration scanning module for Haskell Mode +;;; haskell-decl-scan.el --- Declaration scanning module for Haskell Mode -*- lexical-binding: t -*- ;; Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. ;; Copyright (C) 1997-1998 Graeme E Moss diff --git a/haskell-doc.el b/haskell-doc.el index 7f2bee3fe..1ef212d98 100644 --- a/haskell-doc.el +++ b/haskell-doc.el @@ -1,4 +1,4 @@ -;;; haskell-doc.el --- show function types in echo area -*- coding: utf-8 -*- +;;; haskell-doc.el --- show function types in echo area -*- coding: utf-8; lexical-binding: t -*- ;; Copyright (C) 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc. ;; Copyright (C) 1997 Hans-Wolfgang Loidl @@ -1616,8 +1616,7 @@ the haskell-doc database." (is-reserved (haskell-doc-is-of sym haskell-doc-reserved-ids)) (is-prelude (haskell-doc-is-of sym haskell-doc-prelude-types)) (is-strategy (haskell-doc-is-of sym haskell-doc-strategy-ids)) - (is-user-defined (haskell-doc-is-of sym haskell-doc-user-defined-ids)) - (is-prelude (haskell-doc-is-of sym haskell-doc-prelude-types))) + (is-user-defined (haskell-doc-is-of sym haskell-doc-user-defined-ids))) (cond ;; if reserved id (i.e. Haskell keyword ((and haskell-doc-show-reserved diff --git a/haskell-font-lock.el b/haskell-font-lock.el index 0baa9dfd7..44c8e6676 100644 --- a/haskell-font-lock.el +++ b/haskell-font-lock.el @@ -1,4 +1,4 @@ -;;; haskell-font-lock.el --- Font locking module for Haskell Mode +;;; haskell-font-lock.el --- Font locking module for Haskell Mode -*- lexical-binding: t -*- ;; Copyright 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. ;; Copyright 1997-1998 Graeme E Moss, and Tommy Thorn diff --git a/haskell-indent.el b/haskell-indent.el index 3bef95c50..193847295 100644 --- a/haskell-indent.el +++ b/haskell-indent.el @@ -1,4 +1,4 @@ -;;; haskell-indent.el --- "semi-intelligent" indentation module for Haskell Mode +;;; haskell-indent.el --- "semi-intelligent" indentation module for Haskell Mode -*- lexical-binding: t -*- ;; Copyright 2004, 2005, 2007, 2008, 2009 Free Software Foundation, Inc. ;; Copyright 1997-1998 Guy Lapalme @@ -440,7 +440,7 @@ Returns the location of the start of the comment, nil otherwise." (defun haskell-indent-next-symbol-safe (end) "Puts point to the next following symbol, or to end if there are no more symbols in the sexp." - (condition-case errlist (haskell-indent-next-symbol end) + (condition-case _errlist (haskell-indent-next-symbol end) (error (goto-char end)))) (defun haskell-indent-separate-valdef (start end) @@ -1302,7 +1302,7 @@ We stay in the cycle as long as the TAB key is pressed." (if marker (goto-char (marker-position marker))))))) -(defun haskell-indent-region (start end) +(defun haskell-indent-region (_start _end) (error "Auto-reindentation of a region is not supported")) ;;; alignment functions @@ -1440,7 +1440,7 @@ TYPE is either 'guard or 'rhs." (if regstack (haskell-indent-shift-columns maxcol regstack))))))) -(defun haskell-indent-align-guards-and-rhs (start end) +(defun haskell-indent-align-guards-and-rhs (_start _end) "Align the guards and rhs of functions in the region, which must be active." ;; The `start' and `end' args are dummys right now: they're just there so ;; we can use the "r" interactive spec which properly signals an error. diff --git a/haskell-indentation.el b/haskell-indentation.el index f053a7978..debc4cc8c 100644 --- a/haskell-indentation.el +++ b/haskell-indentation.el @@ -1,4 +1,4 @@ -;;; haskell-indentation.el --- indentation module for Haskell Mode +;;; haskell-indentation.el --- indentation module for Haskell Mode -*- lexical-binding: t -*- ;; Copyright (C) 2013 Kristof Bastiaensen, Gergely Risko @@ -203,8 +203,7 @@ NIL otherwise." (defun haskell-indentation-reindent-to (col &optional move) "Reindent current line to COL, move the point there if MOVE is non-NIL." - (let* ((cc (current-column)) - (ci (haskell-indentation-current-indentation))) + (let* ((ci (haskell-indentation-current-indentation))) (save-excursion (move-to-column ci) (if (<= ci col) @@ -259,8 +258,7 @@ negative ARG. Handles bird style literate Haskell too." (newline) (unless (haskell-indentation-bird-outside-code-p) (catch 'parse-error - (let* ((cc (current-column)) - (ci (haskell-indentation-current-indentation)) + (let* ((ci (haskell-indentation-current-indentation)) (indentations (haskell-indentation-find-indentations-safe))) (when (haskell-indentation-bird-p) (insert "> ")) @@ -349,8 +347,7 @@ indentation points to the right, we switch going to the left." ((and (eq last-command 'indent-for-tab-command) (memq haskell-indentation-dyn-last-direction '(left right)) haskell-indentation-dyn-last-indentations) - (let* ((cc (current-column)) - (ci (haskell-indentation-current-indentation))) + (let ((ci (haskell-indentation-current-indentation))) (if (eq haskell-indentation-dyn-last-direction 'left) (haskell-indentation-reindent-to (haskell-indentation-previous-indentation diff --git a/haskell-interactive-mode.el b/haskell-interactive-mode.el index fddd525b8..5f292213d 100644 --- a/haskell-interactive-mode.el +++ b/haskell-interactive-mode.el @@ -1,4 +1,4 @@ -;;; haskell-interactive-mode.el --- The interactive Haskell mode +;;; haskell-interactive-mode.el --- The interactive Haskell mode -*- lexical-binding: t -*- ;; Copyright (C) 2011-2012 Chris Done @@ -205,7 +205,7 @@ be nil.") ;; (define-key haskell-error-mode-map (kbd "q") 'quit-window) -(defun haskell-interactive-mode-handle-h (&optional bound) +(defun haskell-interactive-mode-handle-h () "Handle ^H in output." (let ((bound (point-min)) (inhibit-read-only t)) @@ -251,9 +251,7 @@ do the expr (let* ((i 0) (lines (split-string expr "\n")) - (len (length lines)) - (indent (make-string (length haskell-interactive-prompt) - ? ))) + (len (length lines))) (mapconcat 'identity (cl-loop for line in lines collect (cond ((= i 0) @@ -329,15 +327,14 @@ SESSION, otherwise operate on the current buffer. "Insert the result of an eval as plain text." (with-current-buffer (haskell-session-interactive-buffer session) (goto-char (point-max)) - (let ((start (point))) - (insert (ansi-color-apply - (propertize text - 'font-lock-face 'haskell-interactive-face-result - 'rear-nonsticky t - 'read-only t - 'prompt t - 'result t))) - (haskell-interactive-mode-handle-h start)) + (insert (ansi-color-apply + (propertize text + 'font-lock-face 'haskell-interactive-face-result + 'rear-nonsticky t + 'read-only t + 'prompt t + 'result t))) + (haskell-interactive-mode-handle-h) (let ((marker (set (make-local-variable 'haskell-interactive-mode-result-end) (make-marker)))) (set-marker marker @@ -571,8 +568,7 @@ FILE-NAME only." (defun haskell-process-suggest-remove-import (session file import line) "Suggest removing or commenting out IMPORT on LINE." - (let ((continue t) - (first t)) + (let ((first t)) (cl-case (read-event (propertize (format "%sThe import line `%s' is redundant. Remove? (y, n, c: comment out) " (if (not first) @@ -812,7 +808,6 @@ FILE-NAME only." "Insert the presentation, hooking up buttons for each slot." (let* ((rep (cadr (assoc 'rep presentation))) (text (cadr (assoc 'text presentation))) - (type (cadr (assoc 'type presentation))) (slots (cadr (assoc 'slots presentation))) (nullary (null slots))) (cond @@ -1005,7 +1000,6 @@ don't care when the thing completes as long as it's soonish." "Offer completions for partial expression between prompt and point" (when (haskell-interactive-at-prompt) (let* ((process (haskell-interactive-process)) - (session (haskell-interactive-session)) (inp (haskell-interactive-mode-input-partial))) (if (string= inp (car-safe haskell-interactive-mode-completion-cache)) (cdr haskell-interactive-mode-completion-cache) diff --git a/haskell-lexeme.el b/haskell-lexeme.el index 6b292f548..f4a397905 100644 --- a/haskell-lexeme.el +++ b/haskell-lexeme.el @@ -1,4 +1,4 @@ -;;; haskell-lexeme.el --- haskell lexical tokens -*- coding: utf-8 -*- +;;; haskell-lexeme.el --- haskell lexical tokens -*- coding: utf-8; lexical-binding: t -*- ;; Copyright (C) 2015 Gracjan Polak diff --git a/haskell-load.el b/haskell-load.el index fa1e4385e..592fdd2a9 100644 --- a/haskell-load.el +++ b/haskell-load.el @@ -1,4 +1,4 @@ -;;; haskell-load.el --- Compiling and loading modules in the GHCi process +;;; haskell-load.el --- Compiling and loading modules in the GHCi process -*- lexical-binding: t -*- ;; Copyright (c) 2014 Chris Done. All rights reserved. diff --git a/haskell-menu.el b/haskell-menu.el index b4a855b0d..e565b33b7 100644 --- a/haskell-menu.el +++ b/haskell-menu.el @@ -1,4 +1,4 @@ -;;; haskell-menu.el --- A Haskell sessions menu +;;; haskell-menu.el --- A Haskell sessions menu -*- lexical-binding: t -*- ;; Copyright (C) 2013 Chris Done @@ -64,7 +64,7 @@ Letters do not insert themselves; instead, they are commands." (define-key haskell-menu-mode-map (kbd "p") 'previous-line) (define-key haskell-menu-mode-map (kbd "RET") 'haskell-menu-mode-ret) -(defun haskell-menu-revert-function (arg1 arg2) +(defun haskell-menu-revert-function (_arg1 _arg2) "Function to refresh the display." (let ((buffer-read-only nil) (orig-line (line-number-at-pos)) diff --git a/haskell-mode-pkg.el b/haskell-mode-pkg.el index f97115ddf..bfa95e1ec 100644 --- a/haskell-mode-pkg.el +++ b/haskell-mode-pkg.el @@ -1,2 +1,5 @@ -(define-package "haskell-mode" "13.15-git" "A Haskell editing mode" - '((cl-lib "0.5"))) +(define-package "haskell-mode" "20150822.1728" "A Haskell editing mode" + '((cl-lib "0.5"))) +;; Local Variables: +;; no-byte-compile: t +;; End: diff --git a/haskell-mode.el b/haskell-mode.el index 5bcffbbca..a2b9c7360 100644 --- a/haskell-mode.el +++ b/haskell-mode.el @@ -1,4 +1,4 @@ -;;; haskell-mode.el --- A Haskell editing mode -*- coding: utf-8 -*- +;;; haskell-mode.el --- A Haskell editing mode -*- coding: utf-8; lexical-binding: t -*- ;; Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc ;; Copyright (C) 1992, 1997-1998 Simon Marlow, Graeme E Moss, and Tommy Thorn @@ -153,12 +153,12 @@ With prefix argument HERE, insert it at point." (interactive "P") (let* ((haskell-mode-dir (ignore-errors (file-name-directory (or (locate-library "haskell-mode") "")))) - (_version (format "haskell-mode version %s (%s)" + (version (format "haskell-mode version %s (%s)" haskell-version haskell-mode-dir))) (if here - (insert _version) - (message "%s" _version)))) + (insert version) + (message "%s" version)))) ;;;###autoload (defun haskell-mode-view-news () @@ -845,15 +845,13 @@ is asked to show extra info for the items matching QUERY.." current-prefix-arg))) (if (null haskell-hoogle-command) (browse-url (format haskell-hoogle-url (url-hexify-string query))) - (let ((hoogle-args (append (when info '("-i")) - (list "--color" (shell-quote-argument query))))) - (with-help-window "*hoogle*" - (with-current-buffer standard-output - (insert (shell-command-to-string - (concat haskell-hoogle-command - (if info " -i " "") - " --color " (shell-quote-argument query)))) - (ansi-color-apply-on-region (point-min) (point-max))))))) + (with-help-window "*hoogle*" + (with-current-buffer standard-output + (insert (shell-command-to-string + (concat haskell-hoogle-command + (if info " -i " "") + " --color " (shell-quote-argument query)))) + (ansi-color-apply-on-region (point-min) (point-max)))))) ;;;###autoload (defalias 'hoogle 'haskell-hoogle) @@ -873,7 +871,7 @@ is asked to show extra info for the items matching QUERY.." (defun hoogle-server-live-p () "Whether hoogle server is live or not." - (condition-case err + (condition-case _err (process-live-p (get-buffer-create hoogle-server-buffer-name)) (error nil))) diff --git a/haskell-modules.el b/haskell-modules.el index 6a5aa3829..0a5cb283b 100644 --- a/haskell-modules.el +++ b/haskell-modules.el @@ -1,4 +1,4 @@ -;;; haskell-modules.el --- +;;; haskell-modules.el --- -*- lexical-binding: t -*- ;; Copyright (c) 2014 Chris Done. All rights reserved. @@ -48,9 +48,8 @@ "\n")))) ;;;###autoload -(defun haskell-session-installed-modules (session &optional dontcreate) - "Get the modules installed in the current package set. -If DONTCREATE is non-nil don't create a new session." +(defun haskell-session-installed-modules (_session &optional _dontcreate) + "Get the modules installed in the current package set." ;; TODO: Again, this makes HEAVY use of unix utilities. It'll work ;; fine in Linux, probably okay on OS X, and probably not at all on ;; Windows. Again, if someone wants to test on Windows and come up diff --git a/haskell-move-nested.el b/haskell-move-nested.el index f8ff11a4d..1e4774de4 100644 --- a/haskell-move-nested.el +++ b/haskell-move-nested.el @@ -1,4 +1,4 @@ -;;; haskell-move-nested.el --- Change the column of text nested below a line +;;; haskell-move-nested.el --- Change the column of text nested below a line -*- lexical-binding: t -*- ;; Copyright (C) 2010 Chris Done diff --git a/haskell-navigate-imports.el b/haskell-navigate-imports.el index 572542274..c851ed0bb 100644 --- a/haskell-navigate-imports.el +++ b/haskell-navigate-imports.el @@ -1,4 +1,4 @@ -;;; haskell-navigate-imports.el --- A function for cycling through Haskell import lists +;;; haskell-navigate-imports.el --- A function for cycling through Haskell import lists -*- lexical-binding: t -*- ;; Copyright (C) 2010 Chris Done @@ -98,10 +98,9 @@ (haskell-navigate-imports-after-imports-p) ;; This one just speeds it up. (haskell-navigate-imports-line))) (forward-line)) - (let ((point (point))) - (if (haskell-navigate-imports-line) - (point) - nil)))) + (if (haskell-navigate-imports-line) + (point) + nil))) (defun haskell-navigate-imports-line () "Try to match the current line as a regexp." diff --git a/haskell-package.el b/haskell-package.el index a7a36265b..1afa9984e 100644 --- a/haskell-package.el +++ b/haskell-package.el @@ -1,4 +1,4 @@ -;;; haskell-package.el --- Interface for working with Cabal packages +;;; haskell-package.el --- Interface for working with Cabal packages -*- lexical-binding: t -*- ;; Copyright (C) 2011 Chris Done diff --git a/haskell-presentation-mode.el b/haskell-presentation-mode.el index 375d1ddd7..daf457728 100644 --- a/haskell-presentation-mode.el +++ b/haskell-presentation-mode.el @@ -1,4 +1,4 @@ -;;; haskell-presentation-mode.el --- Presenting Haskell things +;;; haskell-presentation-mode.el --- Presenting Haskell things -*- lexical-binding: t -*- ;; Copyright (C) 2013 Chris Done diff --git a/haskell-process.el b/haskell-process.el index ced9b0d79..598a8d502 100644 --- a/haskell-process.el +++ b/haskell-process.el @@ -1,4 +1,4 @@ -;;; haskell-process.el --- Communicating with the inferior Haskell process +;;; haskell-process.el --- Communicating with the inferior Haskell process -*- lexical-binding: t -*- ;; Copyright (C) 2011 Chris Done @@ -183,7 +183,7 @@ HPTYPE is the result of calling `'haskell-process-type`' function." (process-name proc))) haskell-sessions)) -(defun haskell-process-collect (session response process) +(defun haskell-process-collect (_session response process) "Collect input for the response until receives a prompt." (haskell-process-set-response process (concat (haskell-process-response process) response)) diff --git a/haskell-repl.el b/haskell-repl.el index 51424bc31..e18e71af7 100644 --- a/haskell-repl.el +++ b/haskell-repl.el @@ -1,4 +1,4 @@ -;;; haskell-repl.el --- REPL evaluation +;;; haskell-repl.el --- REPL evaluation -*- lexical-binding: t -*- ;; Copyright (c) 2014 Chris Done. All rights reserved. @@ -62,8 +62,7 @@ (defun haskell-interactive-mode-run-expr (expr) "Run the given expression." (let ((session (haskell-interactive-session)) - (process (haskell-interactive-process)) - (lines (length (split-string expr "\n")))) + (process (haskell-interactive-process))) (haskell-process-queue-command process (make-haskell-command @@ -99,7 +98,7 @@ (with-temp-buffer (insert (haskell-interactive-mode-cleanup-response (cl-caddr state) response)) - (haskell-interactive-mode-handle-h (point-min)) + (haskell-interactive-mode-handle-h) (buffer-string)))) (when haskell-interactive-mode-eval-mode (unless (haskell-process-sent-stdin-p (cadr state)) diff --git a/haskell-sandbox.el b/haskell-sandbox.el index 22115f202..4d47b23ad 100644 --- a/haskell-sandbox.el +++ b/haskell-sandbox.el @@ -1,4 +1,4 @@ -;;; haskell-sandbox.el --- Support for sandboxes +;;; haskell-sandbox.el --- Support for sandboxes -*- lexical-binding: t -*- ;; Copyright (c) 2014 Chris Done. All rights reserved. diff --git a/haskell-session.el b/haskell-session.el index f6936600b..95007a3a7 100644 --- a/haskell-session.el +++ b/haskell-session.el @@ -1,4 +1,4 @@ -;;; haskell-session.el --- Haskell sessions +;;; haskell-session.el --- Haskell sessions -*- lexical-binding: t -*- ;; Copyright (C) 2011-2012 Chris Done diff --git a/haskell-simple-indent.el b/haskell-simple-indent.el index 5d8a000ba..51b4fdf9b 100644 --- a/haskell-simple-indent.el +++ b/haskell-simple-indent.el @@ -1,4 +1,4 @@ -;;; haskell-simple-indent.el --- Simple indentation module for Haskell Mode +;;; haskell-simple-indent.el --- Simple indentation module for Haskell Mode -*- lexical-binding: t -*- ;; Copyright (C) 1998 Heribert Schuetz, Graeme E Moss @@ -193,19 +193,18 @@ point beyond the current column, position given by (defun haskell-simple-indent-newline-same-col () "Make a newline and go to the same column as the current line." (interactive) - (let ((point (point))) - (let ((start-end - (save-excursion - (let* ((start (line-beginning-position)) - (end (progn (goto-char start) - (search-forward-regexp - "[^ ]" (line-end-position) t 1)))) - (when end (cons start (1- end))))))) - (if start-end - (progn (newline) - (insert (buffer-substring-no-properties - (car start-end) (cdr start-end)))) - (newline))))) + (let ((start-end + (save-excursion + (let* ((start (line-beginning-position)) + (end (progn (goto-char start) + (search-forward-regexp + "[^ ]" (line-end-position) t 1)))) + (when end (cons start (1- end))))))) + (if start-end + (progn (newline) + (insert (buffer-substring-no-properties + (car start-end) (cdr start-end)))) + (newline)))) (defun haskell-simple-indent-newline-indent () "Make a newline on the current column and indent on step." diff --git a/haskell-sort-imports.el b/haskell-sort-imports.el index 1f49605ae..813a23286 100644 --- a/haskell-sort-imports.el +++ b/haskell-sort-imports.el @@ -1,4 +1,4 @@ -;;; haskell-sort-imports.el --- Sort the list of Haskell imports at the point alphabetically +;;; haskell-sort-imports.el --- Sort the list of Haskell imports at the point alphabetically -*- lexical-binding: t -*- ;; Copyright (C) 2010 Chris Done diff --git a/haskell-string.el b/haskell-string.el index cb049625e..c93043930 100644 --- a/haskell-string.el +++ b/haskell-string.el @@ -1,4 +1,4 @@ -;;; haskell-string.el --- Haskell related string utilities +;;; haskell-string.el --- Haskell related string utilities -*- lexical-binding: t -*- ;; Copyright (C) 2013 Herbert Valerio Riedel diff --git a/haskell-unicode-input-method.el b/haskell-unicode-input-method.el index 9b4881ca0..c2c017d58 100644 --- a/haskell-unicode-input-method.el +++ b/haskell-unicode-input-method.el @@ -1,4 +1,4 @@ -;;; haskell-unicode-input-method.el --- Haskell Unicode helper functions -*- coding: utf-8 -*- +;;; haskell-unicode-input-method.el --- Haskell Unicode helper functions -*- coding: utf-8; lexical-binding: t -*- ;; Copyright (C) 2010-2011 Roel van Dijk diff --git a/haskell-utils.el b/haskell-utils.el index 8b6412dbd..917094e25 100644 --- a/haskell-utils.el +++ b/haskell-utils.el @@ -1,4 +1,4 @@ -;;; haskell-utils.el --- General utility functions used by haskell-mode modules +;;; haskell-utils.el --- General utility functions used by haskell-mode modules -*- lexical-binding: t -*- ;; Copyright (C) 2013 Herbert Valerio Riedel diff --git a/haskell.el b/haskell.el index b2c9aa58b..88a4b1003 100644 --- a/haskell.el +++ b/haskell.el @@ -1,4 +1,4 @@ -;;; haskell.el --- Top-level Haskell package +;;; haskell.el --- Top-level Haskell package -*- lexical-binding: t -*- ;; Copyright (c) 2014 Chris Done. All rights reserved. @@ -70,7 +70,8 @@ (defun haskell-process-completions-at-point () "A completion-at-point function using the current haskell process." (when (haskell-session-maybe) - (let ((process (haskell-process)) symbol symbol-bounds) + (let ((process (haskell-process)) + symbol-bounds) (cond ;; ghci can complete module names, but it needs the "import " ;; string at the beginning @@ -319,6 +320,8 @@ If `haskell-process-load-or-reload-prompt' is nil, accept `default'." (when ident (haskell-process-do-try-info ident))))))) +(defvar xref-prompt-for-identifier nil) + ;;;###autoload (defun haskell-mode-jump-to-tag (&optional next-p) "Jump to the tag of the given identifier." @@ -345,7 +348,7 @@ If `haskell-process-load-or-reload-prompt' is nil, accept `default'." (basic-save-buffer)))) ;;;###autoload -(defun haskell-mode-tag-find (&optional next-p) +(defun haskell-mode-tag-find (&optional _next-p) "The tag find function, specific for the particular session." (interactive "P") (cond diff --git a/highlight-uses-mode.el b/highlight-uses-mode.el index 1c3475ed2..9cc324df0 100644 --- a/highlight-uses-mode.el +++ b/highlight-uses-mode.el @@ -1,4 +1,4 @@ -;;; highlight-uses-mode.el --- Mode for highlighting uses +;;; highlight-uses-mode.el --- Mode for highlighting uses -*- lexical-binding: t -*- ;; Copyright (c) 2014 Chris Done. All rights reserved. diff --git a/inf-haskell.el b/inf-haskell.el index 640a5b2e1..d5fad6c4a 100644 --- a/inf-haskell.el +++ b/inf-haskell.el @@ -1,4 +1,4 @@ -;;; inf-haskell.el --- Interaction with an inferior Haskell process +;;; inf-haskell.el --- Interaction with an inferior Haskell process -*- lexical-binding: t -*- ;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. @@ -231,7 +231,7 @@ setting up the inferior-haskell buffer." (defvar inferior-haskell-seen-prompt nil) (make-variable-buffer-local 'inferior-haskell-seen-prompt) -(defun inferior-haskell-spot-prompt (string) +(defun inferior-haskell-spot-prompt (_string) (let ((proc (get-buffer-process (current-buffer)))) (when proc (save-excursion @@ -786,7 +786,7 @@ we load it." (let* (;; Find the module and look it up in the alist (module (inferior-haskell-get-module sym)) (full-name (inferior-haskell-map-internal-ghc-ident (concat module "." sym))) - (success (string-match "\\(.*\\)\\.\\(.*\\)" full-name)) + (_success (string-match "\\(.*\\)\\.\\(.*\\)" full-name)) (module (match-string 1 full-name)) (sym (match-string 2 full-name)) (alist-record (assoc module (inferior-haskell-module-alist))) diff --git a/w3m-haddock.el b/w3m-haddock.el index d41a527cb..f731fc989 100644 --- a/w3m-haddock.el +++ b/w3m-haddock.el @@ -1,3 +1,4 @@ +;;; -*- lexical-binding: t -*- ;;; w3m-haddock.el --- Make browsing haddocks with w3m-mode better. ;; Copyright (C) 2014 Chris Done @@ -122,7 +123,7 @@ You can rebind this if you're using hsenv by adding it to your (replace-regexp-in-string "docs/.*" "docs/doc-index-All.html" w3m-current-url)) (search-forward ident))))) -(defun w3m-haddock-display (url) +(defun w3m-haddock-display (_url) "To be ran by w3m's display hook. This takes a normal w3m buffer containing hadddock documentation and reformats it to be more usable and look like a dedicated documentation page."