Skip to content

Commit 95520cb

Browse files
p4v4nbbatsov
authored andcommitted
Fix all derived modes
- after breaking them earlier in this PR #36
1 parent 3230454 commit 95520cb

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## main (unreleased)
44

5+
- [#37]: Fix derived modes broken with [#36]
6+
57
## 0.2.1 (2024-02-14)
68

79
- [#36]: Rename all derived mode vars to match the package prefix.

clojure-ts-mode.el

+11-11
Original file line numberDiff line numberDiff line change
@@ -968,51 +968,51 @@ See `clojure-ts--font-lock-settings' for usage of MARKDOWN-AVAILABLE."
968968
(define-derived-mode clojure-ts-clojurescript-mode clojure-ts-mode "ClojureScript[TS]"
969969
"Major mode for editing ClojureScript code.
970970
971-
\\{clojurescript-ts-mode-map}")
971+
\\{clojure-ts-clojurescript-mode-map}")
972972

973973
;;;###autoload
974974
(define-derived-mode clojure-ts-clojurec-mode clojure-ts-mode "ClojureC[TS]"
975975
"Major mode for editing ClojureC code.
976976
977-
\\{clojurec-ts-mode-map}")
977+
\\{clojure-ts-clojurec-mode-map}")
978978

979979
;;;###autoload
980980
(define-derived-mode clojure-ts-clojuredart-mode clojure-ts-mode "ClojureDart[TS]"
981981
"Major mode for editing Clojure Dart code.
982982
983-
\\{clojure-dart-ts-mode-map}")
983+
\\{clojure-ts-clojuredart-mode-map}")
984984

985985
;;;###autoload
986986
(define-derived-mode clojure-ts-jank-mode clojure-ts-mode "Jank[TS]"
987987
"Major mode for editing Jank code.
988988
989-
\\{clojure-jank-ts-mode-map}")
989+
\\{clojure-ts-jank-mode-map}")
990990

991991
(defun clojure-ts--register-novel-modes ()
992992
"Set up Clojure modes not present in progenitor clojure-mode.el."
993-
(add-to-list 'auto-mode-alist '("\\.cljd\\'" . clojure-dart-ts-mode))
994-
(add-to-list 'auto-mode-alist '("\\.jank\\'" . clojure-jank-ts-mode)))
993+
(add-to-list 'auto-mode-alist '("\\.cljd\\'" . clojure-ts-clojuredart-mode))
994+
(add-to-list 'auto-mode-alist '("\\.jank\\'" . clojure-ts-jank-mode)))
995995

996996
;; Redirect clojure-mode to clojure-ts-mode if clojure-mode is present
997997
(if (require 'clojure-mode nil 'noerror)
998998
(progn
999999
(add-to-list 'major-mode-remap-alist '(clojure-mode . clojure-ts-mode))
1000-
(add-to-list 'major-mode-remap-alist '(clojurescript-mode . clojurescript-ts-mode))
1001-
(add-to-list 'major-mode-remap-alist '(clojurec-mode . clojurec-ts-mode))
1000+
(add-to-list 'major-mode-remap-alist '(clojurescript-mode . clojure-ts-clojurescript-mode))
1001+
(add-to-list 'major-mode-remap-alist '(clojurec-mode . clojure-ts-clojurec-mode))
10021002
(clojure-ts--register-novel-modes))
10031003
;; Clojure-mode is not present, setup auto-modes ourselves
10041004
;; Regular clojure/edn files
10051005
;; I believe dtm is for datomic queries and datoms, which are just edn.
10061006
(add-to-list 'auto-mode-alist
10071007
'("\\.\\(clj\\|dtm\\|edn\\)\\'" . clojure-ts-mode))
1008-
(add-to-list 'auto-mode-alist '("\\.cljs\\'" . clojurescript-ts-mode))
1009-
(add-to-list 'auto-mode-alist '("\\.cljc\\'" . clojurec-ts-mode))
1008+
(add-to-list 'auto-mode-alist '("\\.cljs\\'" . clojure-ts-clojurescript-mode))
1009+
(add-to-list 'auto-mode-alist '("\\.cljc\\'" . clojure-ts-clojurec-mode))
10101010
;; boot build scripts are Clojure source files
10111011
(add-to-list 'auto-mode-alist '("\\(?:build\\|profile\\)\\.boot\\'" . clojure-ts-mode))
10121012
;; babashka scripts are Clojure source files
10131013
(add-to-list 'interpreter-mode-alist '("bb" . clojure-ts-mode))
10141014
;; nbb scripts are ClojureScript source files
1015-
(add-to-list 'interpreter-mode-alist '("nbb" . clojurescript-ts-mode))
1015+
(add-to-list 'interpreter-mode-alist '("nbb" . clojure-ts-clojurescript-mode))
10161016
(clojure-ts--register-novel-modes))
10171017

10181018
(defvar clojure-ts--find-ns-query

0 commit comments

Comments
 (0)