Skip to content

Fix some warnings #1202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 10, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions haskell-indentation.el
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ negative ARG. Handles bird style literate Haskell too."
(defun haskell-indentation-next-indentation (col indentations &optional nofail)
"Find the leftmost indentation which is greater than COL.
Indentations are taken from INDENTATIONS, which should be a
list. Return the last indentation if there are no bigger ones and
list. Return the last indentation if there are no bigger ones and
NOFAIL is non-NIL."
(when (null indentations)
(error "haskell-indentation-next-indentation called with empty list"))
Expand All @@ -219,7 +219,9 @@ NOFAIL is non-NIL."
(car (last indentations)))))

(defun haskell-indentation-previous-indentation (col indentations &optional nofail)
"Find the rightmost indentation which is less than COL."
"Find the rightmost indentation less than COL from INDENTATIONS.
When no indentations are less than COL, return the rightmost indentation
if NOFAIL is non-nil, or nil otherwise."
(when (null indentations)
(error "haskell-indentation-previous-indentation called with empty list"))
(let ((rev (reverse indentations)))
Expand Down Expand Up @@ -295,11 +297,11 @@ indentation points to the right, we switch going to the left."
t))
(t nil)))

(defun haskell-indentation-indent-region (start end)
(defun haskell-indentation-indent-region (_start _end)
"This function does nothing.

It is better to do nothing to indent region in Haskell than to
break the semantics of indentation. This function is used for
break the semantics of indentation. This function is used for
`indent-region-function' because the default is to call
`indent-line-function' on every line from START to END and that
also produces catastrophic results.
Expand Down
43 changes: 21 additions & 22 deletions haskell-interactive-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@
(make-variable-buffer-local 'haskell-interactive-mode-old-prompt-start)

(defun haskell-interactive-prompt-regex ()
"Generate a regex for searching for any occurence of the prompt
at the beginning of the line. This should prevent any
"Generate a regex for searching for any occurence of the prompt\
at the beginning of the line. This should prevent any
interference with prompts that look like haskell expressions."
(concat "^" (regexp-quote haskell-interactive-prompt)))

Expand All @@ -81,7 +81,7 @@ interference with prompts that look like haskell expressions."
(define-key map (kbd "TAB") 'haskell-interactive-mode-tab)
(define-key map (kbd "<C-S-backspace>") 'haskell-interactive-mode-kill-whole-line)
map)
"Keymap used in `haskell-interactive-mode'")
"Keymap used in `haskell-interactive-mode'.")

(define-derived-mode haskell-interactive-mode fundamental-mode "Interactive-Haskell"
"Interactive mode for Haskell.
Expand All @@ -107,8 +107,8 @@ Key bindings:

(defvar haskell-interactive-mode-result-end
nil
"Mark used to figure out where the end of the current result
output is. Used to distinguish betwen user input.")
"Mark used to figure out where the end of the current result output is.
Used to distinguish betwen user input.")

(defvar haskell-interactive-previous-buffer nil
"Records the buffer to which `haskell-interactive-switch-back' should jump.
Expand Down Expand Up @@ -181,8 +181,7 @@ be nil.")
(message "No previous buffer.")))

(defun haskell-interactive-copy-to-prompt ()
"Copy the current line to the prompt, overwriting the current
prompt."
"Copy the current line to the prompt, overwriting the current prompt."
(interactive)
(let ((l (buffer-substring-no-properties (line-beginning-position)
(line-end-position))))
Expand All @@ -206,7 +205,7 @@ prompt."
(self-insert-command n))))

(defun haskell-interactive-at-prompt ()
"If at prompt, returns start position of user-input, otherwise returns nil."
"If at prompt, return start position of user-input, otherwise return nil."
(if (>= (point)
haskell-interactive-mode-prompt-start)
haskell-interactive-mode-prompt-start
Expand Down Expand Up @@ -252,14 +251,13 @@ prompt."
out)))

(defun haskell-interactive-mode-multi-line (expr)
"If a multi-line expression has been entered, then reformat it to be:
"If a multi-line expression EXPR has been entered, then reformat it to be:

:{
do the
multi-liner
expr
:}
"
:}"
(if (not (string-match "\n" expr))
expr
(let* ((i 0)
Expand All @@ -277,7 +275,7 @@ do the
"\n"))))

