From 65812349dbf1fc3ff12e0f2ca6d73d7c439dd5d3 Mon Sep 17 00:00:00 2001 From: abp Date: Tue, 1 Apr 2014 12:41:32 +0200 Subject: [PATCH 1/2] cider compatibility Replaced nrepl-*-functions with the cider-*-equivalents where necessary. --- expectations-mode.el | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/expectations-mode.el b/expectations-mode.el index e335834..affdedf 100644 --- a/expectations-mode.el +++ b/expectations-mode.el @@ -36,7 +36,8 @@ ;;; Code: (require 'clojure-mode) -(require 'nrepl) +(require 'nrepl-client) +(require 'cider-interaction) (defface expectations-failure-face '((((class color) (background light)) @@ -84,7 +85,7 @@ (lambda (buffer value) (when stdout-handler (funcall stdout-handler value)) - (nrepl-emit-interactive-output value)) + (cider-repl-emit-interactive-output value)) (lambda (buffer err) (message (format "%s" err))) '()))) @@ -92,11 +93,11 @@ (defun expectations-eval (string &optional handler stdout-handler synch) (if synch (funcall handler (current-buffer) - (plist-get (nrepl-send-string-sync string (nrepl-current-ns)) :value) + (plist-get (nrepl-send-string-sync string (cider-current-ns)) :value) synch) (nrepl-send-string string (expectations-response-handler (or handler #'identity) stdout-handler) - (nrepl-current-ns)))) + (cider-current-ns)))) (defun expectations-test-clear (&optional callback synch) "Clear all counters and unmap generated vars for expectations" @@ -160,7 +161,7 @@ (defun expectations-run-and-extract-results (runner-fn buffer value &optional synch) (expectations-kill-compilation-buffer) (with-current-buffer buffer - (nrepl-load-current-buffer) + (cider-load-current-buffer) (expectations-eval (format "(do %s @@ -224,7 +225,7 @@ it." (filename (read (plist-get (nrepl-send-string-sync (format "(-> \"%s\" symbol ns-publics first val meta :file)" ns) - (nrepl-current-ns)) + (cider-current-ns)) :value)))) (list filename))) @@ -264,8 +265,8 @@ it." (let ((clj (format "(first (filter (fn [v] (>= (-> v meta :line) %d)) (sort-by (comp :line meta) (vals (ns-publics (find-ns '%s))))))" (line-number-at-pos) - (nrepl-current-ns)))) - (plist-get (nrepl-send-string-sync clj (nrepl-current-ns)) :value))) + (cider-current-ns)))) + (plist-get (nrepl-send-string-sync clj (cider-current-ns)) :value))) (defun expectations-run-test (&optional synch) "Run test at point" From 6f2e04ce694de08f5d0a0f7a66626e71d96bb23e Mon Sep 17 00:00:00 2001 From: abp Date: Tue, 1 Apr 2014 12:50:38 +0200 Subject: [PATCH 2/2] Missed a function when renaming nrepl-* to cider-* --- expectations-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/expectations-mode.el b/expectations-mode.el index affdedf..d00d75d 100644 --- a/expectations-mode.el +++ b/expectations-mode.el @@ -244,7 +244,7 @@ it." (defun expectations-display-compilation-buffer (out) (with-current-buffer (get-buffer-create "*expectations*") (expectations-results-mode) - (nrepl-emit-into-color-buffer (current-buffer) out) + (cider-emit-into-color-buffer (current-buffer) out) (display-buffer (current-buffer)) (setq next-error-last-buffer (current-buffer)) (compilation-set-window-height (get-buffer-window "*expectations*"))))