clojure-emacs/cider — pull request #817 by vitoshka (2014-09-22 01:59:47+00:00)
Title: [Fix #814] Use `cider-current-ns` instead of `nrepl-buffer-ns`

The recent interactive eval improvements essentially broke eldoc, completion and all other stuff that relies directly or indirectly on `nrepl-buffer-ns`. This has to do with the fact that `:load-file` op returns `:main` or "user" ns and cider's default handler eagerly sets it everywhere it can. Therefore, after each interactive evaluation `nrepl-buffer-ns` has a wrong value.

The usage of `nrepl-buffer-ns` is unavoidable in special buffers (repl, scratch, macroexpanion, doc etc). It also might be used as a cache in clojure buffers, but then it should be reset to nil in buffer modification hook. It should be fine for now, but to fully set this issue straight one would need to set we need to rewrite the response handling first.

---
Other changes:

- Don't reset `nrepl-buffer-ns` in default response handler.

- Remove `cider-find-ns` (it's confusing to have two functions doing almost the same thing).

- Use nil global value of `nrepl-buffer-ns`. This will allow easy detection of cases when this variable is used but shouldn't.