Skip to content

Commit 8e9bd94

Browse files
committed
Add use-package instructions
1 parent e24410e commit 8e9bd94

File tree

1 file changed

+40
-3
lines changed

1 file changed

+40
-3
lines changed

README.md

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,53 @@ Read these warnings:
3030

3131
### Installation
3232

33-
The package is available on [Melpa](http://melpa.org/):
33+
`flycheck-clojure` of course requires `cider` and `flycheck`, which it should fetch as dependencdies
34+
You can install from [Melpa](http://melpa.org/):
3435

3536
M-x package-install flycheck-clojure
37+
38+
but probably the easiest way to ensure proper loading and initializaiton order is via `use-package`.
39+
With the following, simply invoking `cider-jack-in` will, after `cider` inititialization, but before actually
40+
running, automatically invok
41+
`flycheck-clojure-setup`, which will in turn inject plugin dependencies properly. If you're not careful,
42+
`cider` can end up over-writing the `cider-jack-in-dependencies` with defaults.
43+
44+
```
45+
(use-package cider
46+
:ensure t :defer t
47+
:config
48+
(setq
49+
cider-repl-history-file ".cider-repl-history" ;; not squiggly-related, but I like it
50+
nrepl-log-messages t) ;; not necessary, but useful for trouble-shooting
51+
(flycheck-clojure-setup)) ;; run setup *after* cider load
52+
53+
(use-package flycheck-clojure
54+
:defer t
55+
:commands (flycheck-clojure-setup) ;; autoload
56+
:config
57+
(eval-after-load 'flycheck
58+
'(setq flycheck-display-errors-function #'flycheck-pos-tip-error-messages))
59+
(add-hook 'after-init-hook #'global-flycheck-mode))
60+
61+
(use-package flycheck :ensure t)
62+
(use-package flycheck-pos-tip :ensure t
63+
:after flycheck)
64+
```
65+
66+
67+
3668

3769
Alternatively, (1) clone this project and put its `elisp/flycheck-clojure/` directory
3870
on your path, or (2) download
3971
[this one file](https://github.com/clojure-emacs/clojure-mode/blob/master/clojure-mode.el),
40-
and install it wherever you like.
72+
and install it wherever you like. You can still use `use-package` if you add
73+
```
74+
:pin manual
75+
:load-path "~/dev/squiggly-clojure/elisp/flycheck-clojure/" ;; or whereever
76+
```
77+
to the `(use-package flycheck-clojure ....)` entry.
4178

42-
Add to your ```.emacs```:
79+
If you're not using `use-package`, add to your ```.emacs```:
4380

4481
~~~.el
4582
(eval-after-load 'flycheck '(flycheck-clojure-setup))

0 commit comments

Comments
 (0)