(defun haskell-interactive-trim (line)
"Trim indentation off of lines in the REPL."
"Trim indentation off of LINE in the REPL."
(if (and (string-match "^[ ]+" line)
(> (length line)
(length haskell-interactive-prompt)))
Expand Down Expand Up @@ -412,12 +410,12 @@ SESSION, otherwise operate on the current buffer."
'rear-nonsticky t)))))

(defun haskell-interactive-mode-goto-end-point ()
"Go to the 'end' of the buffer (before the prompt.)"
"Go to the 'end' of the buffer (before the prompt)."
(goto-char haskell-interactive-mode-prompt-start)
(goto-char (line-beginning-position)))

(defun haskell-interactive-mode-history-add (input)
"Add item to the history."
"Add INPUT to the history."
(setq haskell-interactive-mode-history
(cons ""
(cons input
Expand Down Expand Up @@ -552,7 +550,7 @@ FILE-NAME only."
nil)

(defun haskell-process-parse-error (string)
"Parse the line number from the error."
"Parse the line number from the error string STRING."
(let ((span nil))
(cl-loop for regex
in haskell-compilation-error-regexp-alist
Expand Down Expand Up @@ -751,8 +749,9 @@ wrapped in compiler directive at the top of FILE."
buffer. Maybe run M-x haskell-process-restart?")))

(defun haskell-interactive-mode-do-presentation (expr)
"Present the given expression. Requires the `present' package
to be installed. Will automatically import it qualified as Present."
"Present the given expression EXPR.
Requires the `present' package to be installed.
Will automatically import it qualified as Present."
(let ((p (haskell-interactive-process)))
;; If Present.code isn't available, we probably need to run the
;; setup.
Expand Down Expand Up @@ -797,7 +796,7 @@ to be installed. Will automatically import it qualified as Present."
reply)))

(defun haskell-presentation-present-slot (btn)
"The callback to evaluate the slot and present it in place of the button."
"The callback to evaluate the slot and present it in place of the button BTN."
(let ((id (button-get btn 'presentation-id))
(hash (button-get btn 'hash))
(parent-rep (button-get btn 'parent-rep))
Expand Down Expand Up @@ -962,7 +961,7 @@ don't care when the thing completes as long as it's soonish."
'help-echo "Click to expand…")

(defun haskell-interactive-mode-history-toggle (n)
"Toggle the history n items up or down."
"Toggle the history N items up or down."
(unless (null haskell-interactive-mode-history)
(setq haskell-interactive-mode-history-index
(mod (+ haskell-interactive-mode-history-index n)
Expand Down Expand Up @@ -1044,8 +1043,8 @@ This completion function is used in interactive REPL buffer itself."
(list (- (point) rlen) (point) coll))))

(defun haskell-interactive-mode-trigger-compile-error (state response)
"Look for an <interactive> compile error; if there is one, pop
that up in a buffer, similar to `debug-on-error'."
"Look for an <interactive> compile error.
If there is one, pop that up in a buffer, similar to `debug-on-error'."
(when (and haskell-interactive-types-for-show-ambiguous
(string-match "^\n<interactive>:[-0-9]+:[-0-9]+:" response)
(not (string-match "^\n<interactive>:[-0-9]+:[-0-9]+:[\n ]+Warning:" response)))
Expand Down Expand Up @@ -1089,7 +1088,7 @@ This completion function is used in interactive REPL buffer itself."
'rear-nonsticky t))))))

(defun haskell-interactive-mode-splices-buffer (session)
"Get the splices buffer for the current session."
"Get the splices buffer for the current SESSION."
(get-buffer-create (haskell-interactive-mode-splices-buffer-name session)))

(defun haskell-interactive-mode-splices-buffer-name (session)
Expand Down
9 changes: 5 additions & 4 deletions haskell.el
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,9 @@
(make-obsolete 'haskell-process-completions-at-point
'haskell-completions-sync-repl-completion-at-point
"June 19, 2015")

(defun haskell-process-completions-at-point ()
"A completion-at-point function using the current haskell process."
"A `completion-at-point' function using the current haskell process."
(when (haskell-session-maybe)
(let ((process (haskell-process))
symbol-bounds)
Expand Down Expand Up @@ -461,9 +462,9 @@ If `haskell-process-load-or-reload-prompt' is nil, accept `default'."
(list "build --ghc-options=-fforce-recomp"))))))

(defun haskell-process-file-loadish (command reload-p module-buffer)
"Run a loading-ish COMMAND that wants to pick up type errors
and things like that. RELOAD-P indicates whether the notification
should say 'reloaded' or 'loaded'. MODULE-BUFFER may be used
"Run a loading-ish COMMAND that wants to pick up type errors\
and things like that. RELOAD-P indicates whether the notification
should say 'reloaded' or 'loaded'. MODULE-BUFFER may be used
for various things, but is optional."
(let ((session (haskell-session)))
(haskell-session-current-dir session)
Expand Down