Bug#572432: rlwrap and completions, multi-line input, etc.

Jarosław Arlet jajtek at gmail.com
Thu Mar 18 11:02:57 UTC 2010


I think, it would be nice if you applie rlwrap. It has very usefull
features, i.e. completions, multi-line input, up/down arrow history,
parenthesis matching.

Basing on the description at
http://en.wikibooks.org/wiki/Clojure_Programming/Getting_Started#Enhancing_Clojure_REPL_with_rlwrap
I made this task in my system (Debian Lenny in wchich I had installed
packages clojure.deb and clojure-contrib.deb) as follows:


1. I made an executable file 'clojure-completions'  with the content:
    #!/usr/bin/clojure

    (def completions
        (reduce concat (map (fn [p] (keys (ns-publics (find-ns p))))
                            '(clojure.core clojure.set clojure.xml
clojure.zip))))

    (with-open [f (java.io.BufferedWriter. (java.io.FileWriter.
"/etc/rlwrap/clojure"))]
        (.write f (apply str (interleave completions (repeat "\n")))))

2. I executed this file.

3. I changed the content of the existing file '/usr/bin/clojure-repl' on this:
    #!/bin/bash
    BREAK_CHARS="(){}[],^%$#@\"\";:''|\\"

    rlwrap -r -c -b $BREAK_CHARS clojure

Now, entering the 'clojure-contrib' command, I can enjoy all the
functionalities offered by rlwrap.
It works excellent!!!  :-)

Best regards !





More information about the pkg-java-maintainers mailing list