diff --git a/CHANGELOG.md b/CHANGELOG.md index ce3055afc..2a2ba4efc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,8 @@ non-functioning `cider-test-jump` from test reports. `cider-repl-set-ns`'s behavior for ClojureScript. * [#950](https://github.com/clojure-emacs/cider/issues/950): Eval `ns` form in the `user` namespace when using `cider-interactive-eval`. +* [#954](https://github.com/clojure-emacs/cider/issues/954): Detect properly a project's root +when in buffer that's not visiting a file (e.g. a REPL buffer). ## 0.8.2 / 2014-12-21 diff --git a/nrepl-client.el b/nrepl-client.el index fe2a6a2c2..5c77a65b6 100644 --- a/nrepl-client.el +++ b/nrepl-client.el @@ -253,9 +253,9 @@ Bind the value of the provided KEYS and execute BODY." (defun nrepl-current-dir () "Return the directory of the current buffer." - (or (-when-let (file-name (buffer-file-name (current-buffer))) - (file-name-directory file-name)) - list-buffers-directory)) + (if buffer-file-name + (file-name-directory buffer-file-name) + default-directory)) (defun nrepl-local-host-p (host) "Return t if HOST is local." @@ -726,7 +726,7 @@ process." (nrepl-make-connection-default client-buf) (nrepl--init-client-sessions client-proc) (nrepl--init-capabilities client-buf) - + (with-current-buffer client-buf (run-hooks 'nrepl-connected-hook))