Stefan Tilkov <[email protected]> writes:
> Two quick Emacs/Clojure questions I can't seem to find the answer to:
>
> - In his screencasts, Sean Devlin moves the mouse over an item in his
> REPL history and it becomes highlighted (and he can paste it to the
> current prompt with one click)
> - Also in his screencasts, Lau Jensen types something like g-i-v, then hits
> some key combination and gets an expansion like get-integer-value
>
> I can't seem to find out how to get these to work, any hint would be
> appreciated.
I did it like this (I assume that clojure-mode.el has been installed):
1. downloaded slime and swank-clojure
$ pwd
/home/rw/opt/slime
$ head -n 1 .git/remotes/origin
URL: git://git.boinkor.net/slime.git
$ git pull
Already up-to-date.
$ pwd
/home/rw/opt/swank-clojure
$ head -n 1 .git/remotes/origin
URL: git://github.com/jochu/swank-clojure.git
$ git pull
Already up-to-date.
2. configured Emacs
(version: GNU Emacs 23.1.50.2 (i686-pc-linux-gnu, GTK+ Version 2.12.11))
<.emacs>
(add-to-list 'load-path "~/opt/slime/")
(add-to-list 'load-path "~/opt/slime/contrib/")
(add-to-list 'load-path "~/opt/swank-clojure/src/emacs")
(require 'clojure-mode)
(setq auto-mode-alist
(cons '("\\.clj$" . clojure-mode) auto-mode-alist))
(require 'swank-clojure-autoload)
(swank-clojure-config
(setq swank-clojure-jar-path "~/opt/clojure/clojure-git.jar")
(setq swank-clojure-extra-classpaths (list
"~/opt/clojure/jline.jar"
"~/src/clojure/gnu/clojure/clojure/src/jvm"))
(setq swank-clojure-extra-vm-args
'("-agentlib:jdwp=transport=dt_socket,address=8888,server=y,suspend=n")))
(require 'slime)
(slime-setup '(slime-repl))
(add-hook 'clojure-mode-hook
'(lambda ()
(define-key clojure-mode-map "\C-cc" 'comment-region)
(define-key clojure-mode-map "\C-cu" 'uncomment-region)))
(eval-after-load "slime"
'(progn
(require 'slime-fuzzy)
(setq slime-complete-symbol*-fancy t)
(setq slime-complete-symbol-function 'slime-fuzzy-complete-symbol)))
(defun run-clojure ()
"Starts clojure in Slime"
(interactive)
(slime 'clojure))
</.emacs>
And now "M-x run-clojure" starts slime with working completion.
For example after writing "w-o" and hitting TAB key I can see this:
user> (w-o
Completion: Flags: Score:
------------------------------ -------- --------
with-open -f---m-- 20,43
with-out-str -f---m-- 20,00
[...]
HTH,
Rob
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en