(setq load-path (cons "~/lib/emacs" load-path)) (setq inferior-lisp-program ; Path to java implementation (let* ((java-path "java") ; Extra command-line options ; to java. (java-options "") ; Base directory to Clojure. ; Change this accordingly. (clojure-path "/Users/fugalh/src/clojure/") ; The character between ; elements of your classpath. (class-path-delimiter ":") (class-path (mapconcat (lambda (s) s) ; Add other paths to this list ; if you want to have other ; things in your classpath. (list (concat clojure-path "clojure.jar")) class-path-delimiter))) (concat java-path " " java-options " -cp " class-path " clojure.lang.Repl"))) ;; Require clojure-mode to load and associate it to all .clj files. (require 'clojure-mode) (setq auto-mode-alist (cons '("\\.clj$" . clojure-mode) auto-mode-alist)) ;; These are extra key defines because I kept typing them. ;; Within clojure-mode, have Ctrl-x Ctrl-e evaluate the last ;; expression. ;; Ctrl-c Ctrl-e is also there, because I kept typoing it. (add-hook 'clojure-mode-hook '(lambda () (define-key clojure-mode-map [return] 'newline-and-indent) (define-key clojure-mode-map "\C-c\C-e" 'lisp-eval-last-sexp) (define-key clojure-mode-map "\C-x\C-e" 'lisp-eval-last-sexp)))