Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Clojure nREPL client for Emacs

NotificationsYou must be signed in to change notification settings

sanel/monroe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

Monroe

Monroe isnREPL client forEmacs, focused on simplicity and easy distribution primarily targetingClojure users.

If you are not familiar with nREPL, it is protocol for accessingClojureREPL overthe network.

In short, Monroe aims to have:

  • easy access to Clojure REPL via nREPL protocol
  • simple installation without any dependencies, except Emacs
  • REPL with colors and history support
  • generic approach - you can use it with other languages than Clojure
  • only REPL for interaction with shortcuts - no funny windows or buffers with errors,messages and other distractions

On other hand, Monroe is not:

  • Clojure IDE likeCider
  • Kitchen sink that will do Clojure work for you

Installation

Make sure you haveclojure-mode.el installed first. You can get itfrom Marmalade repository or directly fromhere.

Official Monroe releases you can find onreleases page or you canget it from Marmalade repository of Emacs packages (you are familiarwith Emacs packages, right?).

Latest (and maybe unstable) code you can always get from thisrepository or MELPA repository of Emacs packages.

If you get Monroe by downloading official release or by cloning thisrepository, you can install it by movingmonroe.el file in$HOME/.emacs.d folder or any other location listed in Emacsload-path variable. Installing via Emacs package manager will dothis automatically.

In yourEmacs init file,put:

(require'monroe)(add-hook'clojure-mode-hook'clojure-enable-monroe)

Then, in Emacs:

M-x monroe [RET]

and follow the question about nREPL server location and port.

Starting the nREPL server

You can start the nREPL server straight from Emacs by running:

M-x monroe-nrepl-server-start [RET]

and then connect as above.By default Monroe will start Leiningen REPL with command:

lein trampoline repl :headless

You can override this by setting the following variables:

  • monroe-nrepl-server-cmd - defaults tolein
  • monroe-nrepl-server-cmd-args - defaults totrampoline repl :headless
  • monroe-nrepl-server-project-file - defaults toproject.clj - this is usedfor finding your project's root and launching the REPL process in that location

Boot configuration

(Note: these are not verified!)

For boot, set the following in yourinit.el:

(setq monroe-nrepl-server-cmd"boot")(setq monroe-nrepl-server-cmd-args"repl -S")(setq monroe-nrepl-server-project-file"build.boot")

Keys and shortcuts

Monroe shortcuts for code buffer

These shortcuts are valid from code buffer where you edit Clojurecode and wheremonroe-interaction-mode is activated.

KeysDescription
C-c C-cEvaluate expression at point.
C-c C-rEvaluate region.
C-c C-kEvaluate current buffer contents.
C-c C-lLoad current file from disk.
C-c C-dDescribe symbol at point, showing documentation in REPL window.
C-c C-nEvaluate namespace.
C-c C-bInterrupt running job.
M-.Jump to definition of var at point.
M-,Jump back to where you were before you didM-.

Note the difference betweenC-c C-k andC-c C-l;the former loads the contents of the buffer and sends them directlyover the wire; this can differ from the state of the namespace ondisk, and doesn't always convey line number information. It loads eachtop-level form in the file individually, and if one of them fails itwill continue compiling the rest. The second one tells the server toload the whole file from its disk, so if you are connected to a remoteserver and have made changes to your local copy, they will not beloaded. However, a single exception will halt the whole thing.

Monroe shortcuts for REPL buffer

These shortcuts are valid in REPL buffer; also, most of the standardcomint-mode shortcuts should work without problems.

KeysDescription
C-c C-dDescribe symbol at point, showing documentation in REPL window.
C-c C-cInterrupt running job.
M-.Jump to definition of var at point.

Projects based on Monroe

  • Miracle - an Arcadia nREPL client

  • Rail - a Clojure-less nREPL client

Bug reports & patches

Feel free to report any issues you find or you have suggestions for improvements.


[8]ページ先頭

©2009-2025 Movatter.jp