Skip to content

Commit

Permalink
Merge pull request #38 from tsdh/master
Browse files Browse the repository at this point in the history
Here's the requested emacs-usage documentation in the README.md.
  • Loading branch information
jonase committed May 31, 2012
2 parents 710e671 + 3a2e852 commit 75b4091
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions README.md
Expand Up @@ -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
Expand Down

0 comments on commit 75b4091

Please sign in to comment.