Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Auto-complete sources for Clojure using nrepl completions
Emacs Lisp
tag: 0.12

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.gitignore
README.md
ac-nrepl.el

README.md

nrepl completion source for Emacs auto-complete package

This plugin provides a completion source for the popular Emacs interactive auto-completion framework auto-complete.

Where nrepl provides it, pop-up documentation for completed symbols will be displayed.

This is an early work in progress, and liable to breakage as nrepl evolves.

Installation

First, ensure auto-complete and nrepl are installed: I recommend using packages from Marmalade or Melpa.

You'll need both auto-complete and nrepl to be enabled and working, so please consult the corresponding documentation is you have any trouble with this.

Next, install ac-nrepl. If you choose not to use the convenient package in Melpa and Marmalade, you'll need to add the directory containing ac-nrepl.el to your load-path, and then (require 'ac-nrepl).

ac-nrepl provides an nrepl-specific completion source, so auto-complete needs to be told to use them when nrepl-mode is active. To do this, put the following code in your emacs init file to

 (require 'ac-nrepl)
 (add-hook 'nrepl-mode-hook 'ac-nrepl-setup)
 (add-hook 'nrepl-interaction-mode-hook 'ac-nrepl-setup)
 (eval-after-load "auto-complete"
   '(add-to-list 'ac-modes 'nrepl-mode))

If you want to trigger auto-complete using TAB in nrepl buffers, you may want to put auto-complete into your completion-at-point-functions:

(defun set-auto-complete-as-completion-at-point-function ()
  (setq completion-at-point-functions '(auto-complete)))
(add-hook 'auto-complete-mode-hook 'set-auto-complete-as-completion-at-point-function)

(add-hook 'nrepl-mode-hook 'set-auto-complete-as-completion-at-point-function)
(add-hook 'nrepl-interaction-mode-hook 'set-auto-complete-as-completion-at-point-function)

Usage

ac-nrepl should now automatically be enabled when you visit a buffer in which nrepl-mode is active and auto-complete is enabled. (The symbols "nrepl and "AC" should appear in the modeline.)

Simply trigger auto-completion, and completion candidates supplied by nrepl should be displayed, with the symbol n on the right hand side of the completion pop-up. After a short delay, popup documentation for the completed symbol should also be displayed.

Acknowledgements

Many thanks to the following contributors:


Something went wrong with that request. Please try again.