Document Emacs usage in README.md
This commit is contained in:
parent
abf4979a0f
commit
3a2e85200a
1 changed files with 25 additions and 0 deletions
25
README.md
25
README.md
|
@ -26,6 +26,31 @@ Then you can run
|
|||
|
||||
to analyze your namespaces.
|
||||
|
||||
### Usage from inside Emacs
|
||||
|
||||
If you use Emacs for hacking Clojure, here's a way to use kibit from inside
|
||||
Emacs with all the fancyness you are used from `M-x compile`. Put the
|
||||
following into your `~/.emacs`:
|
||||
|
||||
```
|
||||
;; Teach compile the syntax of the kibit output
|
||||
(require 'compile)
|
||||
(add-to-list 'compilation-error-regexp-alist-alist
|
||||
'(kibit "At \\([^:]+\\):\\([[:digit:]]+\\):" 1 2 nil 0))
|
||||
(add-to-list 'compilation-error-regexp-alist 'kibit)
|
||||
|
||||
;; A convenient command to run "lein kibit" in the project to which the current
|
||||
;; emacs buffer belongs to.
|
||||
(defun kibit ()
|
||||
"Run kibit on the current project.
|
||||
Display the results in a hyperlinked *compilation* buffer."
|
||||
(interactive)
|
||||
(compile "lein kibit"))
|
||||
|
||||
```
|
||||
This will give you a new command `M-x kibit RET`, and the properly highlighted
|
||||
and hyperlinked kibit output is presented in a `*compilation*` buffer.
|
||||
|
||||
## Contributing
|
||||
|
||||
It is very easy to write new patterns for `kibit`. Take a look at
|
||||
|
|
Loading…
Reference in a new issue