Skip to content

Commit 9877d22

Browse files
p4v4nbbatsov
authored andcommitted
Add some migration instructions
1 parent 928c831 commit 9877d22

File tree

1 file changed

+36
-2
lines changed

1 file changed

+36
-2
lines changed

README.md

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Set the var `clojure-ts-indent-style` to change it.
3535

3636
### Font Locking
3737

38-
Too highlight entire rich `comment` expression with the comment font face, set
38+
To highlight entire rich `comment` expression with the comment font face, set
3939

4040
``` emacs-lisp
4141
(setq clojure-ts-comment-macro-font-lock-body t)
@@ -85,6 +85,12 @@ If you decide to build Emacs from source there's some useful information on this
8585
- [Emacs tree-sitter starter-guide](https://git.savannah.gnu.org/cgit/emacs.git/tree/admin/notes/tree-sitter/starter-guide?h=emacs-29)
8686
- [Emacs install instructions](https://git.savannah.gnu.org/cgit/emacs.git/tree/INSTALL.REPO).
8787

88+
To check if your emacs already supports tree sitter run
89+
90+
``` emacs-lisp
91+
(treesit-available-p)
92+
```
93+
8894
### Install clojure-ts-mode
8995

9096
clojure-ts-mode is available on [MElPA](https://melpa.org/#/clojure-ts-mode) and
@@ -180,11 +186,39 @@ Then tell Emacs where to find the shared library by adding something like this t
180186
OR you can move the `libtree-sitter-clojure.so`/`libtree-sitter-clojure.dylib` to a directory named `tree-sitter`
181187
under your `user-emacs-directory` (typically `~/.emacs.d` on Unix systems).
182188

189+
## Migrating to clojure-ts-mode
190+
191+
If you are migrating to `clojure-ts-mode` note that `clojure-mode` is still required for cider and clj-refactor packages to work properly.
192+
193+
After installing the package do the following.
194+
195+
- Check the value of `clojure-mode-hook` and copy all relevant hooks to `clojure-ts-mode-hook`.
196+
197+
example:
198+
``` emacs-lisp
199+
(add-hook 'clojure-ts-mode-hook #'cider-mode)
200+
(add-hook 'clojure-ts-mode-hook #'enable-paredit-mode)
201+
(add-hook 'clojure-ts-mode-hook #'rainbow-delimiters-mode)
202+
(add-hook 'clojure-ts-mode-hook #'clj-refactor-mode)
203+
```
204+
205+
- Update `.dir-locals.el` in all of your clojure projects to activate directory local variables in clojure-ts-mode.
206+
207+
example:
208+
``` emacs-lisp
209+
((clojure-mode
210+
(cider-clojure-cli-aliases . ":test:repl"))
211+
(clojure-ts-mode
212+
(cider-clojure-cli-aliases . ":test:repl")))
213+
```
214+
183215
## Frequently Asked Questions
184216

185217
### Does `clojure-ts-mode` work with CIDER?
186218

187-
Not yet out of the box, but that [should change soon](https://github.com/clojure-emacs/cider/pull/3461). Feel free to help out with the remaining work, so we can expedite the process.
219+
~~Not yet out of the box, but that [should change soon](https://github.com/clojure-emacs/cider/pull/3461). Feel free to help out with the remaining work, so we can expedite the process.~~
220+
221+
Support for clojure-ts-mode has landed on the master branch. Make sure to grab the latest cider from melpa/github.
188222

189223
For now, when you take care of the keybindings for the cider functions you use and ensure `cider-mode` is enabled for `clojure-ts-mode` buffers in your config, most functionality should already work:
190224

0 commit comments

Comments
 (0)