Skip to content

Commit e311868

Browse files
committed
Address some byte-compilation warnings
Thanks for the patch, Stefan!
1 parent 3bcb4b9 commit e311868

11 files changed

+21
-9
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@
77
*.elc
88
.cask
99
elpa*
10+
/clojure-mode-autoloads.el
11+
/clojure-mode-pkg.el

clojure-mode-extra-font-locking.el

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
;;; clojure-mode-extra-font-locking.el --- Extra font-locking for Clojure mode
1+
;;; clojure-mode-extra-font-locking.el --- Extra font-locking for Clojure mode -*- lexical-binding: t; -*-
22

33
;; Copyright © 2014-2021 Bozhidar Batsov
44
;;

test/clojure-mode-bytecomp-warnings.el

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
;;; clojure-mode-bytecomp-warnings.el --- Check for byte-compilation problems
1+
;;; clojure-mode-bytecomp-warnings.el --- Check for byte-compilation problems -*- lexical-binding: t; -*-
22

33
;; Copyright © 2012-2021 Bozhidar Batsov and contributors
44
;;

test/clojure-mode-external-interaction-test.el

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
(require 'clojure-mode)
2323
(require 'buttercup)
2424
(require 'paredit)
25+
(require 'test-helper "test/utils/test-helper")
2526

2627
(describe "Interactions with Paredit:"
2728
;; reuse existing when-refactoring-it macro

test/clojure-mode-font-lock-test.el

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
(require 'clojure-mode)
2828
(require 'cl-lib)
2929
(require 'buttercup)
30+
(require 'test-helper "test/utils/test-helper")
3031

3132

3233
;;;; Utilities
@@ -36,7 +37,7 @@
3637
(declare (debug t)
3738
(indent 1))
3839
`(with-clojure-buffer ,content
39-
(font-lock-fontify-buffer)
40+
(font-lock-ensure)
4041
(goto-char (point-min))
4142
,@body))
4243

test/clojure-mode-indentation-test.el

+3-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
(require 'clojure-mode)
2727
(require 'cl-lib)
2828
(require 'buttercup)
29-
(require 's)
29+
(require 's nil t) ;Don't burp if it's missing during compilation.
30+
(require 'test-helper "test/utils/test-helper")
3031

3132
(defmacro when-indenting-with-point-it (description before after)
3233
"Return a buttercup spec.
@@ -279,7 +280,7 @@ DESCRIPTION is a string with the description of the spec."
279280
one)"))
280281

281282
(describe "we can pass a lambda to explicitly set the column"
282-
(put-clojure-indent 'arsymbol (lambda (indent-point state) 0))
283+
(put-clojure-indent 'arsymbol (lambda (_indent-point _state) 0))
283284

284285
(when-indenting-with-point-it "should handle a symbol with lambda"
285286
"

test/clojure-mode-promote-fn-literal-test.el

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
(require 'clojure-mode)
2525
(require 'buttercup)
26+
(require 'test-helper "test/utils/test-helper")
2627

2728
(describe "clojure-promote-fn-literal"
2829
:var (names)

test/clojure-mode-syntax-test.el

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
(require 'clojure-mode)
2727
(require 'buttercup)
28+
(require 'test-helper "test/utils/test-helper")
2829

2930
(defun non-func (form-a form-b)
3031
(with-clojure-buffer form-a
@@ -66,6 +67,7 @@
6667
("#aaa" . "aaa")
6768
("'aaa" . "aaa")))
6869
(with-clojure-buffer (car form)
70+
;; FIXME: Shouldn't there be an `expect' here?
6971
(equal (symbol-name (symbol-at-point)) (cdr form)))))
7072

7173
(it "skips prefixes"

test/clojure-mode-util-test.el

+5-3
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,14 @@
2525
(require 'clojure-mode)
2626
(require 'cl-lib)
2727
(require 'buttercup)
28-
28+
(require 'test-helper "test/utils/test-helper")
2929

3030
(describe "clojure-mode-version"
3131
(it "should not be nil"
3232
(expect clojure-mode-version)))
3333

34+
(defvar clojure-cache-project)
35+
3436
(let ((project-dir "/home/user/projects/my-project/")
3537
(clj-file-path "/home/user/projects/my-project/src/clj/my_project/my_ns/my_file.clj")
3638
(project-relative-clj-file-path "src/clj/my_project/my_ns/my_file.clj")
@@ -45,13 +47,13 @@
4547
(describe "clojure-expected-ns"
4648
(it "should return the namespace matching a path"
4749
(cl-letf (((symbol-function 'clojure-project-relative-path)
48-
(lambda (&optional current-buffer-file-name)
50+
(lambda (&optional _current-buffer-file-name)
4951
project-relative-clj-file-path)))
5052
(expect (string= (clojure-expected-ns clj-file-path) clj-file-ns))))
5153

5254
(it "should return the namespace even without a path"
5355
(cl-letf (((symbol-function 'clojure-project-relative-path)
54-
(lambda (&optional current-buffer-file-name)
56+
(lambda (&optional _current-buffer-file-name)
5557
project-relative-clj-file-path)))
5658
(expect (string= (let ((buffer-file-name clj-file-path))
5759
(clojure-expected-ns))

test/test-checks.el

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
;; This is a script to be loaded from the root `clojure-mode' directory. It will
1+
;; This is a script to be loaded from the root `clojure-mode' directory. It will -*- lexical-binding: t; -*-
22
;; prepare all requirements and then run `check-declare-directory' on
33
;; `default-directory'. For example: emacs -Q --batch -l test/test-checkdoc.el
44

test/utils/test-helper.el

+2
Original file line numberDiff line numberDiff line change
@@ -95,4 +95,6 @@ DESCRIPTION is a string with the description of the spec."
9595
(expect (buffer-string) :to-equal expected-state)
9696
(expect (point) :to-equal expected-cursor-pos)))))
9797

98+
99+
(provide 'test-helper)
98100
;;; test-helper.el ends here

0 commit comments

Comments
 (0)