Skip to content
Browse files

Merge pull request #38 from tsdh/master

Here's the requested emacs-usage documentation in the README.md.
  • Loading branch information...
2 parents 710e671 + 3a2e852 commit 75b4091ebb709e98c2826e2e0c43fe405167f361 @jonase committed
Showing with 25 additions and 0 deletions.
  1. +25 −0 README.md
View
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

0 comments on commit 75b4091

Please sign in to comment.
Something went wrong with that request. Please try again.