Skip to content
Browse files

clojure nrepl

  • Loading branch information...
1 parent 5a84dfd commit 1b2264509cf73a6ebe35a9fc42f064ff17ae76c6 @langmartin committed Mar 15, 2013
Showing with 26 additions and 9 deletions.
  1. +22 −4 rc-lisp.el
  2. +4 −5 rc-package.el
View
26 rc-lisp.el
@@ -38,17 +38,35 @@
(add-hook 'emacs-lisp-mode-hook 'turn-on-eldoc-mode)
(defun clojure-test-for (namespace)
+ "Returns the path of the test file for the given namespace."
(let* ((namespace (clojure-underscores-for-hyphens namespace))
(segments (split-string namespace "\\."))
- (before (subseq segments 0 clojure-test-ns-segment-position))
- (after (subseq segments clojure-test-ns-segment-position))
- (test-segments (append (list (car before)) (list "test") (cdr before) after)))
- (mapconcat 'identity test-segments "/")))
+ (segments (cons (car segments) (cons "test" (cdr segments)))))
+ (format "%stest/%s.clj"
+ (file-name-as-directory
+ (locate-dominating-file buffer-file-name "src/"))
+ (mapconcat 'identity segments "/"))))
(defun rc-clojure-indentation ()
(interactive)
(put-clojure-indent 'and-let 1)
(put-clojure-indent 'valid-let 1))
(rc-clojure-indentation)
+(defun insert-clojure-clear-ns ()
+ (interactive)
+ (insert "(doseq [[x _] (ns-map *ns*)] (ns-unmap *ns* x))"))
+
+(defun rc-clojure-nrepl ()
+ (require 'nrepl)
+ (add-hook 'nrepl-interaction-mode-hook 'nrepl-turn-on-eldoc-mode)
+ (setq nrepl-popup-stacktraces-in-repl t)
+ (add-to-list 'same-window-buffer-names "*nrepl*")
+ (add-hook 'nrepl-mode-hook 'subword-mode)
+ (add-hook 'nrepl-mode-hook 'paredit-mode)
+ (define-key clojure-mode-map (kbd "C-c C-z") 'nrepl-jack-in)
+ (setenv "JVM_OPTS" "-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n"))
+
+(rc-clojure-nrepl)
+
(provide 'rc-lisp)
View
9 rc-package.el
@@ -46,14 +46,13 @@ Otherwise warn."
jabber
magit
maxframe
- project-mode
- rcirc
session
;; Programming modes
- ;; js2-mode
+ js2-mode
clojure-mode
- org-compat
- zencoding
+ clojure-project-mode
+ nrepl
+ zencoding-mode
)))
(provide 'rc-package)

0 comments on commit 1b22645

Please sign in to comment.
Something went wrong with that request. Please try again.