Skip to content

Commit 59e9247

Browse files
committed
Drop support for cljx
Clojure 1.7 has been around for 3 years now and it's pretty safe to assume almost no one is still using cljx at this point.
1 parent 9bbc8d5 commit 59e9247

File tree

5 files changed

+5
-51
lines changed

5 files changed

+5
-51
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
* New defcustom `clojure-comment-regexp` for font-locking `#_` or `#_` AND `(comment)` sexps.
1212
* [#459](https://github.com/clojure-emacs/clojure-mode/issues/459): Add font-locking for new built-ins added in Clojure 1.9.
1313

14+
### Changes
15+
16+
* Drop support for CLJX.
17+
1418
### Bugs fixed
1519

1620
* [#458](https://github.com/clojure-emacs/clojure-mode/pull/458): Get correct ns when in middle of ns form with `clojure-find-ns`

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ The `clojure-mode` package actually bundles together several major modes:
7272
* `clojure-mode` is a major mode for editing Clojure code
7373
* `clojurescript-mode` is a major mode for editing ClojureScript code
7474
* `clojurec-mode` is a major mode for editing `.cljc` source files
75-
* `clojurex-mode` is a major mode for editing `.cljx` source files
7675

7776
All the major modes derive from `clojure-mode` and provide more or less the same
7877
functionality. Differences can be found mostly in the font-locking -

clojure-mode.el

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -567,10 +567,7 @@ non-nil."
567567
'clojurescript-mode)
568568
((and (string-match "\\.cljc\\'" (buffer-file-name))
569569
(not (eq major-mode 'clojurec-mode)))
570-
'clojurec-mode)
571-
((and (string-match "\\.cljx\\'" (buffer-file-name))
572-
(not (eq major-mode 'clojurex-mode)))
573-
'clojurex-mode))))
570+
'clojurec-mode))))
574571
(when problem
575572
(message "[WARNING] %s activated `%s' instead of `%s' in this buffer.
576573
This could cause problems.
@@ -2474,24 +2471,11 @@ With a numeric prefix argument the let is introduced N lists up."
24742471
24752472
\\{clojurec-mode-map}")
24762473

2477-
(defconst clojurex-font-lock-keywords
2478-
;; cljx annotations (#+clj and #+cljs)
2479-
'(("#\\+cljs?\\>" 0 font-lock-preprocessor-face))
2480-
"Additional font-locking for `clojurex-mode'.")
2481-
2482-
;;;###autoload
2483-
(define-derived-mode clojurex-mode clojure-mode "ClojureX"
2484-
"Major mode for editing ClojureX code.
2485-
2486-
\\{clojurex-mode-map}"
2487-
(font-lock-add-keywords nil clojurex-font-lock-keywords))
2488-
24892474
;;;###autoload
24902475
(progn
24912476
(add-to-list 'auto-mode-alist
24922477
'("\\.\\(clj\\|dtm\\|edn\\)\\'" . clojure-mode))
24932478
(add-to-list 'auto-mode-alist '("\\.cljc\\'" . clojurec-mode))
2494-
(add-to-list 'auto-mode-alist '("\\.cljx\\'" . clojurex-mode))
24952479
(add-to-list 'auto-mode-alist '("\\.cljs\\'" . clojurescript-mode))
24962480
;; boot build scripts are Clojure source files
24972481
(add-to-list 'auto-mode-alist '("\\(?:build\\|profile\\)\\.boot\\'" . clojure-mode)))

test.clj

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,6 @@
2525
(FooBar/bar)
2626
(some.package.FooBar/baz)
2727

28-
;; cljx
29-
(defn x-to-string
30-
[x]
31-
(let [buf #+clj (StringBuilder.) #+cljs (gstring/StringBuffer.)]
32-
(.append buf "x is: ")
33-
(.append buf (str x))))
34-
3528
;; metadata doesn't break docstrings
3629
(defn max
3730
"Returns the greatest of the nums."

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

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,6 @@
4141
(goto-char (point-min))
4242
,@body))
4343

44-
(defmacro clojurex-test-with-temp-buffer (content &rest body)
45-
"Evaluate BODY in a temporary buffer with CONTENTS."
46-
(declare (debug t)
47-
(indent 1))
48-
`(with-temp-buffer
49-
(insert ,content)
50-
(clojurex-mode)
51-
(font-lock-fontify-buffer)
52-
(goto-char (point-min))
53-
,@body))
54-
5544
(defun clojure-get-face-at-range (start end)
5645
(let ((start-face (get-text-property start 'face))
5746
(all-faces (cl-loop for i from start to end collect (get-text-property i 'face))))
@@ -69,16 +58,6 @@ buffer."
6958
(clojure-get-face-at-range start end))
7059
(clojure-get-face-at-range start end)))
7160

72-
(defun clojurex-test-face-at (start end &optional content)
73-
"Get the face between START and END in CONTENT.
74-
75-
If CONTENT is not given, return the face at the specified range in the current
76-
buffer."
77-
(if content
78-
(clojurex-test-with-temp-buffer content
79-
(clojure-get-face-at-range start end))
80-
(clojure-get-face-at-range start end)))
81-
8261
(defconst clojure-test-syntax-classes
8362
[whitespace punctuation word symbol open-paren close-paren expression-prefix
8463
string-quote paired-delim escape character-quote comment-start
@@ -322,11 +301,6 @@ POS."
322301
(should (eq (clojure-test-face-at 1 2 "\\,") 'clojure-character-face))
323302
(should (eq (clojure-test-face-at 1 2 "\\;") 'clojure-character-face)))
324303

325-
(ert-deftest clojurex-mode-syntax-table/cljx ()
326-
:tags '(fontification syntax-table)
327-
(should (eq (clojurex-test-face-at 1 5 "#+clj x") 'font-lock-preprocessor-face))
328-
(should (eq (clojurex-test-face-at 1 6 "#+cljs x") 'font-lock-preprocessor-face)))
329-
330304
(ert-deftest clojure-mode-syntax-table/refer-ns ()
331305
:tags '(fontification syntax-table)
332306
(should (eq (clojure-test-face-at 1 3 "foo/var") 'font-lock-type-face))

0 commit comments

Comments
 (0)