Skip to content

Commit 34273f4

Browse files
committed
Merge pull request #1086 from cichli/compiler-warnings
Fix most compiler warnings
2 parents f8907bb + 79115fa commit 34273f4

File tree

7 files changed

+62
-64
lines changed

7 files changed

+62
-64
lines changed

cider-doc.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ Tables are marked to be ignored by line wrap."
356356
(newline)
357357
(insert-text-button "[source]"
358358
'follow-link t
359-
'action (lambda (x)
359+
'action (lambda (_x)
360360
(cider-docview-source)))
361361
(let ((beg (point-min))
362362
(end (point-max)))

cider-grimoire.el

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
;;; Code:
2727

2828
(require 'cider-interaction)
29+
(require 'url-vars)
2930

3031
(defconst cider-grimoire-url "http://conj.io/")
3132

cider-inspector.el

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,14 @@
7070
(cider-inspect-expr expression (cider-current-ns)))
7171

7272
;; Operations
73-
(defun cider-inspector--value-handler (buffer value)
73+
(defun cider-inspector--value-handler (_buffer value)
7474
(cider-make-popup-buffer cider-inspector-buffer 'cider-inspector-mode)
7575
(cider-irender cider-inspector-buffer value))
7676

77-
(defun cider-inspector--out-handler (buffer value)
77+
(defun cider-inspector--out-handler (_buffer value)
7878
(cider-emit-interactive-eval-output value))
7979

80-
(defun cider-inspector--err-handler (buffer err)
80+
(defun cider-inspector--err-handler (_buffer err)
8181
(cider-emit-interactive-eval-err-output err))
8282

8383
(defun cider-inspector--done-handler (buffer)

cider-interaction.el

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -613,11 +613,6 @@ When invoked with a prefix ARG the command doesn't prompt for confirmation."
613613
(point))
614614
(point)))
615615

616-
(defun cider-last-sexp-start-pos ()
617-
(save-excursion
618-
(backward-sexp)
619-
(point)))
620-
621616
;;;
622617
(defun cider-tramp-prefix (&optional buffer)
623618
"Use the filename for BUFFER to determine a tramp prefix.
@@ -849,7 +844,7 @@ value is thing at point."
849844
(pcase narg
850845
(-1 t) ; -
851846
(16 t) ; empty empty
852-
(narg nil))))
847+
(_ nil))))
853848

