summaryrefslogtreecommitdiff
path: root/cider-repl.el
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2015-09-06 14:41:12 +0100
committerArtur Malabarba <bruce.connor.am@gmail.com>2015-09-06 17:29:27 +0100
commitf8b98b5ef215385b8ec4d5abc94fb3fa0b18cea1 (patch)
treeb6a015b3e88454f8d9350e5234f80a0f8b416df1 /cider-repl.el
parent86a0fcd05f212220b1ef9873dd960296d5a6926a (diff)
Change nrepl-base-response-handler to a hook, nrepl-response-handler-functions
This fixes incompatibility with Emacs 24.3.
Diffstat (limited to 'cider-repl.el')
-rw-r--r--cider-repl.el10
1 files changed, 4 insertions, 6 deletions
diff --git a/cider-repl.el b/cider-repl.el
index 212c9930..0759eb2e 100644
--- a/cider-repl.el
+++ b/cider-repl.el
@@ -171,10 +171,9 @@ PROJECT-DIR, HOST and PORT are as in `nrepl-make-buffer-name'."
(defun cider-repl--state-handler (response)
"Handle the server STATE.
Currently, this is only used to keep `cider-repl-type' updated."
- (ignore-errors
- (-when-let (state (nrepl-dict-get response "state"))
- (nrepl-dbind-response state (repl-type)
- (setq cider-repl-type repl-type)))))
+ (-when-let (state (nrepl-dict-get response "state"))
+ (nrepl-dbind-response state (repl-type)
+ (setq cider-repl-type repl-type))))
(defun cider-repl-create (endpoint)
"Create a REPL buffer and install `cider-repl-mode'.
@@ -196,8 +195,7 @@ ENDPOINT is a plist as returned by `nrepl-connect'."
(unless (derived-mode-p 'cider-repl-mode)
(cider-repl-mode))
(cider-repl-reset-markers)
- (add-function :before (local 'nrepl-base-response-handler)
- #'cider-repl--state-handler)
+ (add-hook 'nrepl-response-handler-functions #'cider-repl--state-handler nil 'local)
(add-hook 'nrepl-connected-hook 'cider--connected-handler nil 'local)
(add-hook 'nrepl-disconnected-hook 'cider--disconnected-handler nil 'local)
(current-buffer))))