Skip to content

Commit

Permalink
[Fix clojure-emacs#954] Detect project root properly in non file-visi…
Browse files Browse the repository at this point in the history
…ting buffers
  • Loading branch information
bbatsov committed Jan 31, 2015
1 parent 64b8832 commit 68de950
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions nrepl-client.el
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down Expand Up @@ -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))

Expand Down

0 comments on commit 68de950

Please sign in to comment.