854849
(defun cider--invert-prefix-arg (arg)
855850
"Invert the effect of prefix value ARG on `cider-prompt-for-symbol'.
@@ -860,15 +855,15 @@ This function preserves the `other-window' meaning of ARG."
860855
(16 -1) ; empty empty -> -
861856
(-1 16) ; - -> empty empty
862857
(4 nil) ; empty -> no-prefix
863-
(nil 4)))) ; no-prefix -> empty
858+
(_ 4)))) ; no-prefix -> empty
864859

865860
(defun cider--prefix-invert-prompt-p (arg)
866861
"Test prefix value ARG for its effect on `cider-prompt-for-symbol`."
867862
(let ((narg (prefix-numeric-value arg)))
868863
(pcase narg
869864
(16 t) ; empty empty
870865
(4 t) ; empty
871-
(narg nil))))
866+
(_ nil))))
872867

873868
(defun cider--prompt-for-symbol-p (&optional prefix)
874869
"Check if cider should prompt for symbol.
@@ -1099,7 +1094,7 @@ The handler simply inserts the result value in BUFFER."
10991094
(insert value)))
11001095
(lambda (_buffer out)
11011096
(cider-repl-emit-interactive-output out))
1102-
(lambda (buffer err)
1097+
(lambda (_buffer err)
11031098
(cider-handle-compilation-errors err eval-buffer))
11041099
'())))
11051100

@@ -1145,7 +1140,7 @@ This is controlled via `cider-interactive-eval-output-destination'."
11451140
(cider--display-interactive-eval-result value))
11461141
(lambda (_buffer out)
11471142
(cider-emit-interactive-eval-output out))
1148-
(lambda (buffer err)
1143+
(lambda (_buffer err)
11491144
(cider-emit-interactive-eval-err-output err)
11501145
(cider-handle-compilation-errors err eval-buffer))
11511146
'())))
@@ -1160,7 +1155,7 @@ This is controlled via `cider-interactive-eval-output-destination'."
11601155
(run-hooks 'cider-file-loaded-hook)))
11611156
(lambda (_buffer value)
11621157
(cider-emit-interactive-eval-output value))
1163-
(lambda (buffer err)
1158+
(lambda (_buffer err)
11641159
(cider-emit-interactive-eval-err-output err)
11651160
(cider-handle-compilation-errors err eval-buffer))
11661161
'()
@@ -1308,7 +1303,7 @@ into a new error buffer."
13081303
;; after it has been handled, so it's fine to set it unconditionally here
13091304
(setq causes (cider--handle-stacktrace-response response causes))))))
13101305

1311-
(defun cider-default-err-handler (buffer ex root-ex session)
1306+
(defun cider-default-err-handler (session)
13121307
"Make an error handler for BUFFER, EX, ROOT-EX and SESSION.
13131308
This function determines how the error buffer is shown, and then delegates
13141309
the actual error content to the eval or op handler."
@@ -1475,6 +1470,8 @@ If prefix argument KILL is non-nil, kill the buffer instead of burying it."
14751470
(interactive)
14761471
(quit-restore-window (selected-window) (if kill 'kill 'append)))
14771472

1473+
(defvar-local cider-popup-output-marker nil)
1474+
14781475
(defun cider-make-popup-buffer (name &optional mode)
14791476
"Create a temporary buffer called NAME using major MODE (if specified)."
14801477
(with-current-buffer (get-buffer-create name)
@@ -1484,7 +1481,7 @@ If prefix argument KILL is non-nil, kill the buffer instead of burying it."
14841481
(when mode
14851482
(funcall mode))
14861483
(cider-popup-buffer-mode 1)
1487-
(setq-local cider-popup-output-marker (point-marker))
1484+
(setq cider-popup-output-marker (point-marker))
14881485
(setq buffer-read-only t)
14891486
(current-buffer)))
14901487

@@ -1661,8 +1658,7 @@ If invoked with a PREFIX argument, print the result in the current buffer."
16611658
(defun cider-eval-last-sexp-and-replace ()
16621659
"Evaluate the expression preceding point and replace it with its result."
16631660
(interactive)
1664-
(let ((last-sexp (cider-last-sexp))
1665-
(start-pos (cider-last-sexp-start-pos)))
1661+
(let ((last-sexp (cider-last-sexp)))
16661662
;; we have to be sure the evaluation won't result in an error
16671663
(nrepl-sync-request:eval last-sexp)
16681664
;; seems like the sexp is valid, so we can safely kill it

cider-repl.el

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,10 @@ ENDPOINT is a plist as returned by `nrepl-connect'."
191191
(defun cider-repl-require-repl-utils ()
192192
"Require standard REPL util functions into the current REPL."
193193
(interactive)
194-
(cider-eval
194+
(nrepl-request:eval
195195
"(when (clojure.core/resolve 'clojure.main/repl-requires)
196196
(clojure.core/map clojure.core/require clojure.main/repl-requires))"
197-
(lambda (response) nil)))
197+
(lambda (_response) nil)))
198198

199199
(defun cider-repl-set-initial-ns (buffer)
200200
"Set the REPL BUFFER's initial namespace (by altering `cider-buffer-ns').
@@ -691,7 +691,7 @@ text property `cider-old-input'."
691691
(defun cider-repl-switch-ns-handler (buffer)
692692
"Make a nREPL evaluation handler for the REPL BUFFER's ns switching."
693693
(nrepl-make-response-handler buffer
694-
(lambda (buffer value))
694+
(lambda (_buffer _value))
695695
(lambda (buffer out)
696696
(cider-repl-emit-output buffer out))
697697
(lambda (buffer err)

cider-test.el

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,8 @@
193193
cider-auto-select-error-buffer)
194194
(reverse causes))))))))))
195195

196-
(defun cider-test-stacktrace (&optional button)
197-
"Display stacktrace for the erring test at point, optionally from BUTTON."
196+
(defun cider-test-stacktrace ()
197+
"Display stacktrace for the erring test at point."
198198
(interactive)
199199
(let ((ns (get-text-property (point) 'ns))
200200
(var (get-text-property (point) 'var))
@@ -289,7 +289,7 @@ With the actual value, the outermost '(not ...)' s-expression is removed."
289289
(progn (insert-text-button
290290
error
291291
'follow-link t
292-
'action 'cider-test-stacktrace
292+
'action '(lambda (_button) (cider-test-stacktrace))
293293
'help-echo "View causes and stacktrace")
294294
(newline))
295295
(insert (cider-font-lock-as-clojure actual)))))
@@ -307,7 +307,7 @@ With the actual value, the outermost '(not ...)' s-expression is removed."
307307
(unless (zerop (+ fail error))
308308
(cider-insert "Results" 'bold t "\n")
309309
(nrepl-dict-map
310-
(lambda (var tests)
310+
(lambda (_var tests)
311311
(dolist (test tests)
312312
(nrepl-dbind-response test (type)
313313
(unless (equal "pass" type)

nrepl-client.el

Lines changed: 39 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,43 @@ as returned by `nrepl-connect'. ")
144144
"Name of the buffer to use as REPL buffer.
145145
In case of a special value 'new, a new buffer is created.")
146146

147+
148+
;;; Buffer Local Declarations
149+
150+
;; These variables are used to track the state of nREPL connections
151+
(defvar-local nrepl-connection-buffer nil)
152+
(defvar-local nrepl-server-buffer nil)
153+
(defvar-local nrepl-repl-buffer nil)
154+
(defvar-local nrepl-endpoint nil)
155+
(defvar-local nrepl-project-dir nil)
156+
(defvar-local nrepl-tunnel-buffer nil)
157+
158+
(defvar-local nrepl-session nil
159+
"Current nREPL session id.")
160+
161+
(defvar-local nrepl-tooling-session nil
162+
"Current nREPL tooling session id.
163+
To be used for tooling calls (i.e. completion, eldoc, etc)")
164+
165+
(defvar-local nrepl-request-counter 0
166+
"Continuation serial number counter.")
167+
168+
(defvar-local nrepl-pending-requests nil)
169+
170+
(defvar-local nrepl-completed-requests nil)
171+
172+
(defvar-local nrepl-last-sync-response nil
173+
"Result of the last sync request.")
174+
175+
(defvar-local nrepl-last-sync-request-timestamp nil
176+
"The time when the last sync request was initiated.")
177+
178+
(defvar-local nrepl-ops nil
179+
"Available nREPL server ops (from describe).")
180+
181+
(defvar-local nrepl-versions nil
182+
"Version information received from the describe op.")
183+
147184

148185
;;; nREPL Buffer Names
149186

@@ -208,43 +245,6 @@ PROJECT-DIR, HOST and PORT are as in `nrepl-make-buffer-name'."
208245
(nrepl-make-buffer-name nrepl-tunnel-buffer-name-template
209246
project-dir host port)))
210247

211-
212-
;;; Buffer Local Declarations
213-
214-
;; These variables are used to track the state of nREPL connections
215-
(defvar-local nrepl-connection-buffer nil)
216-
(defvar-local nrepl-server-buffer nil)
217-
(defvar-local nrepl-repl-buffer nil)
218-
(defvar-local nrepl-endpoint nil)
219-
(defvar-local nrepl-project-dir nil)
220-
(defvar-local nrepl-tunnel-buffer nil)
221-
222-
(defvar-local nrepl-session nil
223-
"Current nREPL session id.")
224-
225-
(defvar-local nrepl-tooling-session nil
226-
"Current nREPL tooling session id.
227-
To be used for tooling calls (i.e. completion, eldoc, etc)")
228-
229-
(defvar-local nrepl-request-counter 0
230-
"Continuation serial number counter.")
231-
232-
(defvar-local nrepl-pending-requests nil)
233-
234-
(defvar-local nrepl-completed-requests nil)
235-
236-
(defvar-local nrepl-last-sync-response nil
237-
"Result of the last sync request.")
238-
239-
(defvar-local nrepl-last-sync-request-timestamp nil
240-
"The time when the last sync request was initiated.")
241-
242-
(defvar-local nrepl-ops nil
243-
"Available nREPL server ops (from describe).")
244-
245-
(defvar-local nrepl-versions nil
246-
"Version information received from the describe op.")
247-
248248

249249
;;; Utilities
250250
(defmacro nrepl-dbind-response (response keys &rest body)
@@ -812,7 +812,8 @@ for functionality like pretty-printing won't clobber the values of *1, *2, etc."
812812
;; After being decoded, responses (aka, messages from the server) are dispatched
813813
;; to handlers. Handlers are constructed with `nrepl-make-response-handler'.
814814

815-
(defvar nrepl-err-handler 'cider-default-err-handler
815+
(defvar nrepl-err-handler '(lambda (_buffer _ex _root-ex session)
816+
(cider-default-err-handler session))
816817
"Evaluation error handler.")
817818

818819
(defun nrepl-make-response-handler (buffer value-handler stdout-handler

0 commit comments

Comments
 (0)